LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

three position toggle switch

Seriously?  You created a profile just so you could post this to a topic that hasn't been posted to in 8 years?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 12
(536 Views)

@SollySolly wrote:

here is a momentary 3-way toggle


  • Switch should be an integer datatype.
  • The Action string indicator belongs after the event structure. No value property node needed.
  • Instead of "reinit to default" simply write a value of two to a local variable of the control. More efficient.
  • I would replace the inner case structure with "Index array" and index into an array of strings (diagram constant) accordingly. Subtract 1 from the value to get the index. No hidden code makes the VI easier to debug.
  • The "first call?" case structure can be eliminated by placing that code before the loop instead.
  • You are missing a mechanism to stop the VI (using abort is not pretty).
  • You are missing an event for "mouse leave". If you click on the control, keep pressing the mouse, leave the VI area, then release the mouse, the control does not reset.
0 Kudos
Message 12 of 12
(525 Views)