05-05-2017 08:11 AM
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
05-05-2017 08:26 AM - edited 05-05-2017 08:28 AM
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.
05-05-2017 09:26 AM - edited 05-05-2017 09:37 AM
hi sidring,
please remove the FeedbackNodes!
Initialize the ShiftRegisters before the WhileLoop with the correct data type.
(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
05-05-2017 09:38 AM
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.
05-05-2017 10:40 AM
The feedback nodes accomplish nothing there. If they are removed and the shift registers are left uninitialized, the behavior would be the same.
05-05-2017 10:51 AM
Thanks for pointing out my mistake but how to use the state machine for timed case structures.
05-05-2017 03:17 PM
This question sounds familiar. Are these questions related (from the same homework assignment...different students)?
05-05-2017 03:26 PM
@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
05-08-2017 12:37 AM
10-30-2018 08:05 AM
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