Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Reconnectable TCP IP cRio

Solved!
Go to solution

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.

tcp.PNG

 

 

0 Kudos
Message 1 of 7
(3,500 Views)

You need a sort of state Machine.  This way, you can just go back to the connect stste when you lose your connection.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(3,481 Views)

Check out the STM toolkit. It has some examples that show "re-connectable" tcp code.

http://sine.ni.com/nips/cds/view/p/lang/en/nid/212055

0 Kudos
Message 3 of 7
(3,466 Views)

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

0 Kudos
Message 4 of 7
(3,463 Views)

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.

0 Kudos
Message 5 of 7
(3,442 Views)

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.

0 Kudos
Message 6 of 7
(3,434 Views)
Solution
Accepted by topic author Ricardogfx

 

Here's the core concept. The listener needs to be in a loop.

Listener.PNG

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)

Open Conn2.PNG

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.

 

0 Kudos
Message 7 of 7
(3,427 Views)