Connect and Reconnect Host Computer's VI to a Continually Running cRIO VI

Updated May 8, 2024

Reported In

Hardware

  • cRIO-9068

Issue Details

I'd like to have an HMI or host computer that can connect to a cRIO, disconnect, and reconnect at a later time without having to stop my cRIO program and start both up at the same time.

Solution

The general overview of this solution is to implement a producer, consumer architecture on the cRIO where the main code is in the producer loop, and the consumer loop is looking to send the data to the HMI. The consumer loop has is a state machine that will have cases to connect, read/write, disconnect, and safe sate, all controlled by a NPSV that the HMI has access to. When the HMI is off, the cRIO's state machine should be in safe mode. If the HMI turns on, the HMI should write to the NPSV to establish a network connection with the cRIO. Once established, the next case should be read/write. Once the HMI turns off, a shutdown procedure should occur where the NPSV should close the Network connection, and put the cRIO's consumer loop in a safe state. The State Machine design is showed below:




In order to send data between the producer and consumer loop on the cRIO, a queue will have to be implemented. Queued elements can be handled however you want, and can either log to a data file while the HMI is off, or be deleted.

Additional Information

An example of the described architecture with a few variants is shown and downloadable here: Reconnecting Network Streams using a State Machine using LabVIEW