LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run Case Structure Once

I have a case structure that is controlled by a ring menu. When I select a case using the ring menu, the case structure sends out a command to a serial port. I need the case structure to send the command out once, and then do nothing until I select another item from the ring menu. Can anyone help with this?

thanks in advance
0 Kudos
Message 1 of 3
(2,416 Views)
I would suggest using an event structure. The event you want is Value Change for the ring control. That way you will only execute the case structure when the value of the ring is changed.

If you are using an old version of LabVIEW that doesn't have the event structure, you may just have to add a shift register that holds the last value of the ring. You can then compare the current value to the old value and decide if you want to execute the cases or not.
Message 2 of 3
(2,411 Views)


@JMorgan wrote:
I have a case structure that is controlled by a ring menu. When I select a case using the ring menu, the case structure sends out a command to a serial port. I need the case structure to send the command out once, and then do nothing until I select another item from the ring menu. Can anyone help with this?

thanks in advance




Assuming that your case is in a while loop, why not just add an idle case and move to that after sending the command? See enclosed

Doug
0 Kudos
Message 3 of 3
(2,404 Views)