LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling perl script from labview

Your picture did no show up in my display for whatever reason. I looked at some old code that worked on Labview 6 on Win 98. I do not know if this will help, we invoke the perl script using perl d:\... This generated a separate window that a user could interfae with.

We are using active perl at this time.

0 Kudos
Message 11 of 16
(2,305 Views)
Hi,
Could you attach the picture you posted earlier?  It does not show up properly now.  You should be able to LabVIEW to type keystrokes and here is an article that discusses it.
Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 12 of 16
(2,303 Views)
Your error is a perl error, not a Labview error and is caused my redirecting output from the perl script to somewhere other than the STDOUT (using Activestate, the windows cmd window)

GetConsoleMode failed, LastError=|6| at C:/Perl/site/lib/Term/ReadKey.pm line 264.

Could you post both your perl code and the block diagram of how you call the script from System Exec, depending on what your doing the problem can probably be solved by removing the refernece in the perl code which cause output to go somewhere other than STDOUT.  Alternativly it might be possibe to call your script in a different manner than the standard method using cmd /c c:\perl\xxxx.pl in System Exec.

Good Luck

0 Kudos
Message 13 of 16
(2,289 Views)
Forget my last post, I'm sorry I needed to do a little more research and read your problem more carefully, I think your error is being caused because System Exec wants to read a command, and have the executable return an output throug through STDOUT. 

Your program waits for a keyboard input from you correct?  Could you remove the ReadKey module refs from you code and programatically pass the data you need to pass to perl in your  pl script itself?

Again my apologies, for jumping the gun with my last post,  too little research, too little time,  I use failry simple perls scritps (UTM to Lat Lon conversion, and some astro stuff) that require no input from the keyboard and they play nicely with Sys Exec.

BTW if I'm off base please let me know but the community as a whole would probably be able to help more if you post specifics, i.e. source code and/or screen shots.

Good Luck
0 Kudos
Message 14 of 16
(2,273 Views)
Hi all,
 
Attached the image for your reference.
 
 
0 Kudos
Message 15 of 16
(2,262 Views)

I wired up a perl script using active state 5.8.8 822 build. If I just execute the script via command test_err_mesg.pl, it generates the following 2 types of error code 3 (something to do with a GPIB error) and 193 (makes more sense). The code 3 appears before I saved the vi and 193 after I saved the VI.

I find that if I execute perl test_err_mesg.pl it will open a menu and allow the perl script to run properly, note wait until completion is set to false.

 

0 Kudos
Message 16 of 16
(2,242 Views)