06-25-2010 11:26 AM
@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.
06-25-2010 11:45 AM
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.
06-25-2010 11:49 AM - edited 06-25-2010 11:50 AM
@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.
I figured out how to do that now, thanks.
06-25-2010 12:56 PM - edited 06-25-2010 12:58 PM
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!
06-25-2010 01:05 PM
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).
06-25-2010 01:34 PM - edited 06-25-2010 01:38 PM
@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!
06-25-2010 01:46 PM - edited 06-25-2010 01:47 PM
@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
06-25-2010 01:49 PM
First roadblock: Figuring out how to not quit, but loop until an input changes.
06-25-2010 01:52 PM - edited 06-25-2010 01:55 PM
@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. 😄
06-25-2010 01:53 PM
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.