Skip navigation

Community

Currently Being Moderated

Run a TestStand sequence only if it is not already running

VERSION 2  Click to view document history
Created on: Oct 24, 2011 9:30 PM by Al.B - Last Modified:  Oct 25, 2011 10:02 AM by Al.B

It is fairly easy to call a specified sequence using the TestStand API using the Execution.newThread method:

 

Execution.NewThread ( sequenceFileParam, sequenceNameParam, options, sequenceContextParam = NULL, sequenceArgsParam = NULL)

 

With this method, we provide the sequence file reference and the name of the sequence to run, and TestStand executes the sequence in a new thread. If we call this method on a sequence that is already running, TestStand still creates a new thread.  Many times, this is the desired behavior, but what if we instead want to get the existing thread reference if the specified sequence is already running, rather than creating a second thread?

 

The attached module (written in LabVIEW) demonstrates a method of checking whether a sequence is running, and only creating a new thread in the case that it is not.  The general flow of the module is:

 

  1. get a reference to all threads in the current execution
  2. check the sequence name and sequence file path of each existing thread against the specified values
  3. if the values don't match an existing thread, create a new thread, otherwise, return a reference to the existing thread using the specified sequence

 

1.png

 

a sequence demonstrating how the module works is also attached.

Attachments:
Comments (0)