Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

RIO hangs when using web server and tcp communication

Solved!
Go to solution

Hi,


my cRIO controller hangs after a short time (typically less than one minute), when i simultaneously use the web server (to interact with a remote panel) and make some tcp communications (using STM 2.0 library) for data logging. Is it a controller global performance issue, or a network bandwith issue (i'm only sending a few values every 100ms), or a programming issue ; in this last case, what should i take care of to make the system more stable ?

Regards,


PS : i'm using a cRIO 9022 with LV 2009f2 + RT and NI-RIO 3.3.0
Vincent
0 Kudos
Message 1 of 10
(5,134 Views)

Vincent,

 

By hang I assume you mean that the host loses communication and pops up a dialog along those lines?  What steps do you have to take to get out of that state?

 

If I understand correctly, just the tcp communication or just the web server is fine indefinitely.  Is simply having the webserver enabled enough to cause the hang or do you have to be interacting with it?

 

If you are able to post your code that would help with debugging.  I'm also curious if anything is printed to the console (http://digital.ni.com/public.nsf/allkb/354A5124E6A667988625701B004A77CD)

 

Thanks,

 

Sebastian

Message Edited by speleato on 11-26-2009 09:37 AM
0 Kudos
Message 2 of 10
(5,133 Views)

Sorry if i was not clear...By hang, i mean sometimes a total crash (no more tcp, web server and application stopped), sometimes just the network stopped, and the application recover when i close all networked tasks. It happens whenever i launch the remote panel first, or the data logging STM connection first.
Looking at the processor load with the distributed system manager, i saw that my application alone shows only 25%. So i don't think this is a processor overloas issue. I also tried to change the tcp port i use for the STM communication without any change in the behavior. 


About using the monitor mode of the RIO, it's not easy for me, because my application uses the COM to drive a small LCD with command buttons.
I've attached some screenshots of my diagrams. The Sender executes on the cRIO (timed loop at 100ms) and the receiver on the PC. On the cRIO there is two others parrallel loops running, one fast (10ms) with greater priority, and one slow with the same priority than the STM loop. The receiver sub-vi is called at the same rate (100ms) by the top-level vi.
If it's a network overload issue, is there any mean of changing the web server network load ?

Vincent
0 Kudos
Message 3 of 10
(5,110 Views)

Hi,

Can you post your code, it will be easier to help you?

 

May be your computer take too much time to respond, or the bandwitch of the network is not sufficient.

Can you try to increase the time loop of TCP communication and try to decrease the amount of data which is send over the network.

 

Regard.

Yann C.

France

0 Kudos
Message 4 of 10
(5,064 Views)
well, meanwhile i've tried to slow down the tcp data logging, and it seems it's working quite well, or maybe the it will hang after a greater time...But it's very surprising because the cRIO and the PC are just connected together with a twisted ethernet cable, and no other computer can reduce the network bandwidth. Transferring 10 sample/s (* 5 channels) looks like a very reasonable goal, isn't it ? Once again, is there any documentation about the web server network load, or is there any tweaking that can reduce it ? Or maybe i've to switch do udp communication, but the possibility of loosing some data is quite bad...
Please find attached some of my vis : Presse.vi is the top level vi running on the cRIO. Init.vi is the initialisation vi of the project running on the pc, and PresseRecepteur.vi is the receiver subvi.
Vincent
Download All
0 Kudos
Message 5 of 10
(5,052 Views)
Solution
Accepted by topic author VdG

Hi,

Can you try with a simple while loop+delay instead of timed loop for the TCP communication loop.

Regards

Yann C.

France

0 Kudos
Message 6 of 10
(5,047 Views)
Yes, it's workingSmiley Happy but can you explain why ?
Vincent
0 Kudos
Message 7 of 10
(5,043 Views)

I experienced a similar issue.

 

It seems LV RT does not like having a blocking function within a timed loop.  As soon as the blocking function takes longer than the loop rate, LV RT would crash.

0 Kudos
Message 8 of 10
(5,029 Views)
Well, can anyone from NI give some links for guidelines about loop structures under LV RT (benefits and drawbacks of timed loop vs while loop with timer) ?
In my case, i wonder about the priority of the while loop with timer, over the time critical timed loop : i hope the late one is still of higher priority...
Vincent
0 Kudos
Message 9 of 10
(5,011 Views)

Hi,

The while loop have the same priority of the Vi, the timed while loop have a priority between high and critical.

To know the priority of your Vi: Ctrl+I » Execution.

Regards

Yann C.

France

0 Kudos
Message 10 of 10
(5,002 Views)