From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

strict type List problem

Dear LabView Enthusiastics,

I've a strange problem I cannot understand.

I use a single selection listbox control in several VIs. I use the
attribute node 'Item Names'. Everything works fine.

To make changes easier I would like to change the list control to a
defined type.
That's ok when I save it as a type def., but then I do not get the same
list in all my VIs.

When I save the list as strict type I do not have the option 'Item
Names' anymore, so my program does not work anymore (It's quiet some
code).

Has anybody any hints??

Bes Regards
Urs
0 Kudos
Message 1 of 7
(2,564 Views)
I don't see this behavior. I've attached a LabVIEW 6.0.2 VI and control.
Download All
0 Kudos
Message 2 of 7
(2,564 Views)
If I understand you correctly, you want to programmatically, at run time, change "Item Names" at a single place in your program and have all instances of the control typedef changed at the same time?
I am afraid it is not possible. Using a strict type, the "Item Names" attribute is not available (LV5.1) or the property is read-only (LV6). In LV6 you can write the "Item Names" property only if you use a reference to the typedef control on its control VI. Even then, the changes made programmatically to the strict type are not propagated to instances in memory until the VIs come idle and a manual change enables the "Apply Changes" menu item.
The best hint I can give is to write "Item Names" for every instance of the Listbox control whenever there is a chang
e.


LabVIEW, C'est LabVIEW

0 Kudos
Message 3 of 7
(2,564 Views)
Thanks for the input!

I'm sorry not to have mentioned before I use LV5.1 under Win98SE

In the list mentioned every line stays for one step of a process which
should be allowed to be strated individually or in order, the process is
kind of a state machine.In my VIs I only want to read the item names from
the list to control which state is the valid one just now. I do not want
to programmatically change the 'process step' list. The list is used in
many places in several VIs, that's why I want to have it defined strictly
and so I can change once only and does not have to finde it everywhere.
I think I could do it via the integer output of the list, but using the
item names I get a self descriptive program. I like this especially
because this program will changed
many times in future 😉

Any better ideas to drive around this problem?

Thanks
Urs

Jean-Pierre Drolet schrieb:

> If I understand you correctly, you want to programmatically, at run
> time, change "Item Names" at a single place in your program and have
> all instances of the control typedef changed at the same time?
> I am afraid it is not possible. Using a strict type, the "Item Names"
> attribute is not available (LV5.1) or the property is read-only (LV6).
> In LV6 you can write the "Item Names" property only if you use a
> reference to the typedef control on its control VI. Even then, the
> changes made programmatically to the strict type are not propagated to
> instances in memory until the VIs come idle and a manual change
> enables the "Apply Changes" menu item.
> The best hint I can give is to write "Item Names" for every instance
> of the Listbox control whenever there is a change.
0 Kudos
Message 4 of 7
(2,564 Views)
OK. Then the solution is to use a non-strict typedef control. When you have to make changes, edit the typedef strings list, make it strict typedef, apply changes (to propagate changes), make it back to non strict typedef, apply changes again. The calling VIs will be broken while the control is strict but revert to normal after it is made non-strict again.


LabVIEW, C'est LabVIEW

0 Kudos
Message 5 of 7
(2,564 Views)
Jean-Pierre Drolet schrieb:

> OK. Then the solution is to use a non-strict typedef control. When you
> have to make changes, edit the typedef strings list, make it strict
> typedef, apply changes (to propagate changes), make it back to non
> strict typedef, apply changes again. The calling VIs will be broken
> while the control is strict but revert to normal after it is made
> non-strict again.

In fact I've done it that way just this morning and it does work, but this
is somehow not a very good style of software writring, isn't it?

Thanks anyhow
Urs
0 Kudos
Message 6 of 7
(2,564 Views)
IMHO, it is not a matter of style... After all your code layout and performance is not affected by the way listboxes get their default strings during development.
It is a minor annoyance corrected in LV6 where the "Item Names" strings of strictly typed listbox is available as a read-only property.


LabVIEW, C'est LabVIEW

0 Kudos
Message 7 of 7
(2,564 Views)