LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to update the Numeric Control at the press of a button

Solved!
Go to solution

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 🙂

0 Kudos
Message 1 of 28
(4,464 Views)

http://zone.ni.com/reference/en-XX/help/lv/71/glang/Property_Node/

 

That should help you get where you want to go.

Message 2 of 28
(4,447 Views)

Did you try using a shift register?

0 Kudos
Message 3 of 28
(4,431 Views)

 


@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

0 Kudos
Message 4 of 28
(4,410 Views)

I'm not sure how to get the refnum of the Number control. Suggestions?

0 Kudos
Message 5 of 28
(4,403 Views)

 

Go to block diagram, rifght click on Control, then go to create-->reference, this will create reference for you.

Anil Punnam
CLD
LV 2012, TestStand 4.2..........
Message 6 of 28
(4,399 Views)

I figured it out, thank you

 

(Right click -> Link to -> choose part)

0 Kudos
Message 7 of 28
(4,397 Views)

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:

 

  1. create a simple VI containing an event structure inside a while loop. Add a latch action button and a numeric integer control.
  2. Initialize a shift register with e. g. zero.
  3. Create a local variable (write mode) and wire it to the value in the shift register, right before the event structure.
  4. Create two event cases, one for the "button: value changed", one for the "numeric: value changed".
  5. Wire the shift register across the button case and add a "+1" inside the event.
  6. Place the numeric control in the other case and wire the numeric directly to the output tunnel leading to the shift register.
  7. add trimmings (stop, etc.).
See how far you get... 😄

 

Message 8 of 28
(4,391 Views)

 


@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:

 

  1. create a simple VI containing an event structure inside a while loop. Add a latch action button and a numeric integer control.
  2. Initialize a shift register with e. g. zero.
  3. Create a local variable (write mode) and wire it to the value in the shift register, right before the event structure.
  4. Create two event cases, one for the "button: value changed", one for the "numeric: value changed".
  5. Wire the shift register across the button case and add a "+1" inside the event.
  6. Place the numeric control in the other case and wire the numeric directly to the output tunnel leading to the shift register.
  7. 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)

 

0 Kudos
Message 9 of 28
(4,380 Views)

 


@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?

Message 10 of 28
(4,373 Views)