Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDAQmx and popen()

Hello,

here is a simple application that opens a pipe and sends some message through it :

#include
#include

int main()
{
FILE* pipe;
pipe = popen("some_program", "w");
fprintf(pipe, "message\n");
pclose(pipe);
return 0;
}

I use NIDAQmx 8 on suse linux 10.0, and gcc 4.0.2
When I compile this program with :
gcc test.c
the pipe works. But when I link with libnidaqmx :
gcc test.c -lnidaqmx
the pipe does not work anymore (the listening program does not get the message).
Any advice about this problem ?

Thanks a lot,

JLode
0 Kudos
Message 1 of 2
(2,833 Views)
SUSE Linux 10.0 is not officially supported by DAQmx 8.0.  The reason it is not supported is because during our internal testing we experienced problems calling fork().  In your example popen() calls fork(), and thus you are seeing the same problem.

Your options are:

1.  Use an officially supported distribution, for example SuSE Linux Professional 9.3 (Check the README).
2.  Don't call fork() (or anything else that does), when linked with DAQmx
3.  Wait for the next version of the driver which will support SUSE Linux 10.0

Hope that helps

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 2 of 2
(2,819 Views)