Jump to content

Cloned Subpanel VI Identity and Shared Variable Access


viSci

Recommended Posts

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.

Link to comment

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.

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.