LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Enum with external increment/decrement controls

Solved!
Go to solution

Hello People

 

I have an enum in my subvi with nearly 3 or 4 choices ,I want to wire a digital control (push button) to my daq device in order to use it to press the increment or decrement of that enum (switch between choices) ,I have searched for a property node to do that but without success .

Basically for now i want to simulate that using a front control push button boolean (for example).

 

Thanks in advance

 

0 Kudos
Message 1 of 11
(5,039 Views)
Just increment/decrement the value of the enum.
0 Kudos
Message 2 of 11
(5,031 Views)

and how this can be done with a single boolean input ?

0 Kudos
Message 3 of 11
(5,004 Views)
0 Kudos
Message 4 of 11
(4,994 Views)

Thanks for the example ,that's exactly what I want to do ,except for one thing ,As long as you keep pressing the button the pages go from 1 to the last page ,but then stops . I want it to loop back to the first page again ,just like what happens when you press the increment button of the enum itslef ,how this could be done ?

0 Kudos
Message 5 of 11
(4,975 Views)

hint : Learn shift registers, comparison functions . Give it a try and post here.

 

Message 6 of 11
(4,966 Views)

You just have to know how many items are in your enum and then use Quotient & Remainder.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 11
(4,958 Views)

crossrulz wrote:


 

 

Hey guys, keep it simple!

 

If you would initialize the shift register with a diagram constant of the enum, the +1 would automatically wrap around when the last entry is reached. At the same time you eliminate the ugly coercion dot. Try it! (No need to count the items or take the remainder, etc. And we even get rid of the ugly coercion dots :D)

 

(The enum should also be made a typedef so all the diagram constants and other instances update when items are added.)

 

 

 

Of course the event structure is just for demonstration. Typically you would poll the digital IO and watch for FALSE-TRUE transitions.

 

 

0 Kudos
Message 8 of 11
(4,937 Views)
Solution
Accepted by topic author shadymohamed

An here's the more typical case where you poll the digital input (simulated as a switch until released button, like a car horn ;)).

 

 

 

(As I said, the enum should be made a typedef, of course)

 

 

Download All
Message 9 of 11
(4,929 Views)

Thank you guys ,I really appreciate your help ,I wish labview could just make something simple to assign an input to front panel controls ,just like the"Key Navigation" function (I played around with that function and found that i could assign a keyboard shortcut for the increment button as simple as a piece of cake) ,the only problem is that i dont want key navigation but rather digital i/o navigation 😄 !! thanks again

 

0 Kudos
Message 10 of 11
(4,907 Views)