Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Heartbeat for cRIO

Hello,

 

I have an issue with one machine which sometimes the main .vi on PC freezes.

It is a GUI in PC which commands a cRIO for Input and Output control. 

What happens is that when the GUI freezes the cRIO continues operating with the set variables causing some issues.

 

I currently have a heart beat system using shared variables. On main .vi a random number generator, generating a number to a shared variable.

Then on cRIO a Read Variable with Timeout function which the timeout is linked to a case structure and if there is a timeout the cRIO resets all ouputs.

 

But this approach seems not to be working.

Do you know any other approach for this issue or am I doing anything wrong?

 

Thank you.

0 Kudos
Message 1 of 6
(1,432 Views)

General advice: Avoid Network Published Shared Variables.  They are slow and insecure.

 

What I do is have a loop on the cRIO that does nothing but communicate with the host over TCP/IP.  Queues are used for getting messages sent by this module and to return data received by the host.  If the read from the host times out, I declare that the connection is bad, disconnect, and do whatever I need to with the outputs.  This assumes that regular communications is being performed by both the host and cRIO.


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 6
(1,414 Views)

How to Detect Network Connection Loss of NI Real-Time Target

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 3 of 6
(1,407 Views)

This is a similar approach of what I already have.

 

One question that came to my mind. If the cRIO software crashes how the outputs behave? Will they have the same state as prior to the crash or will they reset?

0 Kudos
Message 4 of 6
(1,372 Views)

@frajocosta wrote:

One question that came to my mind. If the cRIO software crashes how the outputs behave? Will they have the same state as prior to the crash or will they reset?


If you are just using the Scan Engine, the outputs will freeze where they are at.  If using the FPGA interface, then you should have a watchdog signal to the FPGA and then the FPGA should shut everything down when the heartbeat has a timeout.  I typically see this done by just having the RT set a latched Boolean control to TRUE every so often.  When the FPGA reads it, the latching action will cause the control to reset to FALSE.  If the control stays FALSE too many times, then you have the timeout.


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 5 of 6
(1,358 Views)

To supplement what crossrulz had shared:

LabVIEW Real-Time Watchdog Timer Overview

Detect Network Disconnection Between FPGA and Host Computer cRIO

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 6 of 6
(1,352 Views)