From: Rolf K. <rol...@ci...> - 2004-02-29 21:43:13
|
Hi Jim =20 > I haven't done any works with pipes in Windows and did a little bit of > research. I found the following on MSDN: >=20 > = <http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/dllpr= oc/base/creating_a_child_process_with_redirected_input_and_output.asp> >Has anyone gotten pipes working in LabVIEW? Would anyone more C++ = savvy >than myself be interested in working with me to get a generic "System = Exec >w/ Pipes" working? I envision a DLL that could be called from LabVIEW = (or >maybe LabVIEW could call WinAPI DLLs directly) with functions for = Spawning >the Process (the command-line executable), Reading from, and Writing to = a >Pipe for communication with the running executable. I haven't done anything with pipes yet although it isn't really = difficult. The article you qoute seems fairly straight forward. I think the current System Exec most probably uses pipes for the three standard IO handles = to get the StdIn/Out and Err at all. What is the problem is that you do not get the handle back but just the entire text after execution of the = command. I think although it might be sort of possible to go directly from = LabVIEW to the Win32 API, it is a much better and smarter aproach to pack = everything into a DLL. Instead of returning the entire StdOut/Err text at once it = would return the three handles which can then be used by other DLL functions = to read and write to/from those handles. The code as shown in above example would almost work for that already. = At the moment I'm busy getting the Generic PortIO device driver working (Well = generic in that it supports Port IO in direct fast and indirect slow mode (the = one the current LabVIEW PortIO functions support) and possibly low mem access, = not multiplattform although I got a Linux example too, just need to adapt it = a bit to get it working nicely with LabVIEW.) I hope I have it ready end of = this week and then I'll look into the inherited pipe system exec if nobody else = stepped up to it until then. Rolf Kalbermatter |