LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shift registers

Hello,

I have a simple vi that has a while loop and a couple of tcp writes.
The writes are connected to toggle switches sending on/off ( i32 0 or
1)flags.
I have connected the toggles to a shift register and then compare the
value in the shift register to the current value. If there has been a
change write.

The problem I am having is on the very first run the values in the
register is null, so there is always a change.
I have to run it once, stop the vi, reset the receiving end of the
writes and start the system again.

Is there a clean way to solve this or do I merely have to hack it to
death?

Thanks
0 Kudos
Message 1 of 3
(2,604 Views)
Richard

you can initialize those shift registers , just wire a value to them outside the while loop....

not sure if thats what you are after or not...

Dan
0 Kudos
Message 2 of 3
(2,604 Views)
If the inital state is always the same, initialize the shift register with it as Dan indicated above.

If you don't want to write in the first loop iteration no matter what, you can also use some additional boolean logic, e.g.:
If ("value changed" .AND. "[n]!=0") -> send data ([n] is the loop iteration terminal).
0 Kudos
Message 3 of 3
(2,604 Views)