LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building a cluster from 2 1D matrixes

Hello everyone,

 

    As mentioned in the title I am trying to build a cluster from two one dimensioned matrixes of the same size, one containing the name and the other containing the values have tried using the array to cluster function and modifying the names of the elements pragmatically but I get the 1073 error code " This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode."Is there a way to do this or am I trying in vain?

 

Thanks.

0 Kudos
Message 1 of 6
(3,173 Views)

Hi fixxer,

 

as long as you try this in a running application, you're trying in vain...

 

The names are part of the cluster datatype definition. Datatypes can only be changed in edit mode as LV needs to recompile all structures accessing that datatype...

But you can open a different VI using the VI server, change a cluster in that VI and save the VI afterwards. The different VI only has to be in edit mode Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,163 Views)

You cannot change the cluster at run-time because that's effectively asking an application to change itself, and this is not allowed.

 

A cluster will be of fixed size. Is there some reason why you're trying to change the arrays it into a cluster? Where is this data going?

 

Also, the sequence frame is completely unnecessary in the code.

0 Kudos
Message 3 of 6
(3,158 Views)

I am trying to change the arrays into a cluster because I have to compare some of the values in the matrix to other defined values later on so I thought it would be easier to do that using the unbundle by name function rather than using the array subset function or delete from array one.(The matrixes are composed of 120 elements each and I have to retrieve 32 non-successive elements from it for later comparison).

0 Kudos
Message 4 of 6
(3,152 Views)

Well, yes, Unbundle By Name would be easier, but unless you basically create a new VI as Gerd alluded to, you can't do what you want to do. As for using Array Subset or Delete From Array ... what's wrong with Index Array? You can index out the elements you want using a for-loop:

0 Kudos
Message 5 of 6
(3,148 Views)

Yes haven't really thought of that.Thanks.I'll try it.

0 Kudos
Message 6 of 6
(3,133 Views)