LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a filter using dup, dup2 and pipe in CVI

In Visual C++, and on Linux and Unix it is possible to use the pipe concept to use an existing program as a filter or data source from within you program by using the functions dup, dup2, spawn or exec and pipe.
Basically, you create a pipe, replace stdout with the write side of the pipe, spawn the desired program, for instance " cmd /c dir", and then read the read end of the pipe to capture the result.
On the latest versions of Visual C++ these have been deprecated and I have used the replacement _dup, _dup2, _spawn and _pipe to accomplish this.
However, I can not find the equvalent in CVI. I can't even find the header files io.h, fcntl.h or process.h.
Is it possible to use this type of approach using CVI?
If so, How?
 
0 Kudos
Message 1 of 2
(3,377 Views)
Hi, klotz,

LabWindows is an ANSI C compiler. Are those functions mentioned by you ANSI C functions? If not, then you cannot use them directly in CVI. If you can use them in C++, your best bet would be to create a C++ DLL and use it in LabWindows. This pagehas some good info on using DLL in CVI.
Regards,

Song Du
Systems Software
National Instruments R&D
0 Kudos
Message 2 of 2
(3,341 Views)