LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run calculations on cRIO

I hope this both isn't a dumb question, and that I can adequately explain my issue.

 

I'm a part of a company that has existing software designed and built for a specific purpose (collecting data of a piece of equipment, and opening/closing valves using solenoids controlling air actuated valves).

 

It was designed so that, when connection between the computer controlling the equipment fails, it safe's the equipment by opening certain valves and sets heaters to cool the equipment. This is done as a part of an engineering control for an industrial setting. On testing, it was found that the software functions mostly correct, it doesn't do everything that the technicians want it to do but that is easy enough to fix.

 

My problem lies in that connectivity issue. When you pull the cat5 cable from the cRIO, it loses connection to the computer, and on the computer side, it opens the safety valves and does all the appropriate actions. But, since it doesn't have connection, the cRIO does none of these things, and it proceeds as if nothing happened. When it is plugged back in, it takes a few seconds, but it eventually catches up and does the appropriate actions.

 

I was trying to figure a way to set up a series of calculations that the cRIO can do on it's own, and when it reaches a certain point it does the things I want it to do. For example: Set a variable to 30. Have the cRIO tick it down by 1 every second. When the computer is connected, it continuously sets the variable to 30. If it loses connection, the variable doesn't get reset, ticks down to 0, and enacts the actions we want it to do in the case of a loss of connection.

 

Is this possible? I've only really dissected the existing software, and I haven't really dealt with running anything on the cRIO's.

 

For reference, we have both 9012 and 9056 cRIO's in use across our equipment.

0 Kudos
Message 1 of 4
(133 Views)

Are the safety valves controlled by the host PC or cRIO?

Is there any data exchange between the host PC and cRIO? Is it done via TCP, shared variable or network stream?

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 4
(86 Views)

It seems to me that the whole control of the safety valves and other stuff is done on the cRIO. This also means that the safety functionality needs to be implemented there, not on the PC that can’t really control the valves and stuff.

 

Basically have a channel that is alternatingly toggled from true to false and back by the host and that your cRIO monitors. If the host foggles it in lets say 1s interval and the signal hasn’t toggled for 2 to 3 seconds the connection is lost and you initiate the safety shutdown on the cRIO. 

If both your PC and cRIO control some of the IO you need to enhance the watchdog handshake a little. You could use a second watchdog line in the inverse direction or have the host set it to high and the cRIO back to low after checking that it was correctly set to high. If your shutdown requirements are only in the several seconds range you can do it with one single channel for both directions but need to be careful to not race the handshake but it’s very doable. If it needs to be faster I would go with a separate channel for each direction.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 4
(42 Views)

@BenCox wrote:

Is this possible? I've only really dissected the existing software, and I haven't really dealt with running anything on the cRIO's.


The cRIO is its own computer, specifically running a RealTime Linux (NI Linux RT). All control logic should be on the cRIO since it is what has direct access to the IO.

 

Yes, you do need a watchdog of some kind. How that is done depends on how the communication already being used between the PC and the 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 4 of 4
(22 Views)