LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem on controlling multiple Solenoid Valves

Hello

Currently I'm using Module NI scxi 1163, Terminal block scxi 1326 and Chassis scxi 1000 to control multiple Gems Sensors Solenoid Valves and Lee Valves. 

I need to control them automatically with some time differnces. I suppose it is a digital output, can someone please to suggest some examples to refer with and any suggestions to develop a LabView code.

(NOTE: here I'm attaching the preliminry program which I developed.)

Thanks in advance.

 

Tom

Tom147_0-1655287973650.png

Tom147_1-1655288011064.png

 

0 Kudos
Message 1 of 10
(2,151 Views)

Hello

Currently I'm using Module NI scxi 1163, Terminal block scxi 1326 and Chassis scxi 1000 to control multiple Gems Sensors Solenoid Valves and Lee Valves. 

I need to control them automatically with some time differences. I suppose it is a digital output, can someone please suggest some examples to refer with and any suggestions to develop a LabView code.

(NOTE: here I'm attaching the preliminary program which I developed.)

Thanks in advance.

 

Tom

Tom147_0-1655633958866.pngTom147_1-1655633976220.png

 

 

0 Kudos
Message 2 of 10
(2,184 Views)

I'm not familiar with the NI Hardware you are using, so cannot directly comment on the DAQmx code (but have a suggestion, below).  Here are some (what I hope are helpful) comments:

  • With your hardware connected to at least one Valve, open MAX, open a Test Panel to the scxi 1163, find the (Digital Output?) terminal connected to your Valve, and ask MAX to turn it on and off (and notice whether the Valve responds).  This is called "Play with your Hardware and Learn how it Works".
  • Your code is entirely "manual" -- you push a button and a Valve Opens or Closes.  There's no timing, no sequencing (if that is important), just Manual On and Off.  Is that what you want?
  • Your While Loop runs AFAIC (As Fast As It Can), which is probably not what you want or need.  Do you need a response faster than a tenth of a second?  If not, put a 100 ms Time Delay in the While Loop, which will let other processes not in the Loop run in parallel without the Loop waiting for a Slow Human to make a decision.
  • You are using a Boolean (a sensible choice) to control the Valve.  Is "True" Valve Open, or Valve Closed?  When the little Green Light on the Boolean Control is lit, is the Valve Open or Closed?  When you start your program, you set all the Valves to the "True" state, then immediately start setting them to the State governed by the "Solenoid Valve n" Control (which, with your current code, is False).  Do you mean to turn the valves "True/False" (which can mean "Open/Closed" or "Closed/Open") AFAYC (As Fast As You Can)?
  • Boolean Control Suggestions:
    • Right-click Control, choose Properties, add Boolean Text ("Valve Open", "Valve Closed")
    • Use a Square LED, which is ordinarily an Indicator, but you can right-click it and change it to a Control.  Resize the Control to allow a line of text to appear inside the Control.  Whichever State (T or F) is Value Open, set the Color to Bright Green and set Boolean Text to "Open".  Set Valve Closed to Bright Red, with Boolean Text "Closed". 
  • You probably don't need a separate indicator that merely "follows" the State of the Valve Control.

Bob Schor

0 Kudos
Message 3 of 10
(2,161 Views)

Hi Tom,

 


@Tom147 wrote:

Hello

Currently I'm using Module NI scxi 1163, Terminal block scxi 1326 and Chassis scxi 1000 to control …


And you are using a PCI DAQ card, I guess it's a PCI-6221 from your rather downscaled and blurry image. (Why do you downscale images before uploading?)

 

That DAQ board (together with your SCXI system) determines the possible DAQmx options: I suggest to put all DO channels into just ONE (1) DAQmx task…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(2,148 Views)

All you probably need is control all three booleans by using an array with three elements for the I/O (N lines, 1 point) (30% of the code!).

All your case structures differ only by a single boolean constant that you already get from the case selector, so you can delete all case structures. Right?

0 Kudos
Message 5 of 10
(2,114 Views)

I 'm working on the control of 6 solenoid valves by means of digital outputs.

I'm using PCI 6024E daq card. 

How can I implement a program to control them both manually (clicking start and stop bottoms) and automatically (opening a valve automatically every 0,1 sec)?

0 Kudos
Message 6 of 10
(2,071 Views)

Hi Tom,

 

no need to start the 3rd thread on the same problem. I merged them all…

 

Have you taken the suggestions you got so far?

Mind to attach your current VI with those changes incorporated?

 


@Tom147 wrote:

How can I implement a program to control them both manually (clicking start and stop bottoms) and automatically (opening a valve automatically every 0,1 sec)?


How do you want to control a valve manually when the "automatic" routine will open it anyway after 0.1s?

When you switch between both modes you simply could use a case structure…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(2,064 Views)

Thanks for your availability.

I am currently trying to implement a program that can control a valve automatically in the following way: 10 ms open, 990 ms closed, 25 ms open, 975 ms closed, 50 ms open, 950 ms closed in a single cycle, what can be the best approach?

I have the follwing code to open and close the valve by digital output signal can someone help me in opening and closing the valve as mentioned above over time. Thanks in advance.

Tom147_0-1657222826477.png

Tom147_1-1657222849439.png

 

 

0 Kudos
Message 8 of 10
(2,001 Views)

Hi Tom,

 


@Tom147 wrote:

I am currently trying to implement a program that can control a valve automatically in the following way: 10 ms open, 990 ms closed, 25 ms open, 975 ms closed, 50 ms open, 950 ms closed in a single cycle, what can be the best approach?


The "best" approach would get rid of that ExpressVI and use "plain" DAQmx functions! (They are much easier then you might think!)

 

What do you mean by "single cycle"? Are you talking about using just one loop structure?

What are the requirements on accuracy of the delay times?

 

Do you want just these 6 delay elements? (With low accuracy on timing?)

Then all you need is:

  • an array of [10, 990, 25, 975, 50, 950]
  • a FOR loop autoindexing those array elements
  • a wait inside the loop to wait for the current array element
  • a shift register at the loop border holding the current DO state
  • a DAQmxWrite in the loop to output that DO state
  • a NOT function to set the state for the next iteration, again using that shift register…

See how far you get with that suggestion…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(1,997 Views)

In my case single cycle refers to operation of values at this different mentioned timings (on/off) should be at go.

Thanks for the response, I will try to use your suggestions.

0 Kudos
Message 10 of 10
(1,985 Views)