LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set/get attribs via SubVI (revisited)

Greetings. This question was asked about a month ago (See "How to
set/get..." by John Cruz, 3/20/00 in this newsgroup), but the ensuing
discussion didn't address a similar question that I have.

The question is the same: Is there a way to set/get attributes of a control
(like "Visible" or "Disabled") on the front panel of a VI directly from
within a subVI?

The solutions given last month all appeared to require an output of the
subVI wired to the attribute node inside the calling VI, and I'd like to
avoid that. E.g. I would like to set an attribute of a top-level control
using a subVI, but using a subVI that has NO OUTPUTS.

Another way to think of it is that I'd like to discover something like a
"Global Attribute
Node" for a control which itself is not global. I.e. an
attribute node which could be referenced from any VI but would still affect
only one control on a different VI's front panel. Obviously that specific
creature doesn't exist, but that's the idea I'm after.

Sufficiently confused? My main goal here is really to enable and disable
buttons through a subVI, and to avoid using more wires whenever possible. I
guess I'm a LabView neat-freak. 🙂

Thanks in advance for any advice!
Justin Goeres
Indio Systems, Inc.
Pleasanton, CA
0 Kudos
Message 1 of 4
(2,428 Views)
Hi Justin

> My main goal here is really to enable and disable
> buttons through a subVI, and to avoid using more wires whenever possible.

I really understand what your looking for. I would like to have the same. I've
Sub-VIs for plotting spectra, which manipulates graphs located on the Main-VI.
It's than annoying not to be able to do all this manipulations in the Sub, but
having all this attribute nodes lying around on the top level. For my feeling,
not the wires are the problem, but all the attribute nodes (this can get many
if you want to control several graphs and several attributes per graph).

==>>> Unfortunately though, there is not such a thing as a "Global Attribute
Node", and there is also no "global controls" as your saying. Global controls
would j
ust be the thing we're looking for. What you are referring to are global
variables, just containing the value (and the type) of the control. A global
control on the other hand would carry all information about a control, also
attributes with it. You could then modify the value and the attributes at any
place in your hierarchy, and display it at some other. Would be dangerous not
to create a mess, but there are situation where this approach would be
reasonable.

Any reasons for NI not to put this on the wish list???

Gilbert
0 Kudos
Message 2 of 4
(2,428 Views)
Justin Goeres wrote:

> Greetings. This question was asked about a month ago (See "How to
> set/get..." by John Cruz, 3/20/00 in this newsgroup), but the ensuing
> discussion didn't address a similar question that I have.
>
> The question is the same: Is there a way to set/get attributes of a control
> (like "Visible" or "Disabled") on the front panel of a VI directly from
> within a subVI?
>
> The solutions given last month all appeared to require an output of the
> subVI wired to the attribute node inside the calling VI, and I'd like to
> avoid that. E.g. I would like to set an attribute of a top-level control
> using a subVI, but using a subVI that has NO OUTPUTS.
>
> Another way to think of it is that I'd like to discover something like a
> "Global Attribute Node
" for a control which itself is not global. I.e. an
> attribute node which could be referenced from any VI but would still affect
> only one control on a different VI's front panel. Obviously that specific
> creature doesn't exist, but that's the idea I'm after.
>
> Sufficiently confused? My main goal here is really to enable and disable
> buttons through a subVI, and to avoid using more wires whenever possible. I
> guess I'm a LabView neat-freak. 🙂

Unfortunately, Jean-Pierre Drolet's discussion from the thread in March is
exactly right. In the current incarnation of LabVIEW, there is simply no direct
way to access panel object attribute nodes from a secondary VI. The suggestion
to use VI Server and the Set Control Value method with a control wired to the
attribute node of choice sounds like an excellent idea to me.

I'm pretty sure that the LabVIEW developers have long since identified this as a
very pivotal bit of functionality for LabVIEW, so stay tuned.

Regards,
John Lum

0 Kudos
Message 3 of 4
(2,428 Views)
A "creature" such as a Global Attribute Node for a control does not exist
yet in LabVIEW. My guess is that sooner or later you will be able to open a
"Control Reference" to a VI FP control and use it to call "Property Nodes"
and "Invoke Nodes" to sets its attributes from anywhere in your application
or even from another application, as it is currently possible for VIs with
the VI Server.

For the moment, a VI must set its attribute nodes on its own diagram. To set
attribute nodes from outside the VI you must provide a method to communicate
with the VI and tell it which value to set its attribute.
For example, the VI can read a global variable in a while loop to update the
attribute node to whatever value have been written to by other running VIs,
even by its subVIs. provided that the loop execute in parallel with the
subVI call.
Instead of using a global, you can wire a front panel control to the
attribute node. A VI that wants to modify the attribute node then uses VI
Server method "Set Control Value" on this front panel control to write the
new value.

Basically, all you need is a technique to pass data between VIs; you can use
any other you like (notifiers, TCP/IP, etc).

Of course, when you design your VI, you must know in advance which attribute
nodes will eventually need to be externally updated and wire them
accordingly. Hopefully, this won't be necessary if a "Control Reference"
ever come to be implemented in LabVIEW.

Regards,


Jean-Pierre Drolet
Scientech R&D inc
Trois-Rivieres-Ouest (Quebec)
CANADA G8Z 4H1


John Lum a �crit dans le message :
38F5D29E.1AC0678C@alum.mit.edu...
> Justin Goeres wrote:
>
> > Greetings. This question was asked about a month ago (See "How to
> > set/get..." by John Cruz, 3/20/00 in this newsgroup), but the ensuing
> > discussion didn't address a similar question that I have.
> >
> > The question is the same: Is there a way to set/get attributes of a
control
> > (like "Visible" or "Disabled") on the front panel of a VI directly from
> > within a subVI?
> >
> > The solutions given last month all appeared to require an output of the
> > subVI wired to the attribute node inside the calling VI, and I'd like to
> > avoid that. E.g. I would like to set an attribute of a top-level
control
> > using a subVI, but using a subVI that has NO OUTPUTS.
> >
> > Another way to think of it is that I'd like to discover something like a
> > "Global Attribute Node" for a control which itself is not global. I.e.
an
> > attribute node which could be referenced from any VI but would still
affect
> > only one control on a different VI's front panel. Obviously that
specific
> > creature doesn't exist, but that's the idea I'm after.
> >
> > Sufficiently confused? My main goal here is really to enable and
disable
> > buttons through a subVI, and to avoid using more wires whenever
possible. I
> > guess I'm a LabView neat-freak. 🙂
>
> Unfortunately, Jean-Pierre Drolet's discussion from the thread in March is
> exactly right. In the current incarnation of LabVIEW, there is simply no
direct
> way to access panel object attribute nodes from a secondary VI. The
suggestion
> to use VI Server and the Set Control Value method with a control wired to
the
> attribute node of choice sounds like an excellent idea to me.
>
> I'm pretty sure that the LabVIEW developers have long since identified
this as a
> very pivotal bit of functionality for LabVIEW, so stay tuned.
>
> Regards,
> John Lum
>
0 Kudos
Message 4 of 4
(2,428 Views)