NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Copying sequence from one sequence file to another programmatically.

How to copy sequence from one sequence file to another programmatically? Since SequenceFile.InsertSequence() method "Never insert a sequence into a sequence file when the sequence resides in another sequence file.", it is very difficult to copy all contents of one sequence into the blank one. Is another way exists?
0 Kudos
Message 1 of 7

You need to clone the sequences into your new sequence file.
Attached is an example of of my process model sequence file that uses this method. (look at the Sequence CloneSequences).

In my sequence, I get the name of each of the selected sequences and this name I get a reference to that sequence. I then create a clone to that sequence then insert (InsertSequence) this into my new sequence file.

Hope this helps
Ray Farmer
Message 2 of 7

Hi Ray...

In the CloneSequences, in clonesequence step, Why is the look up string arguement empty. Shouldnt it contain the name of the sequence.

I got error since i tried to specify the name of the sequence. Now I have corrected it. 

Message 3 of 7



The reason is because a reference to the actual sequence has been obtained.

If you were using say the SequenceContext then the lookup string will contain the full lookup string to the sequence eg "RunState.SequenceFile.Data.Seq["SubSequence"]"



Ray Farmer

Ray Farmer
Message 4 of 7

Hello Ray,


I am trying to do a similar thing using Labview. First, I get the reference of the sequence I want to clone by using the "GetSequenceByName" method, then I use the Sequence.AsPropertyObject method to get a ref of the sequence, then PropertyObject.Clone method to get the ref of the new cloned sequence. The next step is what I am having problems with. When I use the SequenceFile class, I only see "InsertSequenceEx" method in it, which will not accept the Clone output ref as an input reference to "SequenceToInsert". I get the following error "The data types do not match, the type of source is void, the type of the sink is double".


I appreciate any help on this.




0 Kudos
Message 5 of 7

Hi Sam,


See if this helps. The problem is with your code is you have convert back the property object reference to sequence.



Message 6 of 7

Hello LordSathish,


Thanks for the help. I was able to clone a specific sequence in a sequence file. Attached is my final working VI .




0 Kudos
Message 7 of 7