NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Copy and replace sequences

Hi!
I have a running sequence containing a main loop. Depending on input from user, a given subsequence (in separate file) is called and when it has executed we go back to the main file. From the main loop I have made it possible to run a batch file that copies the whole set of sequence files from a network drive to the local folder.

Problem: The files seem to not always update, meaning when one certain sub file is called it is still unchanged although the network master was edited and saved. All the sequences are set to unload after execution.

Ideas?

/Stefan
0 Kudos
Message 1 of 5
(2,999 Views)
Hi Stefan,

If you already have sequencefiles loaded in your OPerator Interface or the SeqEditor. Before the new ones can be affective you would have to close all the opened sequencefiles and then re load them into your OI or SeqEditor.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 5
(2,979 Views)
Thanks Ray!
Just like I thought. Yet, rookie as I am, I don't know how to actually do it. I am running the "Simple" OI. Can it be done by introducing a step in the sequence calling the copy exe?

/Stefan
0 Kudos
Message 3 of 5
(2,973 Views)

Hello!

 

When programming with the ActiveX API in TestStand you can get object references to the sequence file, sequence, steps, execution and so on that is executing at the moment. By using these references you can close the open sequence file and the re-load them the ordinary way.

 

One of the methods you can use is: SequenceFile.UnloadModules

 

Regards,

Jimmie A.

Applications Engineer, National Instruments

Regards,
Jimmie Adolph
Systems Engineering Manager, National Instruments Northern European Region

0 Kudos
Message 4 of 5
(2,922 Views)
Stefan -
The TestStand engine maintain a cache of the currently loaded files. When the last reference to a file is released the engine unloads the file.  If a file is loaded and displayed by an OI, the OI maintains a reference to the file.  If the file is not displayed in the OI, but an execution has called the file, the execution may hold a cached references to the file and the sequences in the file.
 
Try the following to ensure that all references to a file and its sequences are released to allow TestStand to automatically reload a file:
  1. Ensure that the file is not open in the OI
  2. If an execution is running, the Optimize Non-Reentrant Calls to This Sequence setting for each sequence in the file must be unchecked.  

    Note: instead of doing (2), you should be able to force the execution to release all unexecuting sequence references by calling the method Execution.ClearSequenceDefaultValues (NULL, SeqDefValueScope_ExecutionTree)

Note: To reload a process model or a client sequence file, the additional requirement is you must close any execution that is using or previously used them.

Scott Richardson
0 Kudos
Message 5 of 5
(2,886 Views)