NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Change element type of an array of containers (from LabVIEW)

Hi,

 

I have an empty Array of Container type and need to insert an element of a custom data type definition. If I already have an element of the type definition, it is simple to copy that element and insert it as a new element. But inserting a new element to a empty array I need to specify that the element should be of this data type.

Getting the type definition with the Method "GetTypeDefinition" and inserting this as a new value simply "moves" my type definition to the inserted element (which is not suppose to happen). Can't find a method to change data type and seems that none of the property options does the trick to.

 

I just need to do the same as "change type" in the TestStand editor, just inside LabVIEW.

ChangeTypeOfArrayContainerElement.png

 

What did I miss??

 

Thanks

 

Note: Use edit of the step in the attached sequence file. Collapse and expand "Locals" after running the Edit function to see the result.

0 Kudos
Message 1 of 5
(4,751 Views)

Hi,

 

Take a look at these C++ code snipped.

The TS API calls are in LabView the same.

 

screenshot.JPG

 

Hope this helps

 

Juergen

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 2 of 5
(4,715 Views)

Hi Juergen,

 

Thanks for the reply. My skill within C++ is not worth talking about, but as far as I can see, you take the prototype of the array, clone it and add it to the array. That’s not what I want to do. I want to have the element type referring to the type definition, so if I for some reason change the type definition, my element changes to.

 

Another thing, I have an empty array of containers, meaning it does not make sense to get ArrayElementPrototype as the prototype for the array haven’t been defined yet.

 

Please tell me if I am wrong.

 

Vagn

0 Kudos
Message 3 of 5
(4,705 Views)

Hi,

 

When i am writing my stuff i was not able to open your SequenceFile. Now i was.

My upper example is only working for arrays of Types. It is also working on empty Arrays, too.

 

Screenshot1.JPG

 

Screenshot2.JPG

 

Please tell me why you do not use an array of types ?

 

Regards

 

Juergen

 

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 5
(4,692 Views)

Hi,

 

It is a hidden TS property, defined as an "array of container" type, I am updating. I've just made the example to simplify my problem. In TS the data type use itself as nested structure. I thought it was a minor detail to change the type but guess not.

 

Regards

 

Vagn

0 Kudos
Message 5 of 5
(4,681 Views)