LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reference manipulation

Solved!
Go to solution

I would like to change the digit of precision for controls and indicatros in running my code.
A cluster contained several numeric controls.


In simple idea, all references can be collected then one for-loop is enough for this in real time.

As you can see precision.vi, why there is a buffer allocation in build array? or how to handle the compatible reference type?

 

In more trial, I can find the alternative way but I am not sure if this is the best way for my purpose.

 

labmaster.

Download All
0 Kudos
Message 1 of 6
(2,082 Views)

What is the question? ("your alternative way" does not really do anything better, except there is more code but you eliminate the coercion dots. These are NOT buffer allocation dots!)

 

You get the red coercion dots because some references are strict and others are not. That is not a performance issue and you can ignore that.

 

Do you have performance problems? Make sure that the FOR loop only executes whenever the precision changes, which is probably rare. What do you mean by "real time"?

0 Kudos
Message 2 of 6
(2,035 Views)

Personally, I would even eliminate that extra FOR loop as follows. Less clutter. 😄

 

(Make sure to wire the error out to avoid automatic error popups, e.g. if your cluster also contains incompatible elements, such as a boolean)

 

altenbach_0-1625926864875.png

 

0 Kudos
Message 3 of 6
(2,027 Views)

@altenbach wrote:

Personally, I would even eliminate that extra FOR loop as follows. Less clutter. 😄

 

(Make sure to wire the error out to avoid automatic error popups, e.g. if your cluster also contains incompatible elements, such as a boolean)

 

altenbach_0-1625926864875.png

 


Personally, I'd pretty much always follow @altenbach's advice.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(1,986 Views)

>there is more code but you eliminate the coercion dots. These are NOT buffer allocation dots!

 

Thank you for the response.

Can you explain why the coercion dot does not allocate a buffer?

Is it a special exception for the data type of reference?

Where can I find the related statement?

 

labmaster.

0 Kudos
Message 5 of 6
(1,961 Views)
Solution
Accepted by labmaster

@labmaster wrote:

>there is more code but you eliminate the coercion dots. These are NOT buffer allocation dots!

 

Thank you for the response.

Can you explain why the coercion dot does not allocate a buffer?

Is it a special exception for the data type of reference?

Where can I find the related statement?


Coercion changes data from one type to another. That would often require a new memory buffer, as the data size and\or data layout can be different.

 

Type casting is just a way to tell the compiler (and programmer) the (expected) type of the object. A To More General is pretty much a no-op during run time. A To More Specific has error checking, but doesn't effect the object. The input object either is the new type or it isn't. There simply isn't much to do at compile time. The object doesn't change at all.

0 Kudos
Message 6 of 6
(1,944 Views)