04-15-2020 04:30 AM
Hello,
I'm quite new to labview. I've created a simple program that takes some inputs (start_value, stop_value and step), and creates an array with the corresponding values.
This is what I've done so far:
The problem is that the displayed array, does not show the actual values from the last run, but the ones from the previous. So I must run it twice to get the good values in the array.
Why is it happening? What am I doing wrong ?
Thanks in advance.
Solved! Go to Solution.
04-15-2020 05:00 AM
04-15-2020 05:20 AM
Thank you very much !!
Now, it seems it's time to learn the basics of those race conditions !
Best regards !
Angel.
04-15-2020 05:40 AM
@angel6700 wrote:
Now, it seems it's time to learn the basics of those race conditions !
General rule of thumb: use a wire if you can. LabVIEW can be a very highly parallel language. You have to use wires to force data flow to set the order of operations.
Then when you get a little farther down the experience trail: A Look At Race Conditions
04-15-2020 10:18 AM
OK, so you learned about race conditions. Good! 😄
So, while you are "ramping" (sic) up your learning curve, here are some alternatives that will typically give you the same result (your code is the top loop).
Notes: There is a "+1" primitive. Avoid right-to-left wires. Learn about coercion dots.Look inside "ramp by delta" to see how to deal with potentially bad inputs (inf, zero, Nan, etc.). For example, a step of zero will probably run out of memory unless you protect the downstream code from it, etc.