NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Clone an entire container at runtime

I would like to make an in-memory copy of a container at run time.  I tried using Clone() and then setting the object to the clone, but this does not work.

 

I don't want to have to crawl the object, or use LV to process this.

 

Is there a reasonable way to do something like...

 

Locals.newsubProperty("newContainer",PropValType_Container,False,"",0x01)

Locals.newContainer.[clone/copy,duplicate]("Path to existing container")

0 Kudos
Message 1 of 2
(600 Views)

Hello,

 

I give a try, a get some result using something like:

 

Locals.SetPropertyObject("CloneOfContainer1", PropOption_InsertIfMissing, Locals.Clone("Container1", PropOption_NoOptions))

 

Assuming that Container1 is a container in Locals, this add a clone of Container1 into Locals, named CloneOfContainer1. Perhaps the PropOption_CopyAllFlags may be usefull as argument for the Clone method, but I don't know if it applies to your specific case (see PropertyOptions)

 

I attach my 'exploration' sequence file (TS16).

 

Hope this helps,

0 Kudos
Message 2 of 2
(540 Views)