LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

list and cluster

Hello,

Why in this VI the unbundling of the cluster gives 2 different kinds of data type ?
The 2 list look like very similar. When creating a constant from the cluster it is OK, but when unbundle
it is not !

I do not understand why ?

Regards

0 Kudos
Message 1 of 15
(3,485 Views)

quite simply, one is a ring control, the other one is an enum control.

the two are quite similar, but an enum can only correlate a string to a Unsigned integer, while a ring can assign any string or picture to any value (eg dbl).

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 2 of 15
(3,480 Views)
One of the controls is an enum and one of the controls is a ring control. The unbundle is doing exactly the correct thing. The appearance of the two is similar but the behavior is a little bit different because of additional informaiton included with an enum. To see this, wire up the results of the unbundle to a couple of case statements. The ring control labels will be numeric and the enum labels will be the text values of the enum.
Message 3 of 15
(3,472 Views)

HI Gabi1,

THere is another important point that that is important.

These are illustrated by turn on the help window and using the wiring tool while floating over the wires of an enum vs a ring.

The enum actually has the strings as part of its data types. The ring does not. This disticntion makes it possible to wire a enum ot a "format into string" since the strings are "in the wire!"

Done splitting wires. Smiley Happy

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 15
(3,470 Views)

yes, that why i always prefere to connect the ring to an enum type def via a reference subvi (eg when i need a picture ring on the FP), and then only use enums to wire case structures.

thanks Ben and Dennis for pointing it out.

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 5 of 15
(3,463 Views)
Thank for the information, Now the question is, how can I convert the data type from ring to enum ?
0 Kudos
Message 6 of 15
(3,451 Views)
To replace, just right click on the ring, select Replace and browse to the enum control.
0 Kudos
Message 7 of 15
(3,445 Views)
It is an idea,
but I want to convert because the ring is from DAQ and I cannot change it
0 Kudos
Message 8 of 15
(3,443 Views)

"... I want to convert because the ring is from DAQ and I cannot change it..."

See the example that Jarod posted in this thread.

Use Dennis' tip to create the enum and you should be good to go.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 15
(3,433 Views)

Typecast it.

Never mind. Look at the example Ben mentions.

Message Edited by Dennis Knutson on 10-19-2007 07:38 AM

0 Kudos
Message 10 of 15
(3,434 Views)