From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure with timing control

Hello All,

Currently i am controlling my pressure manually as if i have to change the case structure 0, 1,2 ,3,4 whatever case i want. But i want it to controlled like timings. if i want to run first case for 30sec and other for 30 and so on. 

I am attaching my file.

Please help me out.

Thanks

Siddharth

0 Kudos
Message 1 of 12
(3,707 Views)

I never seen feedback nodes outside of a While loop connected to Shift Registers before! 😄

What is the purpose? It just does not make sense to me... (edit: i put the snippet below so others can help easier even if they do not have LV).

 

About your actual question: search for the term "State Machine". A state machine could serve your requirements easily.

 

asdasdas.png

Message 2 of 12
(3,693 Views)

hi sidring,

please remove the FeedbackNodes!

Initialize the ShiftRegisters before the WhileLoop with the correct data type.

 

 

shift-feedback.png

(shift registers and feedback nodes essentially serve the same purpose,

but what you've done means, after the whileloop finishes the values are kept and would be (not in your case, because there is no outer loop) fed back into the loop)

 

regarding your problem:

if it is clear, what kind of action you want to take at a given step,

then you can put them all in line with waits in between, or make a loop that does the same (and the case is the current iteration#) with wait.

 

for complexer setups the suggested state machines or producer-consumer design pattern would be best.

 

regards


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 3 of 12
(3,659 Views)

 

Hello,

Unfortunately, I cannot open your VI on my PC.

But if I understand your question correctly, you need when you reach the case 1 for example, that the program waits 30s before it jumps to the next case.

So, in this case:

-           a state machine is appropriate for this purpose
Please read the following link:
http://www.ni.com/tutorial/7595/en/

  Here you will find some very good examples on Shift Registers:

 

http://www.ni.com/getting-started/labview-basics/shift-registers


Afterall you can judge if it is useful to use the feedbacks in the WhileLoop.
Maybe you can try with and without to see?

Furthermore:

-           “Case control” of type INTEGER is more appropriate.

 

Hope it helps you a step further. And don’t forget to give the KUDO 😉

 

Kind Regards,

 

James.

 

Greetings and Regards,
James
Message 4 of 12
(3,653 Views)

The feedback nodes accomplish nothing there.  If they are removed and the shift registers are left uninitialized, the behavior would be the same.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 5 of 12
(3,628 Views)

Thanks for pointing out my mistake but how to use the state machine for timed case structures.

 

 

0 Kudos
Message 6 of 12
(3,626 Views)

This question sounds familiar.  Are these questions related (from the same homework assignment...different students)?  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 12
(3,602 Views)

@sidring wrote:

Thanks for pointing out my mistake but how to use the state machine for timed case structures.

 

 


Personally I would prefer producer/consumer for timed events

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 8 of 12
(3,595 Views)

Hello sidring,

a simple example

asdf.png

best regards
Alexander
Download All
0 Kudos
Message 9 of 12
(3,567 Views)

Hello I have a simple problem. How can I control a Boolean variable changing its value when I press a button. In general I want a Boolean to be false in default , I press a button and it becomes true for a specific time (I want to be able to change this. Value from a numeric control ) when time passes Boolean returns to the default value . 

Thank you 

0 Kudos
Message 10 of 12
(2,915 Views)