Im trying to use the ipcbeginprocess command to pass data between skill and perl. it works , but I do get some issues.
Im doing the next :
lunching the perl script from a button in my schematic with the next skill script :
msgHandler = lambda( (cid data)
printf("\n[CCSbla bla: %s]\n%s" cid data))
errHandler = lambda( (cid data)
printf("\n[CCSbla1 bla2: %s]\n%s" cid data))
PinList = nil
"/home/menyl/UltraSimPerl.pl" "" msgHandler errHandler)
ipcWaitForProcess(cid 5 )
than the perl script pop up a gui with buttons, and a press on one of the buttosn shoud print to the CIW the data from the perl
script, along with the ipc id ( should be ipc:xx \n hello meny) . the thing is that it doesnt happen , no matter how many times I press
on the button. i tried to ipcReadProcess the cid. I got: " ". the only I get the data on the CIW is when I close the perl GUI - than I see exactly the string Im expecting , and in the same number of times I press the button - so the work get done, but from some reason the data transfer get blocked . or maybe I just dont use the ipc protocol right.
In reply to skillUser:
The easiest way to do this in perl is to set the $| variable:
$|=1;print "now you see it...\n";sleep 10;print "now you don't...\n";
If you run this perl script as "perl example.pl > test.out" and do a "tail -f test.out" you'll see the two lines appear, one at a time. Without the $| setting, you'll only see both lines appear as the program finishes, because of output buffering.
In reply to Andrew Beckett:
Thank you. that was the case indeed. it works fine now.
I do have one more question. if the perl script ( that was launced from skill with ipcbeginProcess) should launce a skill script, instaed of just print "hello meny", ( for example a script that read all schematic pins/terminals), should it be also launced with ipcbeginprocess that contain data handler and err handler ? assuming the the pin list needs to be delevier back to perl.