LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RIO hangs up when tcp communication begins or ends

Hello, 


i'm working on a RIO targeted application that makes use of the STM2 library to send acquired datas to the host via TCP calls. The RT vi on the RIO, and the Host vi that receive the datas periodically check for a working tcp connection, to make it work whenever the RIO or the host was first powered on. The only trouble i get is that the RT application hangs up for a few seconds, even the highest priority timed loop, when the connection starts or ends. Is it an expected behavior ? Is there any mean of avoiding that ?

Thanks for any idea !

Vincent

PS : I use :
LabVIEW 8.6.1 package
STM library 2.0
9014 RIO controller running RIO 3.1 software
Vincent
0 Kudos
Message 1 of 4
(3,277 Views)

Hi VdG,

 

Thanks for posting on the National Instruments Forum. 

 

Can you post your code? Like that we will be able to help you to investigate the issue.

    Benjamin R.


Senior LabVIEW Developer @Neosoft


0 Kudos
Message 2 of 4
(3,243 Views)

Hi,

 

here's a screenshot of the communication part of the RIO vi, and a vi that sum up the communication part of the host vi (the Host application is quite huge, and not very well documented...).

 

Mainly the RIO periodically calls TCP_Listen with a short timeout, and the host periodically tries to initiate a connexion with TCP_Open. This works fine, but the RIO vi froze when the connexion establish. Maybe the RIO (sender) have to wait a for a while, between the connexion open and the first writings ?

 

Regards,

Vincent

Vincent
Download All
0 Kudos
Message 3 of 4
(3,233 Views)

Hi VdG,

 

Sorry for the late answer but I was unavailable this week. Well, on the cRIO controller there is a RT OS and normally we don't consider the communication with the host as a high priority task. You can implement Producer/Consumer architecture on your RT Target where the Producer contains the high priority task and the consumer the communication task with a less high priority. If you implement the communication in the highest priority loop it will cause the cRIO VI will wait for the communication is establish to run anything else.

 

You can find here good programming practices for RT application.

 

Hope this helps and feel free if you have any other questions.

    Benjamin R.


Senior LabVIEW Developer @Neosoft


0 Kudos
Message 4 of 4
(3,189 Views)