LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a cyclic button in labview.

Solved!
Go to solution

Hello all,

 

I am mechanical engineering student and am relatively new to labview. I was wondering if it was possible to make a single button that would cycle through all possible cases in a numerical case structure. I am planning on replacing the button later with an “actual” button through a CRIO and want to use as few channels as possible (since I have a large number of buttons/LED etc). I am currently using a numerical control; the problem is it has up and down button and the numerical display which ideally don’t want.  All suggestions/solutions would be much appreciated.

 

Cheers  

0 Kudos
Message 1 of 9
(2,990 Views)

Sounds like you want to make a state machine: Application Design Patterns: State Machines

 

As far as the button is concerned, you could cheat and place a transparent ring control over a button. When you click the button you just increment the value of the ring. The downside is that if you have the mouse over the ring, then you can select the ring.

 

An alternative is to change the strings of the button to match the state. Attached is a crude example to give you an idea.

Download All
Message 2 of 9
(2,983 Views)

You can use an enum, and trap the mouse-down event.  See attachment.

0 Kudos
Message 3 of 9
(2,969 Views)

Hi,

Thanks for the quick response, i have tried to play around with my progamme and using the one you have attached but i still cant get the output (colour box) to also cycle, i managed to get the ok button to but the colour box stayed the same. Here is a simplified version of my orginal problem. Thanks again.

0 Kudos
Message 4 of 9
(2,945 Views)

Hello pcardinale,

Thanks for response also but i am running labview 9 not 10 so can't see your solution.

0 Kudos
Message 5 of 9
(2,944 Views)

Now I don't undestand what you mean by cycle. I see no OK button, and the numeric control doesn't cycle. When did the color box come into play? You made no mention of this before.

 

Please be more clear in what you are trying to do.

 

Also, never create a Greedy Loop.

0 Kudos
Message 6 of 9
(2,923 Views)

Sorry for the confusion this is my  first post on NI forums and very new to labview (as I'm sure you can tell!), basically I want to replace the numerical controller with the OK button which cycles (exactly what your vi did but I also want it to control the color of the color box). The fact the numerical controller doesn't cyle is my exact problem (and the hardware complication mentioned previously). The colourbox is being used to show several states in a larger program (so essentially its a multicloured version of a Boolean LED). Hope that has cleared things up. Thanks for the speedy response(s).

0 Kudos
Message 7 of 9
(2,912 Views)
Message 8 of 9
(2,898 Views)
Solution
Accepted by topic author stubbsy90

Just add colorbox output to the case structure.

Message 9 of 9
(2,886 Views)