06-27-2018 07:02 PM
Hi
Im making some temperature readings from my cRio module using real time and im sending them via TCP, I use tcp builder to check if im sending the data correctly, and indeed I am, im receiving the temperatures of the thermocouples I have connected, the problem is that if for some reason I loose connection I cant reconnect to the server.
This is my VI at the moment, its really simple but it does send the data via TCP , the problem is I cant reconnect when I loose connection ,I need to reboot the cRio.
Solved! Go to Solution.
06-27-2018 08:50 PM
You need a sort of state Machine. This way, you can just go back to the connect stste when you lose your connection.
07-03-2018 01:41 PM
Check out the STM toolkit. It has some examples that show "re-connectable" tcp code.
07-03-2018 10:03 PM
Hi,
Thank you for your answer, but could you give me an example of this please, I'm new kinda new to Labview and still I havent been able to do this reconnectable TCP program.
Thanks!
Regards
07-05-2018 12:38 PM
What's wrong with the examples provided in the STM library? They're rather well documented. If it's a little too much complexity, have you considered network streams? I think reconnectablity is one of the primary goals it tries to solve.
07-06-2018 09:56 AM - edited 07-06-2018 09:56 AM
As I mentioned Im new to labview and yeah as you said its too much complexity, I see too much stuff I dont need and havent been able to adapt it to my project.
I dont know if you could point me in some of the examples the part of the reconnection, that would help me alot to implement it on my project.
Thank you
Regards.
07-06-2018 11:59 AM
Here's the core concept. The listener needs to be in a loop.
The "open connection" also needs to be in a loop. This example uses "connection manager" to share the connection with the lower loop (not shown)
I'm wondering though if you've ruled out higher level communication protocols like network streams, shared variables, etc. UDP is connectionless and might also work better for you.