Log in

View Full Version : Programming the Pressure Sensor


JMillar
02-02-2010, 17:44
How do you program a pressure sensor, from the Kit of Parts, in Labview?
Also, can you make the pressure sensor analog?
Diagrams in Labview would be preferred.
Thanks.

apalrd
02-02-2010, 18:08
The pressure switch is a digital sensor, no analog.

When you Open Compressor, you set the digital port for the pressure switch and the relay port for the compressor. Then, when you start the compressor (with Compressor Start), it sets up an interrupt on the digital port, allowing you to not have to worry about the pressure switch at all.

There are other threads on this topic, next time search before posting.

Alan Anderson
02-02-2010, 21:47
You can add an analog pressure transducer to the pneumatic system if you like. There was one provided in the 2004 Kit of Parts; I think it was from TI. You still have to use the Nason pressure switch to control your compressor, however.

JMillar
02-02-2010, 21:56
Thanks apalrd, I know there are other posts about it but what I am really intrested in is the accual diagram of the program in Labview.

Alan Anderson
02-02-2010, 22:31
Thanks apalrd, I know there are other posts about it but what I am really intrested in is the accual diagram of the program in Labview.

Look at the Solenoid with Compressor Example.

apalrd
02-02-2010, 22:35
This is the section from our Begin.vi involving the compressor. Note that the "Open" block is in a case structure; this allows us to have two sets of IO for our practice and competition robots, and is not required in your setup. We open the compressor and set it's sensor and relay ports, then start it, then set it to a refnum. We don't need it anywhere but here, except to close the compressor in Finish.vi. Once we call "Start", the compressor sets up an interrupt on the pressure switch port and switches the Spike for the compressor on change. You need to do nothing to handle the compressor or pressure switch at all. If you need the status of the pressure switch, then you can use the Compressor Get Refnum to get the refnum and a Get Enabled State to check if the compressor is enabled and if it is on.