06-20-2012 08:54 PM
Hello all,
Noob time here again. I'm guessing I'm missing a concept here, but I just can't seem to find what I'm needing to do.
I have an outer/master while loop for my vi. I have an event case inside that.
I have a couple of clusters, a left one...and a right one. Each one has a series of 7 LED boolean controls. And 7 corresponding numeric controls.
I've set an event for each value change of the LED Booleans.
I'm wanting to track the order that each LED is selected, and set the value of the corresponding numeric to that index. This will show the user on the GUI, the number each was selected.
I will be running through these later to know the order they were selected (R2, L1, L4, R1, L5.....etc), figuring when time for the event to spit this info back out, I'll create a text array with R2, L1, L4, R1, L5, etc to know what signals to send out when that time comes.
I've seen examples of using a shift register in a loop for something like this, but I'm going to be reacting to random user events..they can click either side in any order, and I need to capture this.
I can't find any type of numeric variable I can put into the block diagram to act as an index counter.....all I see are constants.
Any suggestions?
Thanks in advance,
cayenne
Solved! Go to Solution.
06-20-2012 09:01 PM
It sounds like you have all the information you need if you are familiar with the event structure and shift registers.
I just think you are confusing yourself with the wrong terminology. There is no such thing as a "numeric variable". If you want something to show on the front panel, you need to go to the front panel and create a numeric indicator. Numeric constants reside on the block diagram. That is why you see constants on the block diagram palette. Note: you can drop a constant on the diagram and right click it and "change to indicator" or "change to control".
06-20-2012 09:16 PM
@Ravens Fan wrote:
It sounds like you have all the information you need if you are familiar with the event structure and shift registers.
I just think you are confusing yourself with the wrong terminology. There is no such thing as a "numeric variable". If you want something to show on the front panel, you need to go to the front panel and create a numeric indicator. Numeric constants reside on the block diagram. That is why you see constants on the block diagram palette. Note: you can drop a constant on the diagram and right click it and "change to indicator" or "change to control".
I'm close...but, I'm not wanting to show this 'index' on the front panel. I need to, programatically...keep a running total of how many clicks I get....
I'm guessing this is old coding thought, trying to go with the new 'flow' paradigm that LV has...but I just can't quite see what I'm missing here...
One thing that is confusing me a bit, is how to build and keep data...that is NOT displayed on the front panel, but just kept in program to be used later.
Thank you!
cayenne
06-20-2012
09:24 PM
- last edited on
10-15-2025
03:45 PM
by
Content Cleaner
I thought you said you understood the shift register examples.![]()
The wire is the variable. If you want to increment the value in a wire you put a +1 function on it. Wire it into the right hand side shift register, the left hand side shift register gives the new updated value in the next loop iteration.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
06-21-2012
08:34 PM
- last edited on
10-15-2025
03:45 PM
by
Content Cleaner
@Ravens Fan wrote:
I thought you said you understood the shift register examples.
The wire is the variable. If you want to increment the value in a wire you put a +1 function on it. Wire it into the right hand side shift register, the left hand side shift register gives the new updated value in the next loop iteration.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
D'oh.....
It was getting late....and you're right, I actually HAD the solution. Stepping away, and playing a bit more got it working for me.
Sample vi attached. I went on to try this with a more complex example...and discoverd it didn't work, even though wired the same way. In that case..I actually had two events that would trigger....one for mouse on whole panel, and one for mouse on that control. The culprit in that one...was that the event structure was set to use default value if unwired, which in the case here..appeared to be zero every time.
I went in, and unchecked the default if unwired, and used the create and wire tool...so, the default value goes through on every case....and is only incremented on the one I want.
Thank you!
Whew...that last part was a brain teaser.
Again, thank you for the help!
cayenne