Jump to content

Coercion dot on LabVIEW Object


Recommended Posts

I feel naughty every time I see a coercion dot on my block diagrams and try to get rid of them as often as possible. But there's one case for which I don't understand why there's a coercion dot in the first place: wiring an object to its ultimate ancestor, the LabVIEW object.

post-10515-125924781296_thumb.png

A child wired to its parent class method will not show the dot, but wiring any object to the LV object terminal will.

Would there be an instance when this is necessary to notify us we're about to use the inheritance in a potentially unintended way?

Link to comment

I feel naughty every time I see a coercion dot on my block diagrams and try to get rid of them as often as possible. But there's one case for which I don't understand why there's a coercion dot in the first place: wiring an object to its ultimate ancestor, the LabVIEW object.

post-10515-125924781296_thumb.png

A child wired to its parent class method will not show the dot, but wiring any object to the LV object terminal will.

Would there be an instance when this is necessary to notify us we're about to use the inheritance in a potentially unintended way?

Hi François

Nothing sinister here, if the LabVIEW data member VI (dynamic or static) has its class input wired to it's class output then you will not see a coercion.

Otherwise you will see a coercion.

AQ made a post about this relationship recently in explaining some checking that occurs - I can't find the link yet - sorry! :frusty: .

But you may find it an interesting read!

  • Like 1
Link to comment

Initially we did it because we followed the same rules as VI Server, which does show coercion dots for the hierarchy of control refnums (wire a Knob refnum wire to a Control Refnum terminal and you'll get a coercion dot). Later we figured out that it helped you recognize whether or not automatic downcasting was operating or not. But I'm still in the camp that wishes we had different colors of coercion dots for different cases.

  • Like 2
Link to comment
  • 4 weeks later...
AQ made a post about this relationship recently in explaining some checking that occurs - I can't find the link yet - sorry! :frusty: .

To be clear: the upcast coercion dot has no effect at runtime. It is not the same type of performance penalty that the coercion dot from int to double represents. We've talked about wanting two different coercion dots, but that's hard to provide since red appears to be the only color that most people can see in that small a space and there's no way to put a different pattern when you only have 6 pixels. So all the coercion dots look the same.

Typedef to not-typedef-but-still-same-type (and vice versa) is another coercion that has no runtime performance penalty.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.