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.