LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring StrictType and AutoUpdate

Hallo,

I'm using LV7Express.

When I edit a StrictTypeDef of a TextRing, the constant instancies are not
updated automatically (although checked on the context menu)

Is this a bug or a feature. If it is a feature, how can I "disable" this?

Thank you

Oliver Friedrich
Message 1 of 4
(2,896 Views)
Hi Oliver,

The feature you are looking for is part of the enum.

In a enum the values and the strings are linked to the typedef. In a menu ring they are not. A menu ring is simply a numeric that gives you the ability to associate a string with a value. This definition can be changed at run-time and are very useful if you want to modify a selection list on the fly.

An enum's strings can NOT be modified at run time. The string->numeric values are linked.

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=50650000000500000057410100&HTHREAD=000082263&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0

So...
if you desire that functionality use an enum.

If you need to change selections on the fly, use the menu ring.

Additional cool trick:


Let say you want to set up a enum with 500 values.

Populating all of these values can take a long time. You can not write the strings of an enum, so what can you do?

Start with a menu ring and write the strings using a property node.
Then,
Right-click and choose enum!
All of the values from the ring will be retained.

This could save you a lot of work.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,896 Views)
Hallo Ben,

so it seems to be intended behaviour. But nevertheless I'm not happy with
it because

a) A ring control offers me too the "Auto update from type def" on the
context menu. Considering your theory that makes no sense. And this feature
doesn't work, regardless whether it is checked or not. So that's kidding
people, isn't it?

b) An Enum is not an alternative to a Ring in so far, that an Enum has a
numeric range of 0...n without gaps whereas the Ring can be configured as
you like.

c) To your trick of programmatic editing: Thanks for this nice idea, but
that's no exclusive capability of the Ring, you can do the same with an
Enum.

Anyway, thank you very much for your active participation.

Oliver Friedrich
0 Kudos
Message 3 of 4
(2,896 Views)
You are correct, sparse enums can not be created in LV. They can be used!

The following e-mail from Rolf provides a clue as to how to create them.

"

From: Rolf Kalbermatter ...
Sent: Saturday, November 23, 2002 3:54 PM
To: .....
Cc: Info LabVIEW
Subject: RE: constants & #define


wrote:

>You will find the following values of this enum-const:
>first item: value = 0
>second item: value = 1
>third item: value = 20
>
>This is a very interesting phenomen. But how can I produce such a
>enum-const with individual value by myself?

You really can't (yet)! Although LabVIEW can deal with such sparse enums there is no editor interface to create them. The ComponentWorks library has an according definition in the ODL file and LabVIEW generates such an enum when importing that ODL definition. Another way to create them is by creating a FunctionPanel in LabWindows CVI and import that Function Panel with the Tools->Instrumentation->Import CVI Instrument Driver.

Rolf Kalbermatter
CIT Engineering Nederland BV tel: +31 (070) 415 9190
Treubstraat 7H fax: +31 (070) 415 9191


"

I think this apparent short coming can make more sense if you conduct a short experiment.

Create a typedef'd ring and an typedef'd enum.

Drop both of them on the FP of anew VI and make sure they are both controls.

Next pop-up on each of the terminals and do a create indicator.

Then, show you help window and switch to the wiring tool.

When you position your wiring tool over each of the wires, LV will show what is the data type of each wire.

You will notice that the enum's wire indicates it is an enum and will also show that the data type of enum caries the enum strings as part of the data type.

This is not the case with the ring.

The auto-update of the ring does happen but is almost trivial in the case of a ring. If you change the data representation of the ring from U16 to U32, this update will propogate.

I am attaching an llb in LV 7.0 that allows you to conduct the experiment described above, and also illustrates that the enum values are in the data type.

Still trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 4 of 4
(2,896 Views)