06-19-2024 12:43 PM
Hi All,
I have created simple server and client VIs using .NET 4.0 to test out named pipes. The server side creates a NamedPipeServerStream, then waits for a connection. The client side creates a NamedPipeClientStream and then connects. On the client side, IsConnected = True and NumberOfServerInstances = 1, indicating that it thinks it is connected. If I close the server pipe, IsConnected changes to False and NumberOfServerInstances changes to 0, again making it look like all is fine on the Client side. On the Server side, IsConnected always is False. If I ignore that and just try to send a value using WriteByte, it does not get picked up by the Client ReadByte.
VIs are attached.
Any help would be greatly appreciated!
John
Solved! Go to Solution.
06-20-2024 04:00 AM - edited 06-20-2024 04:04 AM
I don't know why the client says it's connected. Guess it is establishing a connection, and it assumes the server will connect too.
At the server side, use WaitForConnected to actually make the connection.
Then, do yourself a favor and figure out how to use Connect(timeout), WaitForConnectionAsync and ReadASync. If you don't, LV will hang forever ("Resetting VI") when you abort the VI.
And please don't wire error wires behind nodes so it looks as they're connected (Client's Connect method)!
06-20-2024 08:24 AM
Thanks so much! That fixed it. I will also look into those other methods; I have hung up LabView and had to end it with Task Manager.
I know better with the error wire; I just somehow screwed that up.
Thanks again.
John