09-29-2011 06:25 AM
Help. I need to send 3 bytes to a serial port when a boolean switch is set true and 3 different bytes when the switch is set false.
The problem I have is I only want to send the bytes once each time the switch changes state and not constantly.
I've worked out how to send the bytes by using a case statement, but it sends the bytes continuously.
Any suggestions?
09-29-2011 06:47 AM
09-29-2011 10:30 AM
Ben64 made a good suggestion. If you cannot use that method, put the current value of the boolean in a shift register. On each iteration of the loop compare the current value of the boolean with the previous value stored in the shift register (XOR gate). When they are different, send the bytes.
Lynn
09-29-2011 11:14 AM
Hi NewWorldMan,
I think you need nested case structures, one to check if the switch has changed state. If it has not, we don't want to send bytes.
If it has changed we need to decide which to send.
I have modified your VI, you will have to check I got the bytes to send the correct way around.
Regards,
Steve