Does anyone have an example process model that loads a sequence file? The out-of-the-box process models assume the sequence file is already loaded. I want the process model to identify the UUT type and load the appropriate sequence file based on that.
You can dynamically select a sequence to run by choosing to use an expression for the pathname or the sequence. To do this, right click on your Sequence Call step and select Specify Module. Check the box at the top called "Specify Expressions for Pathname and Sequence". This will enable you to load a sequence file based on an expression. For example, if I had a Sequence name based on my UUT Color that is stored in Locals.Color. Then I can use this expression to load the sequence file whose name corresponds to the appropriate UUT color (i.e. blue.seq, green.seq).
To implement this into a process model, you will have to modify the exisiting model. Before you begin, you will want to copy the contents of \Components\NI\Models\TestStandModels to \Components\User\Models\TestStandModels, then modify the models in the \User directory.
Thanks for the reply Bob. I understand what you are suggesting for calling a general sequence, but it seems like there are some other things to do for the MainSequence. The MainSequence callback in the process model looks for "RunState.ProcessModelClient". Also there is a statement titled "Check for Client File" in the Setup section of SinglePass that generates an error if a sequence file has not been loaded. I think I need to make an ActiveX call to Engine.GetSequenceFile( ). There seems to be some other magic done by the Sequence Editor or Operator Interface.
When you load a sequences file the process model is loaded depending on whether its been specified in the sequence file properties. You cant run the process model directly.
Depending on whether you are intending to run sequences from the Operator Interface or just the Sequence editor will depend how best achieve a mechanism to fit your requirements.
Running from the sequence editor. I think your option is to create a sequence that doesn't have a process model, which will provide some sort of selection of sequences to run. Using the explanation provided by Bob, you could then launch your test sequence which will have a process model specfied.
If running from the Operator Interface, you could add code that is similar to the Open Sequence File, but you can put you r on sequence file selection mechanism. Have an new menu item in the File menu or add a button on the front panel. I have some example code for the LabVIEW Operator Interface (TS ver1.0.2), if thats of interest.
A better solution to your question can be accomplised if you have TestStand 2.0.
Within the entry point of a process modle you can set the client sequence using Execution.ClientFile(). This is a new method of TestStand 2.0. It was specifically designed so that you could dynamically set the client sequence within the process model.
Currently the entry points in the default process models (i.e. Test UUTs and Single Pass) are configured to Show Entry Point When Client File Window is Active. This means that you must open and have active a client sequence file before you can execute one of the entry point. You probably do not want this implementation if you are going to set the client file during the entry point execution. To change this you will need to go the sequence properties of your entry point (while the sequence is open select Edit>>Sequence Properties), switch to the Model tab of the entry point's property dialog box, and enable Show Entry Point For All Windows. The entry point will then appear whether or not you have an open sequence file active.
You will need to add at least 3 steps to your entry point sequence that all use the ActiveX Automation Adapter. Remember that MUST disable Record Results for any step you add to the process model. The 3 steps will perform the following tasks: 1) Obtains a sequence file reference of the file that you want to be the client sequence file. You will need to use the Engine.GetSequenceFileEx method. You will need a local variable (ActiveX data type) in which to store the sequence file reference. 2) Set the client sequence file using the Execution.ClientFile property. 3) Close the reference to the client sequence file in the Cleanup step group of your entry point sequence using Engine.ReleaseSequenceFileEx
I am attaching a SequenceModel.seq file (the default process model in TestStand 2.0) in which we have modified the TestUUTs entry point as described above. Note that you'll be prompted to enter the path to your client sequence file. This is a message popup that you can delete and it was added for your review only.