09-19-2014 06:25 PM
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
Solved! Go to Solution.
09-19-2014 07:13 PM
09-20-2014 03:30 AM
and how this can be done with a single boolean input ?
09-20-2014 03:51 AM
like this
09-20-2014 07:13 AM
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 ?
09-20-2014 07:27 AM - edited 09-20-2014 07:29 AM
hint : Learn shift registers, comparison functions . Give it a try and post here.
09-20-2014 07:33 AM - edited 09-20-2014 07:34 AM
You just have to know how many items are in your enum and then use Quotient & Remainder.
09-20-2014 10:18 AM - edited 09-20-2014 10:19 AM
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.
09-20-2014 10:33 AM - edited 09-20-2014 10:34 AM
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)
09-20-2014 02:33 PM
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