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

 


@altenbach wrote:

 


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


 

Its supposed to be an integer that basically goes from 1 to 5.

I've changed that and attached the code.

0 Kudos
Message 11 of 28
(1,602 Views)

You didn't do as Altenbach suggested.  Replace the Number to Decimal String and the Property Node with a Local Variable of the Number control.

 

 

17461iFAAA977B846102B9

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 12 of 28
(1,595 Views)

 


@tbob wrote:

You didn't do as Altenbach suggested.  Replace the Number to Decimal String and the Property Node with a Local Variable of the Number control.

 

 

17461iFAAA977B846102B9

 


I figured out how to do that now, thanks. 

 

0 Kudos
Message 13 of 28
(1,588 Views)
Solution
Accepted by bobholmgren

Your code is not functional. (Are you running this in run continuously mode??? Don't!)

 

Here's a very simple example on how you could do it. You don't need case structures and fancy express VIs. They obscure the code and make it har to read and debug. Especially the express VI obscures all it's functionality unless you configure it.

 

 

And please don't change the label of property nodes to something different from the control label. This obfucates the code way too much!

Message 14 of 28
(1,573 Views)

What's wrong with continuous mode?

 

I've got everything working now perfectly, as in, ready to be deployed on the lab computer and never touched again. I had a couple issues and fixed them (some in Filename.vi, and some in another VI).

0 Kudos
Message 15 of 28
(1,564 Views)

 


@bobholmgren wrote:

What's wrong with continuous mode?


 

Everything!

 

Continuous run mode is a debugging tool to quickly troubleshoot non-toplevel subVIs. It should never be used to run a toplevel VI.

All it does is restart the VI once it completes, over and over again. Also, since you don't have any pacing, it uses 100% of the CPU doing nothing useful: 99.9999% repetitive work, recalculating the same results from the same control values(!) millions of times per second. Imagine all other programs (browser, office, antivirus, OS services, etc.) would do the same. The computer would be unusable!!!

 

A properly programmed VI only spins the loop when needed (e.g. when one of the controls change it needs to spin it exactly once) and then wait again. Learn about the event structure.

 

If you want to repetitively run parts of the code, you place it in a while loop. Period! 😄

 

While you're at it, you might also want to un-mark the post with the link to property nodes as "solution". It has nothing to do with any solution in this thread. What-so-ever!

Message 16 of 28
(1,554 Views)

 


@altenbach wrote:

 


@bobholmgren wrote:

What's wrong with continuous mode?


 

Everything!

 

Continuous run mode is a debugging tool to quickly troubleshoot non-toplevel subVIs. It should never be used to run a toplevel VI.

All it does is restart the VI once it completes, over and over again. Also, since you don't have any pacing, it uses 100% of the CPU doing nothing useful: 99.9999% repetitive work, recalculating the same results from the same control values(!) millions of times per second. Imagine all other programs (browser, office, antivirus, OS services, etc.) would do the same. The computer would be unusable!!!

 

A properly programmed VI only spins the loop when needed (e.g. when one of the controls change it needs to spin it exactly once) and then wait again. Learn about the event structure.

 

If you want to repetitively run parts of the code, you place it in a while loop. Period! 😄

 

While you're at it, you might also want to un-mark the post with the link to property nodes as "solution". It has nothing to do with any solution in this thread. What-so-ever!

 

 


Ah, haha. It was using a full core, I see now. Lets see if I can get this working in single run mode

 

Yeah, I tried to unmark it but couldn't find how. I'll try again

0 Kudos
Message 17 of 28
(1,544 Views)

First roadblock: Figuring out how to not quit, but loop until an input changes.

0 Kudos
Message 18 of 28
(1,539 Views)

 


@bobholmgren wrote:

...., but loop until an input changes.


no! "... don't loop unless an input changes".

 

As a first step, you could you the code image I posted above. True, it spins every 100ms. But compared to your millions of times per second, that's peanuts. Insignificant, maybe 0.1% CPU use. 😉

 

... Then learn about the event structure. 😄

 

Message 19 of 28
(1,536 Views)

What I mean is I want the program to do literally nothing (except get data and graph it every 3 seconds using while loop and time delay) unless an input changes. Then I want it to run through once.

0 Kudos
Message 20 of 28
(1,533 Views)