LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unix pipes in labview 7 - does it work?

Hello,
I spent a few hours trying to figure out what is wrong with the named pipes vi's (LabVIEW 7 on redhat linux FC1). I open a pipe for read/write (and doing a ps shows that the command line is running) I write to it but I read nothing!. No errors from the vi's error outputs, neither from the standard error (probably I can't read from there either...). I close the read/write pipe, ps shows that command is not running anymore. Nothing from the logs also. Everything seems to be fine but I can't read!.
0 Kudos
Message 1 of 5
(3,423 Views)
We are aware of this problem in both the Linux and Solaris versions of LabVIEW 7 Express and our intention is to release a fix in a future version of LabVIEW.

While the VI is returning an error 10, it is still opening a connection to the pipe that is readable and writeable. A warning is generated internally by the VI is being passed out when it should be ignored.

To work around this issue you will need to replace the Open Pipe.vi in the ./vi.lib/Platform/system.llb with the VI attached.

This new VI is a wrapper for the Open Pipe.vi that will reset the error cluster if it reads in an error 10.
0 Kudos
Message 2 of 5
(3,422 Views)
Do you have experience with pipes in other languages, like Perl? In the
pipes I have used in Perl, I have to spawn a child process for pipe
communication, and that process has to obey the IO protocol: responding
to defined commands. Also, I have to open two pipes, one for reading and
one for writing.

rdr = pipe for reading
wdr = pipe for writing
&open2 spawns a new process and opens two pipes.


#!/usr/bin/perl
require "fopen2.pl";
print "I am starting to run...\n";
$NewPID=&open2(rdr, wdr, "kermit");
print "The new pid is: ", $NewPID, "\n";
print wdr "take world28\n";
#$NumRead = read( rdr, $buf,80 );
$ho = ;
print $ho;
$ho = ;
print $ho;
$ho = ;
print $ho;
$ho = ;
print $ho;
$ho = ;
print $ho;
#print $NumRead, "\n";
$NumRead =
read( rdr, $buf,80 );
print ;
print $NumRead,"\n";
$NumRead = read( rdr, $buf,1000 );
print $NumRead, "\n";
$NumRead = read( rdr, $buf,2000 );
print $NumRead,"\n";
kill 9, $NewPID;


Of course, I have not had kermit on my system for (ahem) 6 years.



mike_lachaine wrote:
> Hello,
> I spent a few hours trying to figure out what is wrong with the named
> pipes vi's (LabVIEW 7 on redhat linux FC1). I open a pipe for
> read/write (and doing a ps shows that the command line is running) I
> write to it but I read nothing!. No errors from the vi's error
> outputs, neither from the standard error (probably I can't read from
> there either...). I close the read/write pipe, ps shows that command
> is not running anymore. Nothing from the logs also. Everything seems
> to be fine but I can't read!.
0 Kudos
Message 3 of 5
(3,422 Views)
Hello:

I'm having the same problem. I don't know if I'm using the pipes correctly.

Maybe a little more documentation of how to use them could be more helpful.

For example, in order to learn how to use pipes, I'm trying to play mp3 using pipes and mpeg123. I'm successful playing mp3, but I can't tell when the mp3 has finished, or how to control it.

I would appreciate any help that leads me to understand pipes on Linux. This will be the big start to leave MS behind.

Regards,

Mauricio
Mauricio Vidal
VIDAL & ASTUDILLO Ltda.
http://www.vidalastudillo.com
0 Kudos
Message 4 of 5
(3,422 Views)
Does anyone have a working LabVIEW for Linux Pipes example they would like to share?

I'm running LV711 on Windows XP SP2 and Fedora (FC4) but I've yet to see this feature working. We have an Linux/Windows executable that we'd like to send data repeatively through the standard input and monitor the standard output in real-time (i.e. not wait for System Exec.vi to finish).

I've had a look at the OpenG library (ogpip.llb) as referenced here ("Does LabView support the Named Pipe function for interprocess communications"). This lib looks promising but I can't seem to access Sourceforge's CVS repository to look at the "test" directory examples.

Does anyone have these at hand?

-Chroma


0 Kudos
Message 5 of 5
(3,178 Views)