LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric ctrl class: Which ctrl type to choose?

Hi!

 

I'd like to use references for my numeric controls, but I just realized that there are many sub-control types. Now I imagine the differences between some of them, but I'm struggling a bit with the difference between "numeric" and "digital".

VinnyLaTaupe_0-1648634861086.png

 

If I create a numeric control and then create a reference, it will specify "digital". Why not "numeric"? Will it cause any issues if I put the wrong type for a specific reference?

My guess is that it won't (might not have access to exactly the same properties) but I am very curious why no elements in the "Numeric palette" generates a Numeric control type reference.

VinnyLaTaupe_1-1648635028859.png

 

Thank you for your clarifications 🙂

 - Vinny.

 

0 Kudos
Message 1 of 18
(2,075 Views)

Hi,

 

I must admit that I never thought about it much.

Since there is no need to select the right one manually, I never felt the need to know! I just get the right typ from the control I'm actually using.

Selecting the wrong type manually may cause errors when you then try to use mismatched properties.

 

What are you planning on using the references for?

 

Best regards

Florian

0 Kudos
Message 2 of 18
(2,062 Views)

Digital is a more specific version of a Numeric.  Other Numerics include enums and rings.


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 3 of 18
(2,056 Views)

@Florian.Ludwig wrote:

What are you planning on using the references for?


Simply access values (set+get) as well as other "normal" properties (Visible; enabled state; Caption string etc.) nothing too specific.

 

I just found it easier to create them all in a cluster typedef rather than doing R.Click-->Create-->Ref-->Create constant and place it in a cluster. 

Now I have it all here and I can easily add/remove them as my software goes 🙂

VinnyLaTaupe_0-1648640483381.png

 

 

0 Kudos
Message 4 of 18
(2,049 Views)

@crossrulz wrote:

Digital is a more specific version of a Numeric.  Other Numerics include enums and rings.


So I would only have issues if I happen to load a reference of a Numeric into my cluster which has a reference of Digital; but not the other way around, right?

0 Kudos
Message 5 of 18
(2,047 Views)

The properties you listed shouldn't be an issue since even the most generic control references will allow them.

Values might be an issue though.

 

If I need a ref constant I will usually:

Drop a control refnum with quick drop (cr) -> drag the control on it -> change to constant.

 

I don't do that much anymore nowadays because I do set / get values with Set Control Values by Index.

0 Kudos
Message 6 of 18
(2,037 Views)

@Florian.Ludwig wrote:

I don't do that much anymore nowadays because I do set / get values with Set Control Values by Index.


What's that? 🤔

0 Kudos
Message 7 of 18
(2,028 Views)

The vis can be found in Programming -> Application control.

 

Basically you can set/get value not by the reference to the element, but by a reference to the owning vi and an index number corresponding to the element. It is a much faster read/write (which may not be relevant). You cannot manipulate other properties that way though.

0 Kudos
Message 8 of 18
(2,022 Views)

@VinnyAstro wrote:

@crossrulz wrote:

Digital is a more specific version of a Numeric.  Other Numerics include enums and rings.


So I would only have issues if I happen to load a reference of a Numeric into my cluster which has a reference of Digital; but not the other way around, right?


Coercion can only go up the hierarchy.  So a Digital reference can be coerced to a Numeric reference.  To go from Numeric to Digital, you will need to use the To More Specific Class function and possibly handle the error if it can't (for instance if the reference is to an Enum).


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 18
(2,015 Views)

@Florian.Ludwig wrote:

The vis can be found in Programming -> Application control.

 

Basically you can set/get value not by the reference to the element, but by a reference to the owning vi and an index number corresponding to the element. It is a much faster read/write (which may not be relevant). You cannot manipulate other properties that way though.


 

Is this globally what you are suggesting?

VinnyLaTaupe_0-1648738333831.png

 

 

If yes, how is it different/faster than this (what I am pretty much doing currently).

VinnyLaTaupe_1-1648738413415.png

 

0 Kudos
Message 10 of 18
(1,966 Views)