LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a custom control/typdef to NOT coerce

Solved!
Go to solution

I've got a few different custom controls / typedefs that are clusters of strings.  Each is very specifically different.  However, many of them have the same number of elements in them (example custom control/typedef with 4 string elements), and LabVIEW keeps wanting to allow those two clusters to automatically coerce from one to another.  (even though the names of the elements are different -- it seems to only care about the types and numbers of the elements).

 

What can I do to prevent the automatic coercion from one typedef to another when I don't want it to happen?

0 Kudos
Message 1 of 4
(2,667 Views)

"What can I do to prevent the automatic coercion ...."

 

Thinking out-loud....

 

Edit them such that they do not have the same number and types of elements?

 

As you indicated LV allows them to coerce and in many cases that is good. The only way to stop it is to do something to prevent the coercion.

 

Alternatively...

 

Show "Warnings"and check the warning list regularly.

 

OR

 

Use LVOOP and rely on the private scope of the data.

 

Probably not the answer you wanted to read but it all I can offer.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(2,659 Views)
Solution
Accepted by topic author warren_scott

I think LVOOP is a better suggestion, but if you don't want to go down that route, you could add a unique control to each cluster. There's a trick to creating a unique control based on a wrapping it in a datalog file reference: http://forums.ni.com/t5/LabVIEW/Creating-own-datatypes-handles/td-p/869780 Create a separate one of those for each cluster and add that new type as an element of the corresponding cluster and I think you'll force the wire to break when the types aren't compatible.

0 Kudos
Message 3 of 4
(2,637 Views)

Thanks!  That Datalog File Refnum wrapper is going to do the trick.

0 Kudos
Message 4 of 4
(2,613 Views)