LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to partial stroke a valve using limit switches

Good, just glad I could help.  One last pointer: if something works with highlighting on but doesn't with highlighting off, it's almost always a timing issue (possibly a race condition).  Throwing a couple wait statements in usually clears it up.
0 Kudos
Message 21 of 25
(818 Views)

Jeff,

One more thing. Please have a look at the attached. I have put the Logic VI inside another VI which is performing my DAQ. I have simplified this VI so it is easy to explain my problem. When I run my main VI (trial 1) and press a button on the front panel, the subVI for the logic isn't doing anything. It just keeps repeating the close case. Ie. when I push open on trial 1 vi front panel, nothing happens. Any suggestions?

 

Download All
0 Kudos
Message 22 of 25
(810 Views)

The event case is for user events.  So, if a button is pressed, LabVIEW notices the user interface event and triggers any associated event structures.  If you pass values to a SubVI, the SubVI just runs with those values as a sort of "default" value.  There is no change associated with the controls because the VI loads the values of the controls and then runs, so the data is constant for the operation of the SubVI, hence no Value Change Event.

I would move the event structure into Trial1.vi to catch what the user wants more easily.  Also, you didn't include PST Write Output.vi so I'm not positive on this, but I think your reads and writes might be a little mixed up.  You should only have to write a true or false to energize a solenoid, but you are passing arrays to your writing vi.  You need to read your sensors, compare them to something, and use that true or false to control the solenoid.  Also, I would put your sensor reads inside the case structures, that way you only check the limit sensor when you're doing a partial stroke, and you only check the full sensor when you're doing a full stroke.  It's not critical, but not checking both sensors every time will speed up your program.



Message Edited by JeffOverton on 03-25-2008 08:19 AM
0 Kudos
Message 23 of 25
(804 Views)
guys,
i need help building a simple circuit in Labview to open and close a solenoid valve powered at 12 V. I'm completely new to labview and have no idea how to do this. Can anyone guide me, please?
thanks,
pooja
0 Kudos
Message 24 of 25
(769 Views)
Hi pooja,

please post  new thread for this discussion and be more specific on exactly what you wish to achieve. I would recommend checking out some of the online tutorials on using LV, and also the examples that come with it.

http://zone.ni.com/devzone/cda/tut/p/id/5054

Best wishes
Rob L

NI Applications Engineer

UK & Ireland


It only takes a click to rate this message 😉
0 Kudos
Message 25 of 25
(752 Views)