LabVIEW Idea Exchange

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

Array To Cluster Function, add Type to Convert Cluster

Array To Cluster Function, add Type to Convert Cluster

 

I rarely use this function, but when I do I always end up using Variant to Data function for my Cluster Type.

So I would like to add a Type terminal to convert cluster type.

 

111.png


If Type terminal is unwired, this function work as it in current version.

 

If it is wired then it will convert to cluster type, and further it can also be used to define cluster size. So this way we can adjust cluster size dynamically if cluster definition changed.

 

Thanks,

 

222.png

16 Comments
Darin.K
Trusted Enthusiast
Coerce To Type does not support clusters (yet?).
JackDunaway
Trusted Enthusiast

@David S. wrote:

Jack, would using the secret "Coerce to Type" primitive work in place of the Type Cast in your example? 


This causes a compile-time type check error, and I agree with (and rely on) this behavior of Coerce to Type. Beats the heck out of a run-time error!

 

TypeCheckFail.png

 

 

Darin.K
Trusted Enthusiast
Please describe the runtime error you are afraid of in that case.
JackDunaway
Trusted Enthusiast

@Darin.K wrote:

 

Please describe the runtime error you are afraid of in that case.

Yeah, "runtime error" is a poor wording choice - "runtime failure" better describes potentially garbled/unexpected results due to a design-time Typecast programming error. (And "runtime failure" is really translated as "Unit Testing FTW!")

 

Balint
Member

Type Cast works on numeric data, however does not do it on array on strings.  Huh, I really needed the type control on the A2C function.  2D string arrays must put in database tables . And how? Not very nice. Balint.  

Darren
Proven Zealot