05-19-2008 03:31 PM
Curious...
Why are you using so many Globals. Do you really need them?
RayR
05-19-2008 04:06 PM
05-20-2008 06:57 AM
Okay..
The way I proceed to removing Globals is to first investigate where they are used. If they are within sub-vi's, then I create terminals on the connector pane on the sub-vi and wire them directly.
I will use Globals if they are rather static in nature, such as holding the Instrument ID (VISA). But I do not use them to pass data between VI's.
05-20-2008 06:40 PM - edited 05-20-2008 06:41 PM
05-20-2008 07:58 PM
Well, we don't see all of the code (e.g. what is in the FALSE cases?), but here are a few tips.
You really should attach some actual code. Debugging images is no fun at all. 😉
05-20-2008 08:24 PM
Added to Altenbach's comments would be:
Can you describe what the code does? Is it part of a loop? How does it get called?
The reason for asking is that you appear to use Local(s) to increment a value and Globals to store / update the boolean value. There may be some much easier and cleaner way to accomplish the same. But we would need to understand what this is supposed to do in order to suggest optimazation approaches.
RayR
05-21-2008 09:35 AM - edited 05-21-2008 09:39 AM
05-21-2008 09:49 AM
05-21-2008 10:45 AM
05-21-2008 10:45 AM - edited 05-21-2008 10:46 AM
You can always choose the appropriate state by "right-click... change to control/indicator/constant".
Mind you representations. Your code is full of coercion dots. For example the zero in the FALSE case should be U32. Same for the "200" constant.
Anyway, we need to know how this code part fits into the rest of the program. Is there a bigger while loop around it?
What else needs access to the outputs?
Where do the inputs come from?