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 APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring Control: Strings And Values StringsAndValues

I want to programatically create a ring control and pouplate the string and value fields. The issue I am having is that the values I would like to assign are larger than a 16bit unsigned int can hold. For LV 8.6, it looks like the "StringsAndValues" property nodes of the ring control only allow input of a 16bit integer. Is there a workaround? Is this changed in LV 2009?

Bill

StringsAndValues.png

0 Kudos
Message 1 of 14
(10,062 Views)

Right click the control and choose Representation->U64 or whatever you want.  By default, this control is 16bit, but can be made anything up to 64bit, including floating point.  If you are using scripting, you can use the Representation property to change this programmatically.

0 Kudos
Message 2 of 14
(5,015 Views)

Seems like its still truncating or casting it down to a u16 if i try to do this with scripting. The values created are not the same as the values that I pass in.

output.png

0 Kudos
Message 3 of 14
(5,015 Views)

From what I can tell, it looks like no matter what value I enter in that property node it does a 'To Unsigned Word (16bit)' conversion.

I also tried changing the typedef of the input (saved in the C:\Program Files\LabVIEW ... directory). No success with this either.

0 Kudos
Message 4 of 14
(5,015 Views)

Hi Bill,

Be carefull:

Byte: 8 bits

Word: 16 bits

Long: 32 bits

Quad: 64 bits

It's not obvious, I always forget my self.

Unsigned Quad.PNG

U64.PNG

Regards,

Nitrof

0 Kudos
Message 5 of 14
(5,015 Views)

Are you doing this on a running VI?  You cannot change the representation if the VI is reserved or running.  To do this with scripting, you will need to open the VI using VI server, open a reference to the control on the unreserved/nonrunning VI, then set the representation.  You cannot do this in the VI which contains the control.

0 Kudos
Message 6 of 14
(5,015 Views)

I think we are getting on the wrong track ... I have already changed the representation of the ring, the problem is that on the PROPERTY NODE the input restricts me to a 16bit int (most property nodes let you make value inputs as a variant rather than a type (like u16) of numeric))

The StringsAndValues input on the property node looks like this:

Array

     Cluster

          String (string type)

          Value  (u16 type)

So whenever I input a value (even if i have already changed the representation of the ring), the value is being coerced to a 16bit int.

My desired input is

Array

     Cluster

          String (string  type)

          Value  (u32 type)

PS - DF_Gray - - this is not on a runningVI

0 Kudos
Message 7 of 14
(5,015 Views)

Actually since a ring can be any scalar, (UInt, Int, FP, DBL, Etc.) you want it to be

Array

     Cluster

          String (string  type)

          Value  (variant type)

And to have it throw an error if it isn't a scalar type wired in.  For example, wiring an array, or a picture wouldn't make sense.  But otherwise you will end up with a solution to your particular problem (U32) but others who need U64 or DBL would have a different requirement.

LabVIEW ChampionLabVIEW Channel Wires

0 Kudos
Message 8 of 14
(5,015 Views)

I agree

The property node WANTS the u16 input

0 Kudos
Message 9 of 14
(5,015 Views)

Instead of a variant it would be preferable if it was whatever type the actual control is.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 14
(5,015 Views)