02-08-2010 02:49 PM
Hi all,
My example vi converts a 50 elements cluster to an erray, modifies an element in the array, converts the array back to a cluster, and update the original array through an local variable. I am getting a coercion dot on my local variable. Can anyone explain to me why is that? Thanks!
Yik
02-08-2010 02:52 PM
If you hover the wire after the 'Array to Cluster' node you will see in the context display that the elements are named 'Alarm_CMD Parameters[x]'
Since your local has different names there is a conversion, this should however not cost any CPU cycles.
But I doubt that this is the most versatile and flexible way to manage this.
Ton
02-08-2010 03:05 PM - edited 02-08-2010 03:05 PM
02-08-2010 03:20 PM
02-08-2010 03:39 PM - edited 02-08-2010 03:40 PM
You might be able to restructure your code so you don't need the dot. Also In general you should avoid local variables, but you may have a valid use here. I can't make suggestions without more info about what you're trying to do. You could also ignore the dot, since it's just a warning (maybe put a label next to it to remind yourself that you checked that it's fine).
Two other options I wouldn't recommend are using a typecast to do explicitly what the type cast is doing implicitly (but this can also hide legimate type errors since type cast is very liberal about what it converts around). Variant to Data would also work but that adds a run time cost but at least it spits out an error at run time if you do something really off.
02-08-2010 03:47 PM