PDA

View Full Version : FIFO's and process communication ME10 Rev 8.7


Chris White
07-25-2000, 06:51 AM
I'm trying to get a perl script to send ME10 a command line "LET Joevar 'somevalue'" and have the Me10 macro execute it and recognize the value later on in the script. I've tried several different iterations of EXECUTE_STRING and VAL per the manual with no luck. I've even tried sending the commands one word at a time with no luck. What I ended up doing was just sending the value and letting the macro do "LET Myvar Varfromfifo". There must be an easier way. The LET command works but it doesn't retain the variable value after the command. Here's the way I ended up writing it: DEFINE Get_PTK_Info LET Docno "" LET Docsheet "" LET Docrev "" RUN GRAPHIC '/etc/mknod messg1 p' {Create the FIFO} RUN GRAPHIC '/home/chrwhite/me10_perl_integration/me10_tk_dialog.pl > m essg1&' {Start the Program} OPEN_INFILE 1 'messg1' OPEN_OUTFILE 3 DEL_OLD '/home/chrwhite/me10_perl_integration/outfile' READ_FILE 1 Cmd WHILE (Cmd<>'DONE') IF (Cmd='START_DEFINE') { Start of Macro Def from perl } READ_FILE 1 Cmdvar { Read the variable } READ_FILE 1 Cmdval { Read the value } IF ( Cmdvar = "Docno" ) {match variable to internal} LET Docno Cmdval { set it to extrnal val } END_IF IF ( Cmdvar = "Docsheet" ) LET Docsheet Cmdval END_IF IF ( Cmdvar = "Docrev" ) LET Docrev Cmdval END_IF END_IF READ_FILE 1 Cmd END_WHILE DISPLAY Docno DISPLAY Docsheet DISPLAY Docrev WRITE_FILE 3 ('Docno:'+Docno) WRITE_FILE 3 ('Docsheet:'+Docsheet) WRITE_FILE 3 ('Docrev:'+Docrev) CLOSE_FILE 3 CLOSE_FILE 1 RUN GRAPHIC 'rm messg1' {Create the FIFO} END_DEFINE Here's some sample output from the perl script to the FIFO that ME10 reads as 1. START START_DEFINE Docno 123 END_DEFINE START_DEFINE Docsheet 123 END_DEFINE START_DEFINE Docrev 1 END_DEFINE DONE Any ideas on how I can do this better? Id like the perl script to send an entire command of "LET Blah Blah" and have me10 execute it successfully but it doesn't. I realize that this can be done all in ME10 but I'm writing a tkperl GUI that has functionality requirements that exceed ME10's macro language capabilities.