01-18-2019 06:22 AM
I am having one container it has complex data like cluster.
It has byte 1 , byte 2, byte 3 ..and so on upto 8.
In one test case it is expected that there will no response from DUT.
And the received container remains uninitialized. like uninitialized array.
In that scenario I want to set expected container container as uninitialized container.
but when I create a local variable in teststand for that container it shall have some numeric value like '0'.
I know for array we can set as locals.arrData={},
Can anyone tell me how to set for container?
01-21-2019 12:06 PM
Your question doesn't make sense. Because arrays are just pointers to memory it makes sense that they can be empty. Containers are a whole different deal. When a container is allocated it creates memory space for all of its members. In your case some bytes. Something has to be in the memory space. So they just use the default values of the datatype when the space is allocated.
If you want to change it to an empty container then you are literally changing the datatype. Unlike an array where you are not changing the data type but rather just pointing to some empty space.
Any reason you can't just use an Array?
02-23-2024 03:46 PM
For anyone stumbling across this question in the future, you can clear a container with a while loop in Teststand.
Let's say you have a FileGlobal called myContainer that you want to empty out.
FileGlobals.GetNumSubProperties("myContainer") > 0
FileGlobals.DeleteNthSubProperty("myContainer",0,0)
In my example, a FileGlobal may not be the best place for the container to live, it may make more sense to be in a Local.