Showing results for 
Search instead for 
Did you mean: 

Event case speed

I have a project in which I am raising a scissors lift until a part is detected.  My problem is the way I have the event case programmed activates the 'raising' control for too long of a time period, causing the scissors lift to skip parts.  

If I manually push the button the front panel quickly, the button is much quicker, and I can get the lift to move properly.

How can I make the button cycle faster from on to off?  Would a notifier help with an external while loop?

I tried to change the switch function from 'switch until released' to 'latch when pressed', and it works manually from the front panel, but the local variable changes to a variant - I can't seem to convert from a variant to a boolean. 



In case 0, the event structure waits.

When the 'start process' switch is activated, state 1 starts, and the 'raising' output is true.  Please notice the 'wait until next ms multiple' value is zero.

case 2 stops the 'raising' and allows the lift to settle for 150ms

case 3 allows the lift to settle an additional 150ms.

cases 4 & 5 check for 'part detected', and if true, sets the case back to zero and turns off the 'start process' switch.


Can someone give me some advice on how to control the on time of the 'raising' control?



metzler CLAD
0 Kudos
Message 1 of 5

For goodness (and your own sanity's) sakes, abandon this mess and start over!


I don't really know why you have an Event Structure, and why it has a Case structure inside it (except maybe this is the only things you've learned about).


Is there an orderly sequence of things that you need to do?  A Step-by-Step set of routines, where you do something, check something and on the basis of the check, do something else, check, do, check, do, etc.?  This sounds like a State Machine.  Look at the LabVIEW Example Templates (I recall there used to be a Simple State Machine there -- yep, start LabVIEW, click "New Project" and choose Simple State Machine).


It is not clear to me what your "Event" is.  [Seeing the code didn't really help -- it was much too confusing and my brain is already a little frazzled after a long day].  


Bob Schor

0 Kudos
Message 2 of 5


Thanks for your note.

I can use the state machine, but I believe it will still cause the control to be activated for too long.

As I said, if I push the control on the front panel, I can get short time periods from it, and everything works. When I automatically trigger it, the control stays on too long (and the length of time is inconsistent), and the lift skips right past parts.

That being said, is there a way I can trigger the control for a very short period of time?


metzler CLAD
0 Kudos
Message 3 of 5

I understand that you have a Front Panel control that starts something (a "lift" starts moving).  Is there anything that you can measure (or a digital signal that you can read) that indicates when the action should stop?  Are there latencies that complicate matters (i.e. when you say "Stop", the lift keeps moving for some time or some distance)?


In the ideal world, you'd have a "limit switch" that would signal "Tell the lift to stop".  You would read this switch (you could have a parallel loop that reads the switch every few milliseconds) and could trigger a State change to the "Stop Lift" state.


One problem with giving advice is that you really haven't given a clear description of what you are trying to do (I know it involves a "lift", that there's a Front Panel button to start the movement, but no other information that might be helpful, such as how fast the lift moves, how you know when to stop it, what other sensors are present, etc.).  Because it sounds to me as though timing might be important here, you may want to investigate the Queued State Machine (or its close relative, the Queued Message Handler) which provides one way to trigger a State ("Stop Lift") when an Event occurs.


Bob Schor

0 Kudos
Message 4 of 5

If you are using the correct DAQ system and loop frequency there is no reason you should not be able to control this correctly.

How fast do you need to stop?

What are you using to do this control?

What does your system look like?

Tell us more about your system so we can help you solve your problem.


I think you need to change your wait time to something much smaller if you are not reacting fast enough. That would be the first ting I try after I rewrote the code to something more efficient.

0 Kudos
Message 5 of 5