LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array of refnums and typecasting

Solved!
Go to solution

I have 8 arrays on the front panel of my VI. I have created refnum for each array.

 

I am building an array of these refnums and passing this array to a subVI.

 

LabVIEW is typecasting some of the refnums and not others as evidenced by the red dot on the Build Array element.

 

The arrays of all of Doubles.

 

Why is this happening?

 

refnumArray.jpg

0 Kudos
Message 1 of 5
(2,616 Views)
Solution
Accepted by topic author nyc_(is_out_of_here)

An Array must contain elements of identical types differing only in value.  In Fact the elements must have identical properties!  Its likely that some of your double arrays have different dimentions (1D, 2D), display formats, or even that some are controls and others are indicators.  The refnums will get coerced to the "Least generic common type."  Sometimes that is OK but often dangerous if you work with any property other than "Value."

 

Grouping refnums into clusters can avoid these coersions.


"Should be" isn't "Is" -Jay
Message 2 of 5
(2,611 Views)

The only thing different is that in 4 of the arrays I am displaying 2 digits past the decimal point and and 1 digit past the decimal point in the other 4 arrays.

 

I didn't think something as simple as this would make the difference.

 

Thanks!

 

 

 

0 Kudos
Message 3 of 5
(2,599 Views)

Yet, it seems to be...

 

I just built up the VI as attached, and there is a coercion dot with only a digits of precision difference (both elements had 1.25 entered into them).

 

0 Kudos
Message 4 of 5
(2,578 Views)

Thanks, Kathryn, for confirming.

 

The new LabVIEW things one learns each day.  Smiley Happy

0 Kudos
Message 5 of 5
(2,560 Views)