11-24-2009 08:56 PM
Hello,
I am trying to write some code to activite the SMC valve. I need to control the amount of time the valve is open. The valve is connected to DO/0 on the NI-9472
Not sure how to start the problem.
Secondly, I wish to record data from an accelerometer in the same VI.
Again, not sure where to start. If someone could please point me to some examples, that would be fantastic.
Should I have two seperate VIs, one to control the valve, the other to recored data, and have them both in another vi?
Cheers
K
Solved! Go to Solution.
11-25-2009 12:07 AM
11-25-2009 12:09 AM
12-16-2009 08:20 PM
Hello,
I'm not sure I understand the examples properly. May need to give it more time.
here is some code to trigger the valve I am operating.
I'm pretty sure the time I enter into the valve time field is not the time the case statement runs for.
Cheers
K
12-17-2009 01:11 PM
I think the case structure is running for the amount of time that you specify but the case structure input is just being reset in accordance with it. What I would recommend you do is set up a state machine type architecture, which is pretty close to what you have right now.
With regard to your first question about running this and an accelerometer in the same VI, that should be no problem. You can just place the code for both in the same VI and it should work. There are some good examples for accelerometer input in the LabVIEW Example Finder under Help»Find Examples...»Hardware Input and output»DAQmx»Analog Input»Acceleration.
http://decibel.ni.com/content/docs/DOC-4594
12-17-2009 03:51 PM
Hello,
I had a look at the examples, but I don't think they point me in the right direction.
Once a button is press I wish to activate the solenoid and start recording the Accelerometer information. After a period of time, I want to stop recording the Accelerometer information and then analyse the information.
I.E. time scale, min max, that sorta stuff.
Any examples that do show how to do that?
Cheers
K
12-18-2009 04:26 PM
I wrote some example code that will hopefully work for you, or at least give you some idea of what I was talking about. There are three cases
-Wait, the VI is waiting for you to press the fire button
-Acquire, the VI changes the value to the solenoid and begins acquisition of the accelerometer for a period of time
-Analyze, the VI performs analysis of the data and then goes back into the wait state.
http://decibel.ni.com/content/docs/DOC-8596