LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extra element in cluster when using Array2Cluster?

I hope someone can help me out. I've just noticed some curious
behavior that I can't explain, or find any references to on-line.

When I convert a 1-D array (say of I32s) which has length N, to a
cluster I find that the cluster has N+1 elements, the last of which is
always 0. Am I missing something here?

I'm using LabVIEW 6.0.2 on NT.

Thanks in advance!
0 Kudos
Message 1 of 4
(1,405 Views)
Array to cluster function always returns a fix (but settable with the function rmb-menu) number of elements in the output cluster. If the array is too large, elements are stripped to the cluster length. If it is too short, missing elements are replaced with the default-default value of the datatype in the cluster to fill it to its length.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 4
(1,405 Views)
"Scott Miller" schrieb im Newsbeitrag
news:da8c9793.0203211823.617215c8@posting.google.com...
> I hope someone can help me out. I've just noticed some curious
> behavior that I can't explain, or find any references to on-line.
>
> When I convert a 1-D array (say of I32s) which has length N, to a
> cluster I find that the cluster has N+1 elements, the last of which is
> always 0. Am I missing something here?
>
> I'm using LabVIEW 6.0.2 on NT.
>
> Thanks in advance!

Hi,

you have to set the cluster-size for converting an array into a cluster.
Open the context-menu of array2cluster function, select cluster-size and
enter your needed number of elements.

Henrik
0 Kudos
Message 3 of 4
(1,405 Views)
Thanks for the guidance Jean-Pierre and Henrik!

I guess I was working too many hours straight when I came across this
problem, because I completely misread it, and then jotted off a post
before really seeing what I was looking at. Stupid me!

However, I strongly feel that the need to explicitly specify the
cluster size to convert to is a real LV deficiency. Given that I was
converting a constant array, LV had all the foreknowledge to size the
cluster automatically. LV usually handles polymorphism very smoothly,
so I feel that it should here as well.

As far as the case of converting an array control, well that's more
complicated since the size isn't known until run-time. In that case I
would say that you should have to do an explicit specification.

Pr
oper polymorphic sizing of converted clusters would be a great
feature in future revisions of LV. Is that too much to ask?
0 Kudos
Message 4 of 4
(1,405 Views)