10-07-2015 11:00 AM
Hello,
I need to read data from named pipe in windows. The pipe is created by python by another application. This application continuously post the data to the pipe. But i am not sure how to read that data using labview. is possible to read the data from different application? if possible, how to start?
Thanks in advance
regards
RJ
Solved! Go to Solution.
10-07-2015 11:04 AM
Did you try Google? https://www.google.co.uk/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=labview%20named%20pip...
It seems there are some libraries already for doing this, if you do a bit of digging around.
10-07-2015 11:38 AM - edited 10-07-2015 11:38 AM
Hi Sam,
I tried, it given some confusions and some clarities. i have checked the LV Process, openG implementation. but its not certain, how can i access data from named pipe, created by another application(developed in python). i know the name of the pipe.
Thanks in advance
RJ
10-08-2015 02:23 AM
And what are your problems exactly? What have you really tried?
10-08-2015 07:30 AM
Hi Rolf,
i read the data using the openG Implementation library, but its giving error Labview Generic error 42, from second time onwards. i have attached the screenshot and VI.
Thanks in Advance.
RJ
10-08-2015 04:33 PM
do you see anything in the eof? status? Is your library really supposed to send more than one datagram over the pipe at a time?
10-09-2015 04:32 AM - edited 10-09-2015 04:33 AM
Hi Rolf,
I observed one morething.
1). The above code is running normal if vi enabled highlight execution. its not returning any error 42. after one loop in read pipe if i disabled highlight execution, then code continuing normally and data was fetched as realtime.
2) But if vi starts without highlight execution, its giving error 42 at read pipe in the first loop itself. The eof status is false,
I guess, library able to send more than one datagram over the pipe at a time. because in first case its working. but i didnt understand, how highlight execution making difference? is anywhere in my VI needed to add some delay?
Thanks
Best Regards
Rj
10-09-2015 06:46 AM
Probably!
It seems that your application takes longer for accepting the pipe connection and sending some data, so when the Pipe Read is executed the pipe is not yet really connected. I would be interesting to get more information about what error causes the error 42. The DLL does attempt to translate the Windows API errors into a meaningful LabVIEW error but can only do so much about guessing what errors can get returned. The error returned by the ReadFile call in your specific situation is not one of the expected ones and therefore results into translation into the generic catch everything else case.
I'll probably try to do some debugging on this in the near future but for now a delay after the Open Pipe function should probably be a workable workaround.
10-09-2015 07:59 AM
Hi Rolf,
That is right, due to pipe is not initialized completely, the pipe read is returning error 42, i added 2 sec of delay, then its working perfect.
Thanks very much.
Regards
RJ