07-08-2013 08:01 AM
When using my cRIO 9024 on the field, I prefer to be able to start and stop acquisition with push of a physical button on cRIO.
I mean I don't want it to be "as start-up," I don't want cRIO to start acquisition as soon as the power is supplied.
Is that possible?
Solved! Go to Solution.
07-08-2013 08:22 AM
Yes it's possible. However, unless cRIO 9024 features an on-board button (I don't think so) you need to add a Digital Input module and a physical button/switch.
Alternatively, you may trigger the acquisition via a shared variable over Ethernet; in this case you need a computer to control the cRIO remotely.
07-08-2013 08:35 AM - edited 07-08-2013 08:48 AM
The following is a picture of my cRIO NI 9024.
There is a "USER 1" switch that can be used, perhaps.
07-08-2013 08:47 AM
The following descriptions are available in the manual of cRIO 9024.
Maybe I can stop and start the code with "USER 1" switch.
07-08-2013 08:54 AM
A dip switch is not mechanically ideal, however I think you can use it.
To try this is very quick.
07-08-2013 08:55 AM - edited 07-08-2013 08:59 AM
Hi Cashany,
you surely can read that switch status. But there are easier (but more expensive) ways to switch a button. Fiddling with a pen or small screwdriver to switch USER1 isn't what I call "user friendly"...
- You have atleast 2 voltage inputs on your module available. Use a switch to supply voltage to those inputs. Use a "real" button!
- You have a serial port available. You could set some pins to GND or voltage and check their status inside cRIO/RT target...
07-08-2013 08:56 AM - edited 07-08-2013 09:02 AM
Good.
07-08-2013 09:05 AM
If you don't use the serial port, you may let a switch short its RX and TX pins (pins 2 and 3 or viceversa). As long as any character written to the port is echoed back, the switch is closed.
07-08-2013 09:07 AM - edited 07-08-2013 09:15 AM
Good idea. For stopping the code from running, I got what to do.
But for triggering the acquisition (I mean starting to run the code) on the field, without any PC available, I'm wondering how I can do that.
Maybe I can write two VIs one of which runs at start-up and based on the status of the physical switch, it starts the other VI or stops the other VI.
07-08-2013 10:14 AM
Your program should basically run in two states: Wait and Run. In the Wait state, just check if your button has been pressed: if yes, go to the Run state.
In Run state, besides doing your acquisition, if the button is switched again then shutdown acquisition and go back to Wait. Of course, you should properly manage any required re-initialization step before acquiring (also, you probably need to define a third Init state for "run once" initialization and settings).