06-01-2016 08:29 AM
Has anyone come across this? i did a 'save as' on a project that was working correctly, without changing anything except saving as a different name there were 2 out of 50 or more true/false case structures that reversed the cases. This was fun to trouble shoot... has anyone seen this bug and is there a different way to avoid this?
Solved! Go to Solution.
06-01-2016 09:48 AM
I'm not sure I understand what you did. What, specifically, did you save? Was it a Project (which might save a bunch of internal VIs), a VI, or a Control/TypeDef? Were the 2-out-of-50 Case structures in a single VI, or scattered in multiple VIs? Were they simple Boolean Case statements? Can you provide an example (inside the VI where the change happened) of code where the Case did a spontaneous "Make This (true) Case False" (or "Make This (false) Case True")?
It seems likely (but I confess to not know how) that you "did something" to cause this behavior ...
Bob Schor
06-01-2016 10:02 AM
06-01-2016 10:05 AM
Here is the attachment
06-01-2016 03:17 PM
Ouch! Are you using a lot of Local Variables, particularly inside loops? Whatever is going on with your code, it is a function of the entire VI, so showing us such a tiny piece will not help much to find the "mistake".
What may be happening, particularly if you have lots of loops, lots of cases, and lots of Local Variables, is that some "meta-processing" of your code may have taken place, perhaps involving the inherent Race Conditions associated with Local Variables.
If you attach your entire VI, and if it has a "problematic" structure, I'm sure one of us will suggest how to clean it up, which may well make the problem "go away".
Bob Schor
06-01-2016 03:25 PM - edited 06-01-2016 03:28 PM
@ncm wrote:Here is the attachment
That does not really tell us anything. In particular, if the case is TRUE. the indicator just retains its original value, whatever that was. Whas this before or after "saving as"? Since you saved uner a new name, can you attach both before and after VIs?
There has to be more to all of this. Can you show us a little bit more code?
I tried a "save as" and nothing changed....
06-01-2016 03:50 PM
06-01-2016 03:54 PM
So, did the visible case change or did the case gets swapped (true case is now false, etc.) .
I am with Bob that most likely a recompile cause a slight change in execution order, exposing an existing race condtion.
06-01-2016 03:58 PM