LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Registre à decalage

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.

0 Kudos
Message 1 of 5
(189 Views)

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).

 

PinguX_0-1718877105471.png

 

0 Kudos
Message 2 of 5
(181 Views)

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 ?

0 Kudos
Message 3 of 5
(171 Views)

Yes of course,

Just move the "Wait" inside the condition structure.

Case true : wait 4000 ms

Case false : wait 1000 ms

0 Kudos
Message 4 of 5
(165 Views)

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.

0 Kudos
Message 5 of 5
(138 Views)