LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

state machine architecture for switching pneumatic solenoid valves using USB 6008

Hi

I’m very new in Labview and I'm trying to create pitch motion using a pneumatic system including an air compressor, a solenoid valve and a cylinder.

The compressor is made by PowerFist and is capable of storing 5 gallons of air under a rated pressure of 125psi and can deliver 2.5cfm (cubic foot per meter) at 90 psi. The compressed air is sent directly to the solenoid valve. It operates using an electrical motor operating from a standard 110V power outlet. The cylinder has a stoke length of 19.7” and a bore size of 1.6” capable of operating under 130psi.

The solenoid valve used is 5-way 3-position. This means that there are five different ways the air flows inside the solenoid and the solenoid can set in three positions depending on the movement of the mechanical core inside. When air is transferred into the valve the mechanical core moves directing the air to the appropriate ports of the solenoid. The two outputs of the solenoid are sent directly to the pneumatic cylinder where extension and collapsing movements can be performed. The solenoid works off of a 12V supply so I'm using Darlington pair transistor as the firing circuit.

So as for my solenoid I’ll have 4 states. (both off), (left off, right on), (both on), and (left on, right off).

 

I’m trying to use state machine architecture from LabView but I don’t know what are the appropriate blocks needed in order to control my states , send the signal to the DAQ  so that DAQ can communicate with my circuit( and the solenoid) .

 

I really appreciate your help

Elmira
Download All
0 Kudos
Message 1 of 19
(5,819 Views)

Continued from Dig I/O forum:  http://forums.ni.com/t5/Digital-I-O/switching-pneumatic-solenoid-valves-using-USB-6008/m-p/2153322#M...

 

You need to develop VI modules that handle the work done in each state.  Then, string together the states in your state machine so that the modules do what you want, when you want.

 

The first step is to write some basic DAQ code that can drive your solenoids, etc.  You want to test these by themselves first before you incorporate them into your main program.

 

What have done so far???

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 19
(5,796 Views)

Hi

 

Thanks for the reply.

attach is what I'm using right now.It's very simple as I'm just sendig 5v to my circuit to switch the solenoid.but I can only switch one valve of the solenoid at a time.  I want the solenoid go ON and OFF simultaneusly as I send the 5v but it doesn't.

 

I'm using LabView 2009

 

thank you

Elmira
0 Kudos
Message 3 of 19
(5,770 Views)

@Elmira wrote:

So as for my solenoid I’ll have 4 states. (both off), (left off, right on), (both on), and (left on, right off).

 


so let me understand what you are trying to do here...(both off), obviuosly you have not started the program. (both on), the program sarts.(left off, right on), moves the cylinder in one direction and the opposite is true for the (left on, right off)? if that is the case...you need to send a boolean array of 2 signals(solenoid 1&2) to the daq. The 4 states would be OFF,ON(hold position),LEFT movement,RIGHT movement?

 

goto >>find example>>hardware input and output>>daqmx>>digital generation>>write dig channel.vi.

 

write your 2 channel boolean array according to your states.

 

channel paremeters:  Dev1/port1/line0:1

 

Data to Write:   (F,F),(T,T),(F,T),(T,F) to a bool array

Message 4 of 19
(5,757 Views)

Yes, definitely use digital outs for this.  I'm lost on why you have turned two simple scalars controls into a 2D array as well but I suspect it just means that you need to go through some basic LabVIEW tutorials before you move on with this project.  http://www.ni.com/academic/students/learnlabview/

 

As mentioned, take a look at the shipping examples after you check out a few tutorials.  Things will be much clearer then. Smiley Wink

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 5 of 19
(5,737 Views)

Thank you very much.

However, when I run the code, I get , error -200463...

number of lines in the channel: 2 Number of lines in the Data:8.

Ibut  when I look at the boolean array it only has 2 elements. 

Elmira
0 Kudos
Message 7 of 19
(5,714 Views)

"Specified read or write operation failed, because the number of lines in the data for a channel does not match the number of lines in the channel."......

 

 

the vi ran like a champ for me? Smiley Indifferent

 

your configuration is wrong...you are only writing to 2 lines (line0:1) AND you should only use 2 booleans in an array, not EIGHTBOOLS LINES.png

 

your number of LINES does not equal the number of bools in your ARRAY....please read your errors carefully,they are pretty much self explanatory and will help you solve your problems

Message 8 of 19
(5,702 Views)

Hi

 

The previous error is fixed but there is something else wrong with my program that I can not figure it out. I don't get any error!!!

so I built the exact model as yours. Also when I run the program non of the buttons work!

What could I have done wrong ?

Elmira
0 Kudos
Message 9 of 19
(5,669 Views)

You have 3 buttons, but only 2 cases.  And both are set for False/False in that array constant.

Message 10 of 19
(5,662 Views)