NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting all Executions in Sequence Editor

Hello, I am using TestStand 4.0 defaut Sequence Editor. I want to get all Executions (only their names and count) in TestStand Sequence Editor. How can I do this? Is there any Class in TestStand API, which works like "Executions" in the UI Controls API, containing all of the executions? Thanks!


Message Edited by My NI on 11-16-2007 04:37 PM

Message Edited by My NI on 11-16-2007 04:39 PM
Regards
MY
0 Kudos
Message 1 of 7
(5,331 Views)
The TestStand 4.0 sequence editor uses the ApplicationMgr just like the UIs. Thus you can still access ApplicationMgr.Executions. The trick is getting the reference. Here is how in pseudocode:
 
applicationMgr = (ApplicationMgr)engine.GetInternalOption(InternalOption_ApplicationManager);
 
 
You can do this from anywhere. It is a very useful technique. The application manager gives you a huge amount of programmatic control over the sequence editor and UIs. Note that this does not work prior to 4.0.
 
PS. Don't despair if you don't have an Engine reference in the location you want to do this. The Engine is a per-process singleton. Thus if it has already be created in the current process, you can get a reference to it just by creating it again.
 


Message Edited by James Grey on 11-16-2007 05:36 PM
Message 2 of 7
(5,312 Views)
Hi James, thank you very much. It sounds like a great idea. But how can I create the Engine again? I am using the default SequenceEditor. With your Code I have got a Reference of ApplicationMgr, which has the value "IUnknown".


Message Edited by My NI on 11-18-2007 03:45 PM
Regards
MY
0 Kudos
Message 3 of 7
(5,285 Views)
I have found the help information about InternalOptions Enumeration:

InternalOption_ApplicationManager–(Value: 5) Returns an IUnknown interface to the Application Manager UI control for the current process. Returns a NULL interface if there is not an Application Manager UI control in the current process.

My question is how to use this IUnknown interface? Can anyone please give me some example?
Regards
MY
0 Kudos
Message 4 of 7
(5,263 Views)
Yeah, after some attempt I have got it finally.

Thank you very much JamesSmiley Very Happy
Regards
MY
0 Kudos
Message 5 of 7
(5,259 Views)
What an amazing tool, I love it!!!
Regards
MY
0 Kudos
Message 6 of 7
(5,252 Views)
Here's a screen shot of the settings for an ActiveX step getting the ApplicationMgr reference.
0 Kudos
Message 7 of 7
(4,312 Views)