06-24-2010 05:05 PM
Hey,
I am in Labview 7.1
So I have a problem that seems like it should be really simple, but I'm having issues.
I want to increment a Numeric Counter when the user presses a button to record their data, but labview only allows a numeric counter to output data, and not take any in.
I want the variable to be a numeric control so that the user can increment/decrement it themselves if they feel the need to rerun or skip a test number.
Any solutions?
Thank you 🙂
Solved! Go to Solution.
06-24-2010 08:34 PM
http://zone.ni.com/reference/en-XX/help/lv/71/glang/Property_Node/
That should help you get where you want to go.
06-25-2010 01:58 AM
Did you try using a shift register?
06-25-2010 10:17 AM
@muks wrote:
Did you try using a shift register?
No, because i needed to change the value of the number control, but there was no input for it
@Hornless.Rhino wrote:
http://zone.ni.com/reference/en-XX/help/lv/71/glang/Property_Node/
That should help you get where you want to go.
Thanks, I think this is what i needed
06-25-2010 10:35 AM
I'm not sure how to get the refnum of the Number control. Suggestions?
06-25-2010 10:38 AM
Go to block diagram, rifght click on Control, then go to create-->reference, this will create reference for you.
06-25-2010 10:40 AM - edited 06-25-2010 10:40 AM
I figured it out, thank you
(Right click -> Link to -> choose part)
06-25-2010 10:47 AM
I don't understand how the link to property nodes has anything to do with your question, but to create a reference, you just right-click the control and select "create reference".
Now, to solve your programming issue, you would:
06-25-2010 10:53 AM
@altenbach wrote:
I don't understand how the link to property nodes has anything to do with your question, but to create a reference, you just right-click the control and select "create reference".
Now, to solve your programming issue, you would:
- create a simple VI containing an event structure inside a while loop. Add a latch action button and a numeric integer control.
- Initialize a shift register with e. g. zero.
- Create a local variable (write mode) and wire it to the value in the shift register, right before the event structure.
- Create two event cases, one for the "button: value changed", one for the "numeric: value changed".
- Wire the shift register across the button case and add a "+1" inside the event.
- Place the numeric control in the other case and wire the numeric directly to the output tunnel leading to the shift register.
- add trimmings (stop, etc.).
See how far you get... 😄
I've got it working, thanks. This is what I have (Where NumText.Text is the text of the numeric control)
06-25-2010 11:09 AM - edited 06-25-2010 11:10 AM
@bobholmgren wrote:
I've got it working, thanks. This is what I have (Where NumText.Text is the text of the numeric control)
Nooo!!!
Just use a local variable! Don't do a detour over strings and property nodes!
Isn't this supposed to be an integer? I would make the control blue by changing the representation to e.g. I32.
Can you attach your code instead of a picture?