LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change value of a variable by comparison?

Solved!
Go to solution

Hallo,

 

here is a simplified version of my code, the matlab script is used so it might not work in your computer. keep in mind that what im doing for the variable rbd is done also for another 5 variables so cables here and there are no good option to me...but i hope you can help and suggest sth better

 

 

0 Kudos
Message 11 of 12
(272 Views)

Maybe you oversimplified your code, but it is crawling with race conditions. Most likely the local variables on the right are read way before the code on the left has a change to calculate the results. I also noticed that your code does not have a toplevel while loop. Are you using "continuous run" by any chance?

 


@valdi wrote:

... keep in mind that what im doing for the variable rbd is done also for another 5 variables so cables here and there are no good option to me...but i hope you can help and suggest sth better


What is wrong with cableswires? I don't understand your aversion. Why are you using value properties instead of local variables in some places? What is the purpose of the slow FOR loop in the upper right?

Instead of 5x duplicate code, use one instance of the code and a FOR loop to iterate over all parts. Try it!

0 Kudos
Message 12 of 12
(256 Views)