05-08-2015 06:04 PM
I am calculating the speed of an object(with the NIElvis II) as it passes through infrared sensors. my problem is in my 2nd part of the sequence structure I am getting a 0 from the previous part. I found out this is because the while loop/case structure is causing the value to go to 0 after the loop stops. I'll attatch my Vi if anyone can give me some insight. sorry if it is a little messy as I have been doing a lot of experimenting to fix the problem.
05-11-2015 10:46 AM
Kyreraza,
What you have here is a classic race condition.
Here you can learn more about what race conditions are.
You'll need to use something like a queue to force correct data flow.
You can find more about using queues in LabVIEW here.
You'll end up with something looking like this.
-CB
05-11-2015 02:46 PM
@Kyreraza wrote:
I am calculating the speed of an object(with the NIElvis II) as it passes through infrared sensors. my problem is in my 2nd part of the sequence structure I am getting a 0 from the previous part. I found out this is because the while loop/case structure is causing the value to go to 0 after the loop stops. I'll attatch my Vi if anyone can give me some insight. sorry if it is a little messy as I have been doing a lot of experimenting to fix the problem.
Here is what's happening:
You figure out how to solve it. Should not be hard. Think dataflow! 😄