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