NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically modify ActiveX/COM-step module settings

Solved!
Go to solution

Would like to modify programmatically ActiveX/COM-step module settings (Automation Server, Object reference, Object class, method/property, parameters-list).

 

Can't find this in context. How this can be modified?

 

 

Thanks!

 

0 Kudos
Message 1 of 2
(2,964 Views)
Solution
Accepted by topic author bestware

Hey bestware,

 

You need to get a reference to the step: RunState.Sequence.Main["MyActiveXStep"]

 

Then you can use that to convert to the ActiveX module: RunState.Sequence.Main["MyActiveXStep"].Module.AsActiveXModule

 

Once you have that you can do whatever you'd like with it.  You can read in the help more about this.  Search for ActiveXModule.

 

You sould see all sorts of properties: MemberType, MemberName, ServerID, ActiveXReferenceExpr.  If you read about them they are refering to the different things you want to set.  For instance the ActiveXReferenceExpr is where you store the Object Reference.  The MemberType is Call Method (1), Get Property(2), Set Property(4) or Don't Call(-1), etc... 

 

So to change the step to be a Get Property step I would do this:

RunState.Sequence.Main["MyActiveXStep"].Module.AsActiveXModule.MemberType = 2

 

To store an Object Reference to Locals.MyObj I would do this:

RunState.Sequence.Main["MyActiveXStep"].Module.AsActiveXModule.ActiveXReferenceExpr = "Locals.MyObj"

 

Hope this gets you pointed in the right direction. 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 2
(2,949 Views)