NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

copy TS container

in my sequence I collect some data into a Local.Result container. I have a lot of sequences, and I plan to collect all of these local containers in an array of containers in StationGlobals. The local containers in each sequence are built up identical.

 

I tried to use the Clone method, but I!m stucking with it. I could use the NewSubProperty method on each element of the container in each element of the StationGlobal array, but I there must me an easy way to copy the container.

 

Any idea?

0 Kudos
Message 1 of 5
(4,216 Views)
Hi,
What are you trying to do this for and when are you going to make use of this data?
For example, your mainsequence has its locals.resultlist which is an array of result containers. If a step is a sequencecall step type then any recorded data goes in to locals.resultlist[x].ts.sequencecall (from memory but you can find the item without a lot of digging) so the mainsequence is already building that array for you.

Thanks
Sacha
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 5
(4,206 Views)

Clone should work. What problems were you having with it?

 

-Doug

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

The problem is, how to do it? Can you provide a small example?

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

I think what you are wanting is something like this:

 

StationGlobals.ResultArray.SetPropertyObjectByOffset(StationGlobals.ResultArray.GetNumElements(), PropOption_InsertElement, Locals.Result.Clone("", PropOption_DoNotShareProperties | PropOption_CopyAllFlags))

 

One caveat to all this is that it sounds like you are trying to re-invent result collection, which is an already built-in feature of TestStand (i.e. That's what Locals.ResultList is for). I would strongly recommend against doing so, unless you have a very good reason. By not using the standard result collection mechanism you will be missing out on a lot of the functionality of TestStand and likely find yourself having to re-invent some of it.

 

Hope this helps,

-Doug

 

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