LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-9472 and SMC Solenoid Valve

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(5,361 Views)
0 Kudos
Message 2 of 7
(5,355 Views)
0 Kudos
Message 3 of 7
(5,354 Views)

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

 

0 Kudos
Message 4 of 7
(5,249 Views)

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

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 5 of 7
(5,231 Views)

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

 

0 Kudos
Message 6 of 7
(5,221 Views)
Solution
Accepted by topic author Kamilan

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

Doug Farrell
Solutions Marketing - Automotive
National Instruments

National Instruments Automotive Solutions
0 Kudos
Message 7 of 7
(5,201 Views)