LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Locating where variables are "checked in / out" of a cluster.

I'm trying to follow some LV design advice, but can't really get it to work properly.
 
I'm using the "State Diagram Editor" to create state machines.  This gives a while loop with a Case inside. Variables are changed in some states and read in another.
 
The LV design advice seem to be that shift registers should be used to pass data through this state machine. As there are many variables I would then have to pack them into a cluster which is made into a strict typedef. Data can then be bundled and unbundled by name - so far so good.
 
Then occurs the problem that a variable is changing unexpectedly. I now have quite a few states where it may be changed - how do I find a listing of all these places without having to look through my entire code? (I also have old programs I edit that use a lot of stacked sequences, so it can really be a nightmare to find where the data is altered or used).
 
My solution to this is actually to use local variables - they are easy to get a listing of, and they don't have  a wider namespace than my cluster in a shift register. But this is directly contrary to the LV lore.
 
Any comments?
0 Kudos
Message 1 of 2
(2,437 Views)
From what you say it is apparent that you already know the benefits of using shift registers instead of locals, so I will not dig into this.
Two comments:
- you can do a textual search (Edit -> Find -> Text) of the control name to get a list of all occurrences in bundle/unbundle nodes
- while using typedefs is good, avoid using Strict typedefs unless you are building a specific element of the user interface; with Strict typedefs you will not be able to change any control property like size, fonts and so on, and this could annoy you sometimes
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 2
(2,429 Views)