04-15-2015 07:46 AM
I've got a few subVIs in use that take server references to graphs and images and add cursors, set bounds, and set pixel min/max values. Sometimes a couple of the cursors won't get set, or one of the bounds will be wrong, etc. If I open the subvi and place probes or retain values to see what numbers are being passed, everything is executed and all cursors are set. I've also had this problem outside a subvi with a property node setting 16 bit pixel min and max values. I've checked, and the same/correct values are being passed to all property nodes, as are the correct references. The subVI will always properly execute when run later in the calling VI, only at initialization do they sometimes fail.
Thanks,
Brendan
Solved! Go to Solution.
04-15-2015 09:15 AM
Ah yes, that is why I always keep some tape over the web camera in the lid of my laptop -- to keep the code from knowing that I'm watching it...
Seriously though folks, if putting probes on wires changes the result, you probably have a race condition that you are fighting. Can you poist your code, or at least some subset of it that demonstrates the problem?
Mike...
04-15-2015 11:06 AM - edited 04-15-2015 11:07 AM
--
04-15-2015 11:06 AM
Apologies for attaching a picture, rather than a .vi; there are a lot of dependencies and unrelated info. In any case, the image is the subvi that I think is causing me problems. In the sequence frame in which it resides, there are no other changes to the graphs being made. In the first execution, the only error is with the min/max of the right ROI temp graph. Furthermore, the next time this function is executed, all cursors and min/max are set correctly, except for the image min/max values, which are sometimes not.
04-15-2015 11:26 AM
Is there data in the graphs when this VI is ran? That could cause some issues with the cursors.
I also see you are writing to property nodes that reference the same graph in parallel. That could also be causing some interesting situations. Instead of running them in parallel, use a single property node to write all of the values.
04-15-2015 11:32 AM
04-15-2015 12:05 PM
So I tried unifying the property node, but that had no effect. It turned out to be related to writing data to the graph before setting the cursors and min/max. Even though the graph wasn't set to autoscale, it seems that it was being rescaled somewhat when data was written.
Thanks!