viSci Posted November 5, 2008 Report Share Posted November 5, 2008 Greetings All, I have a vi that has n subpanels that each contain a instance of a reentrant vi. Each instance is given an identity by preloading a front panel control or the vi description with a unique identifier. Each instance will need to call a vi that provides Network Shared Variable R/W access. Since this vi is used across all subpanel instances, the vi must know which of n NSV processes is associated with the calling vi instance. So far the only way I have been able to do this is by using the call chain vi and then reading the top level vi description or 'identifier control' that contains the correct NSV process name. Just curious to know if anyone might have thought of a better way to do this. Quote Link to comment
PaulL Posted November 6, 2008 Report Share Posted November 6, 2008 Michael, You might try something like adding the identifier as an input to the VI that accesses the network variables, perhaps even incorporating this into the SV data. That may be somewhat similar to what you are trying. In some implementations of the OOP Command Pattern, for instance, the Command object includes an object that identifies the intended recipient of the command as well as the command content itself. Quote Link to comment
viSci Posted November 6, 2008 Author Report Share Posted November 6, 2008 Yes, I could add an input to my NSV wrapper vi but it seems messy to have to add that information to each use on my diagrams (which will be very plentiful). I guess my question could be distilled down to: How can a subvi discern the identity of a cloned parent vi instance without having to open up a reference to that parent vi. Opening and closing a vi reference every time I need to access a NSV seems very wasteful. For example if the call chain indicates the subpanel instance number then it could be done. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.