LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mysterious coercion dot

Found in this piece of diagram:

 

ScreenHunter_001.jpg

 

The constant 2 is of type I32, so why is there a coercion dot at the "Inverted" connector of the Compound Arithmetic function?

The interesting thing is that if I uncheck the "Invert", the coercion dot disappears, and if I check it off again:

 

ScreenHunter_002.jpg

 

Gone!

Full Disclosure: I inserted the I32 conversion function before I noticed the remnent coercion dot... And if I undo all these steps, I am unable to reproduce the coercion dot.

Mysteries of LV...

0 Kudos
Message 1 of 6
(2,910 Views)

inverting a 2 produces a dbl, no? then you're adding two different types. Not sure why it isn't reproducible, as it should happen every time. 

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

I meant the "invert" option of the Addition, which is a subtraction, perfectly within the scope of an I32.

Not sure why there was a coercion dot in the first place, even less why the repeated Ctrl-Z cleared it...

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

Hi,

I was able to reproduce it by playing a bit with LabView...

Step1 : I use a double and a U 32 as inputsa -> as expected, there is a coercion dot at the inverted input.

Step2 : I "insert" a conversion on the double line (when I deleted it first, I could not reproduce the behaviour... it only worked when I inserted it). The types should now be ok, without coercion dots.

Step3 : I save my VI... The coercion dot disappeared. (Same effect when I clicked on "run")

It seems that when we "insert" the conversion, LabView does not update the coercion dots... however, it is not forgotten, as they are updated as soon as we save or run the VI ...

 

Aurelie

Download All
Message 4 of 6
(2,835 Views)

What we have here is a somehow inconsistant behavior regarding type checks of inputs of the compound arithmetics block. Obviously, some checkes are done during editing, some only occur during compilation.

 

When are checks made for all inputs of the compound arithmetic during editing:

- Connecting a new wire

- Modifying compound arithmetics itself (invert, add/remove input, change mode, ...)

 

Checks made only during compilation of the VI:

- Modification of existing wires (insert type cast)

 

This later behavior btw matches the "constant folding" check of the compiler, which is only done during compilation.

 

When does the VI compile?

- Running it

- Saving it (and compiled code included in the VI-file)

- Force Compile (Press Ctrl+Click Run Button with mouse)

 

So all in all, it is arguable if this is a cosmetic misbehavior. For my part, i wouldn't even bother on that since only the compiled code is relevant. So looking for coercion dots is best done on compiled versions of the code rather than any "uncompiled one".

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 6
(2,827 Views)

I had thought of trying the Ctrl-Run button trick later after my last post... That's what happens when you stop practicing the fundamentals for a while.

Repeat 100 times: when in doubt, Ctrl-Run button.

Message 6 of 6
(2,801 Views)