LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Priyadarsini

Search Coercion Dots in a Hierarchy of VIs

Status: New

During the final project development stages I have made it a practice to search for coercion dots & replace with proper conversion modules. This does not necessarily mean that I do not consider coercion dots during development itself. I do take care but a possible data type change at some point can introduce this. So it will be great if there is an utility to search for coercion dots in an hierarchy of VIs.

 

Priyadarsini S

8 Comments
Wart
Member

This might prove to be exceptionally useful when refactoring (or just flat out fixing) other peoples code.

altenbach
Knight of NI

>  I have made it a practice to search for coercion dots & replace with proper conversion modules

 

This might be a misguided effort, since just adding a conversion bullet does not eliminate the potentially poor choice of datatypes upstream. Dropping conversion bullets only hides potentially fundamental flaws in the code, which is misleading and can actually hurt performance. This is like fixing a transmission problem in your car with a new paint job. 😄

 

I would recommend you read this entire thread.

 

Of course the ability to search for coercions could be useful for other reasons. How about if they would show as warnings? (They currently don't).

altenbach
Knight of NI

How about adding the search for coercions as a new VI analyzer test?

AristosQueue (NI)
NI Employee (retired)

> How about adding the search for coercions as a new VI analyzer test?

 

I'm fairly certain that there's already a VI Analyzer test for coercion dots.

altenbach
Knight of NI

That's what I thought too, but I made a small VI with a coercion dot and it did not complain about it. Maybe I need to activate a certain test that is off by default... did not have time to study it further yet... ;).

 

EDIT: Ahh, by default it can have up to 10 coercion dots (or 2/wire) before it complains.... So yes, we simply need to set the user defined maximum to zero.

Priyadarsini
Member

Altenbach,

 

I completely agree with you that a coercion dot may indicate a poor data choice. But it is unavoidable in certain cases & need to remove those with the conversion modules when necessary.

altenbach
Knight of NI

> But ... need to remove those with the conversion modules when necessary.

 

Why? What's wrong with just leaving the coercion dots in place?

Darren
Proven Zealot

I imagine this idea will be declined, as there is currently a VI Analyzer test ('Coercion Dots') that, as Christian mentioned, does exactly what this idea describes.