LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to partial stroke a valve using limit switches

guys, thanks for your aasistance with this.

What Jeff has said is true of my set up. However, when the valve is fully open, it should remain in this state until a button to fully close it is pressed or a button to perform a partial stroke is pressed.

When the partial stroke is pressed, the valve should leave the open state, hit the partial limit switch, and return to open position.

0 Kudos
Message 11 of 25
(1,391 Views)
That should just be a simple rework of the logic then.  When the Full Stroke or Partial Stroke button is pressed, deenergize the solenoid, and when the sensor says partial or fully closed, energize the solenoid.
0 Kudos
Message 12 of 25
(1,379 Views)

Jeff,

the problem I am having is that when I ask the valve to do a full closure from the open position, the solenoid re-energises  when the partial limit switch sensor goes high as the valve moves towards the closed position. I think this is because the event structure is looking for the partial limit switch value going high all the time.

I think you understand what I am trying to say, but to clear things up, the basic operations I want to perform are as follows.

1. Closed to Open. (Switch 1 High)

2. Open to Closed. (switch 1 Low)

3, Open to Partial to Open (Switch 2)

0 Kudos
Message 13 of 25
(1,376 Views)
Sorry, I should have put the enum inside the while loop.  The way loops work is that they wait for all inputs to be ready, then the loop executes, and when the loop finishes, they give outputs.  So, since the enum is outside the loop, the loop will constantly execute with the enum in the state is was when the loop began.  If you move the enum inside the loop, the value will update every time the loop iterates.
 
==========================================
==========================================
==========================================
 
Of course, you'd want to put a Wait statement in these loops to prevent them from taking 100% CPU, but you can try them out if you want to see the behavior.


Message Edited by JeffOverton on 03-24-2008 11:40 AM
Download All
0 Kudos
Message 14 of 25
(1,359 Views)
Maybe I'm missing something.  It looks to me like this VI will perform the current selection every 100ms (now that the enum is inside the loop), and the only time pressing the actuate switch will actually do anything is if it is pressed less than 100ms after changing the enum value.
Jim

LV 2020
0 Kudos
Message 15 of 25
(1,348 Views)
another problem I have experienced is that when the solenoid re-energises after the partial limit switch has gone high, it de-energises when the valve moves away from the partial switch. It will then re-energise as the valve will again start to close, and so on...
0 Kudos
Message 16 of 25
(1,345 Views)


lmtis wrote:
Maybe I'm missing something.  It looks to me like this VI will perform the current selection every 100ms (now that the enum is inside the loop), and the only time pressing the actuate switch will actually do anything is if it is pressed less than 100ms after changing the enum value.


Only the timeout case is executed every 100 ms (unless one of the button press events occurs).  The timeout case is there to determine if the valve has traveled far enough, and if it has, to energize the solenoid and end the partial or full cycle.  If the timeout case is executing when a button is pressed, the button press event is queued and executes immediately after the timeout event.  After the timeout event executes, the event structure waits 100ms for any other user event, and if none occurs, executes the timeout event again.  In this situation, the user events (the button value changes) will deenergize the solenoid and then the timeout events will determine when to reenergize the solenoid and finish that particular valve cycle.


JohnnyBoyHendo wrote:
another problem I have experienced is that when the solenoid re-energises after the partial limit switch has gone high, it de-energises when the valve moves away from the partial switch. It will then re-energise as the valve will again start to close, and so on...

The only code to deenergize the solenoid should be inside the button value change events.  I posted the examples I did as architecture examples, so none of them may do what you want in a "plug-and-play" method, but they should be easily adaptable to your needs.  That said, it sounds like you still have deenergizing code in your timeout case.


Message Edited by JeffOverton on 03-24-2008 12:31 PM
0 Kudos
Message 17 of 25
(1,332 Views)
This should be more along the lines of what you want to try to do
0 Kudos
Message 18 of 25
(1,326 Views)

Jeff, Thank you. I am now getting somewhere.

I have modified your example, and when I run the VI with execution highlighting, it works perfectly. However when I switch this off, it is not working. I think it may be missing front panel events? Any suggestions. Ammended VI is attached.

0 Kudos
Message 19 of 25
(1,302 Views)
I have modified the code again, and now have it working. Thanks for all your assistance Jeff. Attahced is final solution for info.
0 Kudos
Message 20 of 25
(1,289 Views)