LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting access to numeric format properties

Solved!
Go to solution

I am creating numeric controls/indicators on the fly.  Most of them need to be displayed in hex.  However, I can't access the format properties that allow me to set this when I create the control/indicator using the New VI Object VI.  I think this is happening because the numeric type is not Digital (Strict) but rather just num.

 

I say this because I realized that if I simply place a numeric control on a front panel, right click to create a reference, then access the properties of said reference, I indeed have access to the format properties I'm talking about.  A compare/contrast pic below to show what I'm talking about...

pic5.png

 

So my thinking then was, perhaps I should change the style of the object I'm creating to be of type Digital Numeric, but this style doesn't exist.  There are Digital Data styles, but that's something completely different.

 

So my question is, what style/class combo do I need to have a numeric control that will allow me to specify the Format property?

 

thanks

0 Kudos
Message 1 of 9
(3,147 Views)

Hi bmishoe,

 

I haven't done any scripting so far, but for "usual" numeric controls you use the property "format string" to set the display format:

Beispiel_VI_BD.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,135 Views)

what I'm saying is that that Format option is not available when you create a VI object the way I showed.  All those other options are, but nothing to do with the format.

0 Kudos
Message 3 of 9
(3,131 Views)

Hi bmishoe,

 

when you create a numeric control by scripting you should receive a reference to that control. Then you're able to set format options as you like to!

 

Btw. do you know the LabVIEW Idea Exchange? A great to place to make suggestions for improving the LabVIEW IDE…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,123 Views)

That's exactly what I'm showing in the top portion of my picture.  The reference to the control comes out of the New VI Object node, then to a property node.  That property node does not allow me to set any Format options.  Lots of other options are there, but no Format related ones.

0 Kudos
Message 5 of 9
(3,117 Views)
Solution
Accepted by topic author bmishoe

You need to make it a Digital Numeric.

DigiNum.png

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
Message 6 of 9
(3,108 Views)

perfect!  Thank you

0 Kudos
Message 7 of 9
(3,104 Views)

In your example you are creating an object of the Numeric class, which is too generic to have a "FormatString" property.  Dials, knobs, and sliders inherit from Numeric, so it wouldn't make much sense for them to expose "FormatString".  You need to create an object of the Digital class, which inherits from Numeric, then you will be able to set format options.

 

Chris M

Message 8 of 9
(3,102 Views)

Change your class to a Digital numeric.  The Numeric is a general number that could be almost anything that doesn't actually have a display format (knob, enum, ring).  The digital numeric is more precisely the numeric control you are putting down.  The specific class has a display format while the general does not.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 9 of 9
(3,092 Views)