NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Run selected steps in TestStand using C#.NET

Hi,
 Please explain me "How to run selected steps in a sequence of sequence file". It's greate if you provide explaination with bit of source code. It's very urgent.
 
Thank you,
 
regards
RKK
0 Kudos
Message 1 of 5
(4,943 Views)

RKK,

I'd love to help you, but there's simply not enough information to go on here.

From your subject, I gather that you are creating a C# operator interface.  However, there are still many questions that you have not answered.

  1. If you are not creating an UI, then in the SequenceEditor you can simply right-click and run selected steps?  Are you trying to replicate this functionality in a UI?
  2. Are you using the UIControls?  That is, do you want to run selected steps from an existing SequenceViewManger?
  3. If you are not using UI controls, then how are you interacting with your sequencefile?  Specifically, what objects do you have?  What information about that sequence do you have?
  4. Have you done any searches at NI.com? or through the TestStand help? 

Searching the TestStand help for "runselected" turned up a few methods of the UI controls that you can use.  From there, there was some discussion of interactive executions.  If you search for "interactive execution TestStand" you will get a link to this page in the TestStand Help http://zone.ni.com/reference/en-XX/help/370052F-01/tsapiref/app_starting_an_interactive_execution/.  Notice that the interactive arguments can be used to only run a subset of the steps in a sequence.

However, none of this may have any bearing on what you are trying to do!  You simply have not given enough information to provide help.  Please when posting, try to give a better background of what you are trying to do, what you currently have implemented, and what guidance you need.  Asking "how do I run selected steps" is like asking "how do I build a road" when we don't know the starting point, the destination, the materials, or the path!

0 Kudos
Message 2 of 5
(4,939 Views)

Hi,

Thank you for your suggestions.

No, I am not using UIControls here.I would like to run selected steps(Passing index) through programmatic.

I done the following steps to run the sequence file.

1. Initiate Engine Object

2. Get Sequence file object

3. Get Sequence object

4.Get execution object through engine object by pass Sequence file ,sequence name,and other parameters.

here I would like to execute the steps individually by pass index of that.

Thank you

regards

RKK

0 Kudos
Message 3 of 5
(4,931 Views)

Hi RKK,

Are you aware that National Instruments provides a full featured C# operator interface?  This OI source code is available at  C:\Program Files\National Instruments\TestStand 4.0\UserInterfaces\NI\Full-Featured\CSharp.  The OI compiled executable is available at Start » Programs » TestStand 4.0 » User Interface » C# » Operator Mode. 

Using the TestStand UI Controls is highly recommended as they provide a majority of the functionality needed automatically.  For example, the Application Execution Manager UI Control processes the execution as it is running and displays the current execution status in realtime as it is occurring.  To do this, it handles all of the UI Messages that are fired by the TestStand Engine that correlate to the execution of each step. 

These invisible manager controls expose many different commonly used methods for TestStand development, in fact there is an additional API for those controls.  The API for manager controls can be found here. The manager controls simplify tasks that can be complex and involved when only using the TestStand API.  One of the manager controls is the Execution View Manager control.  When using the Execution View Manager, the RunSelectedSteps method interactively executes the selected steps within the current execution.  This method is available when using the Execution View Manager. More information regarding the RunSelectedSteps method can be found here

Based on the information you provided, the Execution View Manager is currently not available in your application and therefore you would have to create this functionality manually. 

Jessica
National Instruments
Product Support Engineer
0 Kudos
Message 4 of 5
(4,886 Views)
Hi RKK,

To answer your question further, if you are wishing to run selected steps without using UI and manager controls, you will have to complete the following steps.
 
First, if you do not have the indices of the steps of the sequence that you wish to run, then you can use the GetStepIndex method to obtain them.  You will use the NewExecution method to run the selected steps.  When you call the Engine.NewExecution method to create an interactive execution, use an InteractiveArgs object to pass information about the current state of the user interface.

You can then use the NewInteractiveArgs to create an InteractiveArgs  object.  You will then need to set the properties of that object.  To set a value for NumSteps, use the AddStepIndex method to add all of the step indices you obtained using the GetStepIndex method.  Now you can call the Engine.NewExecution method and pass it your InteractiveArgs object. 
 
This will produce the same behavior as using the RunSelectedSteps method discussed in the previous post.
Jessica
National Instruments
Product Support Engineer
0 Kudos
Message 5 of 5
(4,868 Views)