LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP connection on realtime error

Solved!
Go to solution

Hello all

 

I am using a cRIO 9063 controller and want to connect up to a Moxa Serial to Ethernet controller via TCP/IP. I am using the VIs available in the TCP palette to achieve connection and exchange data. This all works fine when I run/test the VI on my computer against the realtime target, but the moment I deploy it to run under realtime as startup, it can't establish connection and I recieve error code 59 (The network is down, unreachable, or has been reset). I have set the VI frontpanel as a webpage to follow progress from where I get the error message.

The cRIO and Moxa is connected via a switch and are on the same subnet address and everything is kept as simple as possible.

 

I have looked through MAX to see if I was missing any software, but haven't been able to figure a solution there, nor by selecting any other setting in MAX or Labview.

Could someone tell what is required to achieve a TCP connection running on Realtime. What would I be missing?

 

Thanks in advance 🙂

 

 

 

 

0 Kudos
Message 1 of 7
(5,390 Views)

Can you post your code? The TCP/IP VIs run fine on a cRIO 9063. The Real-Time Runtime Engine is enough.

Regards, Jens

 

EDIT: Just a wild idea: Perhaps you are trying to open the TCP/IP connection to early after startup of the rtexe?

Kudos are welcome...
0 Kudos
Message 2 of 7
(5,373 Views)

Hello

 

It is part of a bigger VI so I'll just drop a dump of it. It reports error when trying to open the TCP connection. I have verified that the IP and port fields are valid with proper information to connect up against. Basically I open the connection, send commands to my serial target and read responses. I save the TCP connection ID in a feedback node, call on it when needed and close it at the end.

My question, between the lines in addition, would be what distinguishes running the VI on my computer against realtime where it works compared to when I want it to run "unmanaged" with runtime.

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

Hello

 

It is part of a bigger VI so I'll just drop a dump of it. It reports error when trying to open the TCP connection. I have verified that the IP and port fields are valid with proper information to connect up against. Basically I open the connection, send commands to my serial target and read responses. I save the TCP connection ID in a feedback node, call on it when needed and close it at the end.

My question, between the lines in addition, would be what distinguishes running the VI on my computer against realtime where it works compared to when I want it to run "unmanaged" with runtime.

0 Kudos
Message 4 of 7
(5,353 Views)

As already stated TCP/IP runs fine inside a rtexe. What are the network settings on your cRIO? It might be a good idea to try to open the TCP/IP connection several times inside a loop. Something like this, since it might take some time directly after the start of the system for the network to be accessible:


grafik.png

 

 

 

 

 

 

 

 

 

 

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 5 of 7
(5,342 Views)
Solution
Accepted by topic author EUL

@jg69 wrote:

As already stated TCP/IP runs fine inside a rtexe. What are the network settings on your cRIO? It might be a good idea to try to open the TCP/IP connection several times inside a loop. Something like this, since it might take some time directly after the start of the system for the network to be accessible:


grafik.png

 


 

 

 

 

 

 

 

 

I've noticed this is the case on the linux targets. In my case, str to IP only returns 127.0.0.1 for the first 5-10 seconds.

Message 6 of 7
(5,324 Views)

Hi jg69

 

Thank you very much. That seems to be have been the case as I get the TCP connection now.

0 Kudos
Message 7 of 7
(5,312 Views)