02-02-2018 04:51 PM
wrote:
I will look at my case structure.
I'm controlling 8 relays with a serial relay board.
To toggle a relay, I send a serial command.
0....7 turns off a respective relay
8....15 turns on a respective relay
I want 8 radio buttons which control the relays, they can be hit in any combination. When one gets toggled up or down, I want the .vi to output the corresponding number to turn ONLY the corresponding relay on or off.
Are you sure your command structure is correct? Am I missing something? It doesn't make sense.
For example, if I want to turn relay 01 OFF (0) and relay 02 ON (9) the sum would be 9.
I'm assuming other relays would be sequentially numbered. So now I want to turn relay 05 OFF (4) and relay 06 OFF (5) the sum would be 9. That's the same numeric as before. You can't have the same numeric command do two different functions!! I think you need to read the manual again.
02-02-2018 05:18 PM
Not sure where you got that from, but I don't believe that's my code. Mine has selects upstream so that it set each individual numeric back to zero as soon as nothing is being commanded. Since the trigger boolean never goes high while the zero is in place, it doesn't command relay 1 off. Mine works, I don't see how that one would.
wrote:
wrote:
I will look at my case structure.
I'm controlling 8 relays with a serial relay board.
To toggle a relay, I send a serial command.
0....7 turns off a respective relay
8....15 turns on a respective relay
I want 8 radio buttons which control the relays, they can be hit in any combination. When one gets toggled up or down, I want the .vi to output the corresponding number to turn ONLY the corresponding relay on or off.
Are you sure your command structure is correct? Am I missing something? It doesn't make sense.
For example, if I want to turn relay 01 OFF (0) and relay 02 ON (9) the sum would be 9.
![]()
I'm assuming other relays would be sequentially numbered. So now I want to turn relay 05 OFF (4) and relay 06 OFF (5) the sum would be 9. That's the same numeric as before. You can't have the same numeric command do two different functions!! I think you need to read the manual again.
02-02-2018 05:20 PM
If you can guarantee that on the first call exactly one of the booleans is TRUE, this will work. (If not, you need to decide on the FN initialization based in the known initial state of the system, so modify as needed).
02-02-2018 05:24 PM
If you assume only ONE (1) comand can be sent at a time (thus avoiding the confusion when summing numerics together) here is another way to generate the numerics using a boolean array and an event structure. It is simpler and can easily scale up as needed.
02-02-2018 05:50 PM
wrote:
If you assume only ONE (1) comand can be sent at a time (thus avoiding the confusion when summing numerics together) here is another way to generate the numerics using a boolean array and an event structure. It is simpler and can easily scale up as needed.
02-05-2018 07:02 AM
wrote:
If you assume only ONE (1) comand can be sent at a time (thus avoiding the confusion when summing numerics together) here is another way to generate the numerics using a boolean array and an event structure. It is simpler and can easily scale up as needed.
Can't use event structures in VI's going to veristand.