LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Identifying controls

It would be quite cool to have a re-entrant sub-VI that outputs a Boolean
depending on whether any controls have been changed on the front panel of
the caller. I thought this would be trivial, but it turns out the array of
"control" references you can obtain from the VIs front panel contains all
the indicators, as well as all the controls.

There doesn't seem an easy way of identifying which is a control and which
is an indicator- rescanning a panel because an indicator has changed is
clearly a bad thing. Anyone got a suggestion? Neither the class ID nor the
type descriptor seem to contain information on the input/output mode of the
object and it defeats the object of a simple solution if I have to start
screwing around with all my la
belling to identify things that way.
0 Kudos
Message 1 of 3
(2,301 Views)
Craig Graham wrote:

> It would be quite cool to have a re-entrant sub-VI that outputs a Boolean
> depending on whether any controls have been changed on the front panel of
> the caller. I thought this would be trivial, but it turns out the array of
> "control" references you can obtain from the VIs front panel contains all
> the indicators, as well as all the controls.
>
> There doesn't seem an easy way of identifying which is a control and which
> is an indicator- rescanning a panel because an indicator has changed is
> clearly a bad thing. Anyone got a suggestion? Neither the class ID nor the
> type descriptor seem to contain information on the input/output mode of the
> object and it defeats the object of a simple solution if I have to start
> screwing aro
und with all my labelling to identify things that way.

Hi, Craig,

May be it's not what you want, but I have an idea of using say
"description" property to determine a control type. Just start/end
description of FP element with code word like "Control" or "Indicatior".
This can play as a workaround I think.

Best Regards,
--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
sergey_acs@levsha.ru
http://acs.levsha.ru
0 Kudos
Message 2 of 3
(2,301 Views)
ok, here is my two cents. i like the description property myself. However,
if that's not your style, how about the type descriptor property. Doing
some research, the 1st element in the type descriptor array is as follows:

string control - 16
string indicator - 18
Numeric control - 12
numeric indicator - 14
waveform chart - 20

Things start to fall apart though :

1d array of numeric control (or indicator) - 30
2d array of numeric control (or indicator) - 34
1d array of string control (or indicator) - 34

So maybe NI can give us a comprehensive outline of just what each element
in the type descriptor is. Maybe there is a better element (than the 1st
one) to use. NI, any input?

Jared

Sergey Krasnishov wrote:
>>>Craig Graham wrote:>>> It would be quite cool to have a re-entrant sub-VI
that outputs a Boolean>> depending on whether any controls have been changed
on the front panel of>> the caller. I thought this would be trivial, but
it turns out the array of>> "control" references you can obtain from the
VIs front panel contains all>> the indicators, as well as all the controls.>>
>> There doesn't seem an easy way of identifying which is a control and which>>
is an indicator- rescanning a panel because an indicator has changed is>>
clearly a bad thing. Anyone got a suggestion? Neither the class ID nor the>>
type descriptor seem to contain information on the input/output mode of the>>
object and it defeats the object of a simple solution if I have to start>>
screwing around with all my labelling to identify things that way.>>Hi, Craig,>>May
be it's not what you want, but I have an idea of using say >"description"
property to determine a control type. Just start/end >description of FP element
with code word like "Control" or "Indicatior". >This can play as a workaround
I think.>>Best Regards,>-- >Sergey Krasnishov>____________________________________>Automated
Control Systems>National Instruments Alliance Member>Moscow, Russia>sergey_acs@levsha.ru>http://acs.levsha.ru>
0 Kudos
Message 3 of 3
(2,301 Views)