Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

cRIO RT application freezes

Hi,

I'm currently developing a RT application running on cRIO. The application has 6 parallel loops, and communications between loops is done by lv2 variables. 3 of the loops are interfacing against a FPGA vi, and one of these loops is time-critical.


My problem is that the whole applications freezes randomly for several seconds, all the loops hangs and communication against FPGA freezes. RT target is not lost when it happens and the application continues like before after the freeze.


Does anyone know what the problem might be?

Best regards,
Per
0 Kudos
Message 1 of 13
(35,327 Views)

Additional information:

The problem seems to disappear when running the application as a standalone without any  host connected. When I connect to target with my host Labwindows/CVI application the application freezes again for several seconds, the same behaviour is present when using Labview remote panel. The problem seems to be related to TCP/IP communication. How to make reliable target to host applications in LV? I'm currently using LV 7.1 but will soon upgrade to LV 8.0.

Please help! This is supposed to be a real-time application!

Regards,

Per

0 Kudos
Message 2 of 13
(35,316 Views)
Here is an excellent document on communications and LabVIEW RT.
Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 3 of 13
(35,315 Views)

Thank you for the information. But it does not solve my problem, my target application is very similar to the one described in your link. The problem seems to be that all LV threads freezes occasionally when target is connected to host, even the internal millisecond timer is not updated during the hang up. And the application freezes regardless of connected to LV remote panel or my CVI host application, I have also tried to remove my TCP server code without result.


I’m wondering if there’s something wrong with my target application code, or if the behaviour is caused by some deadlock in LV TCP communication. Since my target is running smoothly when not connected to any host the latter seems most likely.

What do you think?

Regards,

Per

0 Kudos
Message 4 of 13
(35,312 Views)
How is your memory?  Try using the RT system monitor to see how close to full memory you are.  If you run out of memory, then you are likely to see a hang up. 
Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 5 of 13
(35,310 Views)

You may be right I’m close to full memory, this is my memory status:
Total: 32376K
Used: 28990K
Aviable: 3385K
Contiguous: 2052K


Here is the memory status from a smaller version of my application, but still has the same hang up problem as above:
Total: 32376K
Used: 26972K
Aviable: 5404K
Contiguous: 3128K


Do you think free memory could be too small? Most memory for arrays is ablactated in advance, and the memory status in RT system monitor is very stable over time.

Per
0 Kudos
Message 6 of 13
(35,317 Views)

I am not sure where the memory limitation is and at what levels LabVIEW has a hard time.  However, here are some links that may help you reduce your memory usage:

 ftp://ftp.ni.com/evaluation/niweek/proceedingscd/real_time_control_embedded/benchmarking_optimizing....

ftp://ftp.ni.com/evaluation/niweek/proceedingscd/software_development/labview_development_tips.pdf

 http://zone.ni.com/devzone/conceptd.nsf/webmain/732CEC772AA4FBE586256A37005541D3

http://zone.ni.com/devzone/conceptd.nsf/webmain/6A56C174EABA7BBD86256E58005D9712

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=BEABFF12019F1037E034080020E74861&p_...

         

Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 7 of 13
(35,295 Views)

I have now built a small application with FPGA interface to sort out all other problems then too large memory consumption. I simulated high memory consumption by adding large dummy arrays, when available memory was smaller then 7000-8000K the application started to hang.


The OS memory usage is approx 8MB, the FPGA interface and code is approx 8MB, this means that I have only 7-8MB space left to the rest of my program. I probably need to upgrade my real-time controller to the 64MB version.


Thanks for your advice, it was very helpful and you pointed me to the right direction.


Best regards,

Per

0 Kudos
Message 8 of 13
(35,276 Views)

With LabVIEW 8.0, there are utilities to load your FPGA bitstream directly to the FPGA flash.  This would allow you to strip the bitstream from your LabVIEW RT code, and save some memory there. 

 

Preston Johnson
Solutions Manager, Industrial IoT: Condition Monitoring and Predictive Analytics
cbt
512 431 2371
preston.johnson@cbtechinc
0 Kudos
Message 9 of 13
(35,263 Views)
LV 8.0 is now installed. Both memory consumtion and CPU load is generally lower, which is very good!

You mentioned that I could strip mye FPGA bitstream from my RT code, how is this done? I tried to download the FPGA VI directly into the flash by right clicking on the VI in the project explorer and selecting "Download VI or attributes to flash memory" and then download. But the memory consumtion was not decreased.

Per
0 Kudos
Message 10 of 13
(35,212 Views)