LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a case structure in an event structure?

I am trying to have the case structure loop through the various cases inside the event. I do not know why I have to hit the start button for each case to loop through.Is there a way to loop through until the user pushes the stop button?

Message Edited by nicholas03 on 02-28-2009 04:16 PM
0 Kudos
Message 1 of 8
(3,932 Views)
You have your structures reversed!  Put the Case Structure inside the While Loop, and both of them inside the Event Structure and Bob's your uncle.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 8
(3,919 Views)
It appears you are trying to make a state machine. Perhaps you may want to peruse the article on state machines. As for the direct answer to your question: You have to hit the start button because that's how event structures work. An event case does not execute until... an event occurs. A button remaining in the same state is not an event. You may also want to consider reading up a bit on event structures. Smiley Wink
Message 3 of 8
(3,889 Views)
That worked. Thank you. I do not know how to stop it though.
0 Kudos
Message 4 of 8
(3,888 Views)
Take a look at Labview templates
0 Kudos
Message 5 of 8
(3,875 Views)
Wire a Boolean True from the last case in the State Machine to the Conditional Terminal in your While Loop, or, you could put your Stop button inside one of the cases and let it stop the Machine.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 6 of 8
(3,800 Views)

Hi Jim,

I am working on Miniwasher Project. There is a small set up for Washer having drum and agitator. Both drum and Agitator are operated through two seperate servo motor.

Herewith I have attached VI file in which I have built logic to rotate drum and agitator. 

When drum switch is ON, agitator should rotate at the same speed as the drum. This is working fine.

When Agitator switch is ON, It should follow the sequence as defined ( CW, Delay, CCW continuously) until Agitator switch is turned off.

The problem which I am facing in this is, agitation sequence I have defined in ENUM (block from numeric pallette), and throgh while loop I am going into next sequence. But there is event structure inside while loop which is not allowing to pass next sequence value.

Please guide me whether my logic is wrong or is there any way to pass next sequence value through event stucture or where I can improve.

 

The logic in this post is looking same as my logic. But the solution which you have suggested I can't implement it in my program.

 

 

 

Thanks

Priti

 

0 Kudos
Message 7 of 8
(3,245 Views)

Priti,

 

To help get your question answered faster, please repost this question in a new thread since this one is 5 years old. 

 

Secondly, please make sure to attach your subVI's associated with your main VI in your new post. You may want to clarify your question- what sequence value are you referring to? Can you be more specific about the error you are getting?

 

Regards,

 

Anna L

Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(3,189 Views)