Jump to content

PERL and LabVIEW


Recommended Posts

Using LabVIEW I would like to create a pipe to PERL so that I can interactively execute PERL commands. I have been trying to create the PIPE with the command line "perl.exe -de 42" to start up the debugger, but it opens a terminal window and requires me to type in the commands. It appears as if the PERL debugger does not connect to the standard IO streams.

I am using:

Windows 2000

LabVIEW: 7.0

OpenG Pipe Toolkit: From CVS on April 6, 2005

Perl: ActivePERL 5.22

Does anyone know how to get this to work? Is there a way to tell PERL (or the PERL debugger) to attached to the standard input and output streams? Any other ideas?

Unfortunately I must keep perl.exe running for what I am doing and cannot call it with a number of small scripts.

I've attached a test VI (including the necessary PIPE vi's from CVS) if anyones interested in testing. You will need ActivePERL V5.22 installed, be running windows NT/2000/XP and will have to update the PERL5LIB path on the block diagram. The test VI demonstrates that the DIR command works as expected, while the PERL command does not.

BTW, there does seem to be a bug in the openG pipe library where the first call to it doesn't properly attach to the standard output stream. You can see this with the test VI without installing PERL.

Thanks for the help

Download File:post-2949-1144443407.llb

Link to comment

So after a few more hours of testing I think I've got a solution,

I had to set the environment variables as follows before starting up the PERL debugger

PERLIO=:stdio

PERLDB_OPTS=TTY=/dev/tty0 Readline=0

Hope this helps someone.

Now I have the problem that the PIPES don't seem to be working in LabVIEW 8.0. Guess this projects stays with 7.x

Link to comment
Now I have the problem that the PIPES don't seem to be working in LabVIEW 8.0. Guess this projects stays with 7.x

As the original author of the OpenG Pipe source code I can only say that the code as present now is still an alpha work in progress. I haven't found much time to go deeper into it and just got it so far to work somehow under Windows although there needs to be done more testing and also the Linux and MacOS parts would be nice to have.

What might be the problem with LabVIEW 8 I have really no idea. Pipes under Windows at least are a somewhat fragile technology with lots of possible problems and it is very well possible that LabVIEW 8.0 does something with the Command Line Console for its own internal dirty work that might conflict with trying to redirect standard IO to pipes.

I haven't currently any time to dig deeper into this so anyone with some C programming knowledge feel free to investigate what might be the problem. The code comes with the source code for a simple command line executable that can act as loopback device so it is definitely a good idea to try to make the DLL work with that example under LabVIEW 8 first. If this works but not with PErl then it is likely that Perl does some weird stuff too that clashes somehow with LabVIEW 8.

Rolf Kalbermatter

Link to comment
  • 1 year later...

QUOTE(Michael Ashe @ Apr 7 2006, 09:23 PM)

I just tried LVPerl and get the following error "TCP Open Connection in Open Perl Connection.vi". The Open Perl Connection.vi says that the remote port must match Perl's. How do I know what port to use for Perl?

George

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.