LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strict Type Definitions

I have a StrictTypeDef that is a enum of commands. I have FooB.vi that
contains a front panel control of that type. That control is wired as
a connection to a front panel terminal. I have FooA.vi that calls
FooB.vi as a subvi. I have created a constant of the StrictDefType to
wire into FooB.vi subvi.

When I add items to the StrictTypeDef control, the constant that I
created in FooA.vi becomes grayed out and does NOT contain the new
items. I have enabled "Auto-Update from type def" on the constant. Why
isn't it updated with the new items?

I'm trying to come up with an approach so that I don't have to go
around to every constant instance of this control and manually update
it...

Thanks,
Stephen

0 Kudos
Message 1 of 8
(3,218 Views)
When you add items to the enum, the updates to controls and constants take place when the .ctl is closed or when you select Apply Changes from the menu (File or Edit, I don't have a typedef open now to check).

It is not intuitive or obvious, but it makes some sense after thinking about it.

Lynn
Message 2 of 8
(3,215 Views)
Usually the grayness disapears as soon as you close the enum, or press the Apply Changes button. If the constants are still gray, something weird is going on...

Regards,

Wiebe.
Message 3 of 8
(3,208 Views)
On Aug 3, 12:37 pm, "Wiebe@CARYA" <wiNOebe.walsSP...@carAMya.nl>
wrote:
> Usually the grayness disapears as soon as you close the enum, or press the Apply Changes button. If the constants are still gray, something weird is going on...
>
> Regards,
>
> Wiebe.

Thanks for the response.

Yes, the grayness disappears as soon as I close the enum or press
Apply Changes. However, the new items are not available in the
constant that I created from the enum. The front panel control
instance of the enum DOES have the new items, but not the constants.
Is there a way to do this?

-Stephen

0 Kudos
Message 4 of 8
(3,200 Views)
Did you create the constants before you changed the control to a typdef? Constants which track changes are one of the big reasons for using typedef enums. Check the constants by context clicking. Do they have a "Disconnect from Typedef" option? If not, the constant has either been disconnected or was created before the typedef. In this case you will need to create new constants from the typedef, after which you should be OK.

Lynn
Message 5 of 8
(3,195 Views)
On Aug 3, 12:39 pm, Stephen <stephen.r.g...@gmail.com> wrote:
> On Aug 3, 12:37 pm, "Wiebe@CARYA" <wiNOebe.walsSP...@carAMya.nl>
> wrote:
>
> > Usually the grayness disapears as soon as you close the enum, or press the Apply Changes button. If the constants are still gray, something weird is going on...
>
> > Regards,
>
> > Wiebe.
>
> Thanks for the response.
>
> Yes, the grayness disappears as soon as I close the enum or press
> Apply Changes. However, the new items are not available in the
> constant that I created from the enum. The front panel control
> instance of the enum DOES have the new items, but not the constants.
> Is there a way to do this?
>
> -Stephen

OK, I think what happened. I created my StrictTypeDef from a Classic
Control -> Text Ring and NOT a ENUM. I just dragged and dropped from
an older VI I was modifying. I guess that's why the item names didn't
update automatically.

-Stephen

0 Kudos
Message 6 of 8
(3,184 Views)
I believe I had the same problem with Ring control constants and it was submitted to N.I. R&D some months back. Don't ask me the CAR number.
0 Kudos
Message 7 of 8
(3,157 Views)

You are correct Bill. 

The CAR number is 439EGKCS in case you are interested.  However, this is not a bug.  Constants from strict typedef masters are (non-strict) typedef constants, which means they only update when the datatype of the master changes.  Since you are not changing the datatype when changing the values in a ring, the constants will not be updated.  This is different from an enum where the items in the enum define the datatype.

I hope that makes sense.  Let me know if you have any more quesitons.

Brian Coalson

Software Engineer
National Instruments
Message 8 of 8
(3,096 Views)