LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

properties of numericwithscale class

I have a sub vi that accepts an array of ref's to slide controls and checks if the value is out of range of the scale and will change the indicator color red if it is. Works great.  (See attached pic: Slide.jpg)

I also have some knobs that I want to do the same test with. So Intead of using the Slide class as the input, I use the NumericWithScale class which both Slide and Knob derive from.  Problem is that the NumericWithScale class does not expose the Scale properties. Why is that? (See attached pic: NumScale.jpg)

I know I can write a polymorphic vi to handle each type (slide and knob) but that amounts to basically writing 2 vi's to do the same thing and I would have to create 2 different control arrays in the calling vi. 

So back to the question of why doesn't the NumericWithScale class expose the Scale properties?

Download All
0 Kudos
Message 1 of 3
(2,136 Views)
To answer the question, some of the properties available for the two types are different and that would mean NI would need to create two classes, which they either never got around to or didn't think about doing.
 
As for another option to handle this, you can use the To More Specific Class primitive to convert the reference to the necessary class. If you get an error, go to the next class.

___________________
Try to take over the world!
Message 2 of 3
(2,121 Views)
To answer the question, some of the properties available for the two types are different
and that would mean NI would need to create two classes, which they either never got
around to or didn't think about doing.

Ah! You're right. The scale classes of slide and knob are different. ClassID 52 and 69. After a first quick glance, I thought they were the same.

As for another option to handle this, you can use the To More Specific Class primitive to
convert the reference to the necessary class. If you get an error, go to the next class.

Yep, Know about that option too.  Thanks for the help.
0 Kudos
Message 3 of 3
(2,103 Views)