NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect the .net object (button) to Single Pass execution of TestStand

Solved!
Go to solution

Hi - I am trying to use the .net button instead of the teststand activex. Is there any way that I can connect the execution command "single pass" of teststand to a regular .net button?

 

I did try  the following codes but its throwing me an error:

 

axExecutionViewMgr.GetCommand(CommandKinds.CommandKind_RunEntryPoint,1);

 

and..

 

axExecutionViewMgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set,1);

 

BOTH of the codes,throw COMException error, index out of range.

 

 

 

Any ideas??? 

 

 

 

0 Kudos
Message 1 of 6
(4,236 Views)

In the Sequence Properties for both the Single Pass and Test UUTs entry points, they are not configured to appear for execution windows because they start new executions, rather than operate on existing executions. It is likely that your model doesn't have any entry points that apply to existing executions, thus the index out of range error.

 

You need to get the command via the SequenceFileViewMgr instead.

Message Edited by James Grey on 05-07-2010 09:57 AM
0 Kudos
Message 2 of 6
(4,234 Views)

I tried your suggestion.

 

axSequenceFileViewMgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set, 1); 

 

Didn't throw any error but, it didn't do anything. What am I missing?

 

 

0 Kudos
Message 3 of 6
(4,231 Views)
Solution
Accepted by topic author -mbda-

I think I got it.

I added the ff codes:

 

Command command = axSequenceFileViewMgr.GetCommand(CommandKinds.CommandKind_ExecutionEntryPoints_Set, 1);

command.Execute(true);

 

..so far so good..  and let me know if there is anything I should watch for by going on this route.

 

 

Thanks! 

 

 

0 Kudos
Message 4 of 6
(4,229 Views)

Other thing to consider:

 

The returned Command object has properties that you might want to apply to your .net button, such as Visible and Enabled. You might even want to use the label that Command.GetDisplayName returns.

 

The state of these properties might change, such as when you switch between having a file loaded or not, or if you switch process models. In general, determining what are all the changes that could effect the properties of a specific Command is not trivial.

 

The easiest way to determine if a change has occurred that would warrant updating your .net control's properties from the Command is to connect the exact same command to a hidden TestStand button and handle that button's ConnectionActivity event. In the event, you would get the relevant Command properties and re-apply them to your corresponding .net button.

Message Edited by James Grey on 05-07-2010 10:23 AM
Message 5 of 6
(4,228 Views)

Very good information. Thanks James!

0 Kudos
Message 6 of 6
(4,223 Views)