07-31-2019 09:47 AM
I have my network stream set up to send data from the host to the Real Time target. Works like it should. When I try to have bidirectional communication as in setting up a second set of network stream endpoints so that the Real Time target writes data back to the host machine it doesn't work/loses connection. I'm using a myRIO 1900. Is there anything special about setting up a second set of network stream endpoints that I'm missing?
Solved! Go to Solution.
07-31-2019 09:56 AM
Where are you setting up the RT Writer?
So I have a fundamental issue with just what I have seen in your code. Your streams really should be set up to run in parallel loops. You should have one loop for Read and another loop for the Write. And these should be in parallel with your main code. You use queues and user events to pass data to/from your main loop and these communication loops. The main reason for doing this is you can easily add code to automatically attempt to reconnect when a connection is lost. Notice that this would eliminate the need for your global variables (which are what really scare me with your code).
08-13-2019 11:17 AM
Resolved. Images of working changes made to network streams attached.