06-20-2024 04:32 AM
Hi,
I want a program to change the state of a boolean which will control a case structure. It doesn't work because I need to save the state of the boolean. I worked on a register, but it doesn't work.
Where did I make mistakes?
You will find attached my program in VI.
Thank you in advance for your feedback.
06-20-2024 04:56 AM
Hi,
Data is not contained in a front panel control. It is contained in the wires of the block diagram.
Knowing this, you can remove the sequence structure and its local variables.
If I understood correctly, you are trying to make the boolean flash ?
If so, you can use the register (left side of the loop) and reverse it before returning it to the register (right side of the loop).
06-20-2024 05:12 AM
Thank you for your reply ,
yes that's what I want but I want it to do the addition for 4 seconds for example and that it does the subtraction for 1s.
in what you showed me it's the same time in both cases
Is that possible ?
06-20-2024 05:20 AM
Yes of course,
Just move the "Wait" inside the condition structure.
Case true : wait 4000 ms
Case false : wait 1000 ms
06-20-2024 08:10 AM
You need a timer. Keep track of the time the last flip happened and subtract it from the current time. Compare it to your target time and flip if elapsed. Choose the target time according to the boolean value.