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
>