|
PSA: Enable Vision Race Condition
Just solved a really sneaky race condition last night, so I thought I would do something so other people don't fall in that trap and blame their vision slowness on "LabVIEW is slow."
In Robot Main.vi, there is a bit of code shown in the attached image that applies what is effectively a constant (an unwired control) to the global variable Enable Vision. You need to remove this bit of code if you are going to at all use this variable, say, to turn a ring LED on or off. If you do not, you can easily miss this, since you're "not supposed to edit Robot Main.vi." I certainly missed it.
This race condition is characterized by your vision code taking almost exactly 50 ms to loop every time, while it appears to take about 300 ms to update the result variables. As a result, it pretty much just looks like it's running slow.
Happy coding!
__________________
Team 4506: 2015-2016
Team 3007: 2017
Jack of all trades except C++ & Java
|