LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

coersion do: one more type def thing

Dear all,

althoug there are already some threads about this i did not find an answer tot he followeing:

why does the coersion dot appear in the middle branch?

coersion.PNG

This VI takes Data from a measurement and from a simulation and based on user settings it forwards one or the other to output 1. I just added outputs 2 and 3 because they dont produce the coersion dot.

thanks  for suggestions on how to fix this!

Download All
0 Kudos
Message 1 of 5
(2,861 Views)

I don't have LV on this computer so I can't see the code, but I'm guessing it's because you typedef'd the array when really it should've been the element that was typedef'd.

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 2 of 5
(2,849 Views)

You don't provide all of the VIs and Controls to answer your question, but I suspect it may be due to the following, shown in the Snippet -- if you have an Array saved as a TypeDef (as is Real Array and Real Array 2, here), then taking the elements (here, of Real Array) and building another Array from it just creates an array, but not an array that matches the TypeDef.  You can check this by holding your mouse over the wire while Help is active -- it will show you the "type" of data in the Wire.  Note that the Type on the wire into the For Loop is Real Array, TypeDef of 1-D Array of Numeric, while the type on the output wire is simply 1-D Array of Numeric.  They are different (in name, only), hence the Coercion Dot.

Array Coercion.png

Bob Schor

Message 3 of 5
(2,848 Views)

I think you both pointed it out such that i understand why it shows the dot.

 

but if so, i cant imagine to manipulate the data and then feed it back to something of the original typedef. or am I wrong with this? What error could be introduced if i dont change the current VI?

 

Thanks!

 

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

You can get rid of the dot by using a shift register. Use the "Replace Array Subset" with index "i" (the loop counter). The indexed tunnels are more intuitive though, so I think it's easier to just let it coerce into the typedef.

Message 5 of 5
(2,815 Views)