11-24-2010 05:41 AM
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.
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.
11-26-2010 03:52 PM - edited 11-26-2010 03:59 PM
11-27-2010 05:25 PM
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
11-29-2010 01:28 AM
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.
Please tell me why you do not use an array of types ?
Regards
Juergen
11-29-2010 10:07 AM
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