NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get sequence step info into LabVIEW

Solved!
Go to solution

I'm relatively new at TestStand development, particularly creating operator interfaces. I started with the simple OI example in LabVIEW that ships with TestStand. I've made some mods just fine, but I need to extract data from the sequence to send to remote read consoles that are not TestStand OI's, they are just LabVIEW ui's that display test information for engineers. 

 

Here's what I'm trying to do. For a sequence that is running, every time a step occurs I want to pull into LabVIEW information about that step. Particularly

  • Step name
  • Step number

Additionally, I need to know how many total steps there are in the sequence. What the users will see on the read console is "Step X or Y" and "step name". 

 

I've been reading about the TestStand API and trying out properties and invokes...there is just way to much there. What would be the easiest way to extract this info at the start of each step?

0 Kudos
Message 1 of 8
(3,812 Views)
Solution
Accepted by topic author wrkcrw00

Hi wrkcrw00

If you have a single sequence that you want to do this for, create a "SequenceFilePostStep" Engine Callback in your sequence file.  If you have multiple sequences create a "ProcessModelPostStep" in the Process Model sequence they use.

 

Assuming you only want to work with 1 sequence file.  The "SequenceFilePostStep" will be called after every step in your sequence file has been run.  Inside your SequenceFilePostStep add a step to communicate with the VI that is displaying your sequence information.  NOTE:  you probably don't want to call your display VI each time, you will need some sort of mechanism to pass the new data to it each time the SequenceFilePostStep is called.

 

To pass information to your display VI:

  1. you can get the name of the last step executed using RunState.Caller.Step.Name

The next two assume all of your sequence steps are in Main (Not Setup or Cleanup).  NOTE:  You can do similar things for Setup and Cleanup.

 

  1. you can get the number of the last step executed using (RunState.Caller.RunState.StepIndex + 1)
  2. you can get the total number of steps using GetNumElements(RunState.Caller.RunState.Sequence.Main)

Hope this helps

 

Steve

 

0 Kudos
Message 2 of 8
(3,786 Views)

This is good...thanks.

 

I made a copy of the built in process models and am adding a ProcessModelPostStep that will get the desired step information and pass it into a vi that will package it and send it off to the parent vi for distribution to the consoles.

 

I need to get a queue ref or user event ref into the TestStand engine so I can send this data back to my parent vi (the parent calls the TS engine). What's the best way to do that?

0 Kudos
Message 3 of 8
(3,769 Views)

So even better, I've abandoned the vi inside the ProcessModelPostStep and have inserted a function that posts a UIMsg with the desired step data. The UI will handle that UIMsg, parse the data on each call and can send it off to my read consoles.

0 Kudos
Message 4 of 8
(3,764 Views)

My changes to the process model work in the development environment, but don't seem to in the runtime engine. I set the station process model to my new .seq file that adds the ProcessModelPostStep callback. For debug, I just dropped in a user dialog box in the ProcessModelPostStep to see that it was working. When I run a simple sequence in the dev environment, it works just fine. When I run that same sequence from the SimpleUI, the sequence executes like it should but the dialog box doesn't pop up and I don't get the UIMsg data I would expect from the callback. 

 

Is there something about the runtime or the TestStand Simple UI that I need to configure to use the right process model?

 

I created a UIMsg callback vi in the Simple UI that would display the values on the UI (I'll worry about pushing them to read consoles later). 

0 Kudos
Message 5 of 8
(3,758 Views)

If you select Edit->Sequence File Properties, is your sequence configured to use the Station Model?

 

Sequence Properties.png

0 Kudos
Message 6 of 8
(3,743 Views)

Yes, the sequence file properties are set to use station model. I also tried pointing directly at the process model, but no change. 

 

As an added test, I copied and renamed the original SequentialModel.seq to a safe place then added the ProcessModelPostStep to the SequentialModel.seq in the default directory <TestStand 2016>/Components/Models/TestStandModels. The step still did not happen.

 

Ahhh, in writing this I discover the problem, although I don't have the solution quite yet. The sequence is being run without a process model. As with the data I want to send to remote consoles, I also send load, run, clear, and other commands from a console that is not the Simple UI. I have a user event that fires to run the sequence.The invoke node I'm calling to run the sequence apparently runs it without a process model. 

 

image.png

image.png

 

I need to figure out how to run the sequence with the process model.

0 Kudos
Message 7 of 8
(3,741 Views)

Any guidance on how to start the execution of a sequence WITH a process model (using the stations default model)?

0 Kudos
Message 8 of 8
(3,731 Views)