NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create an ActiveX/COM object

I wish to use an ActiveX/COM object but cannot figure out how to create it.

 

I have:

  • added an ActiveX/COM adapter Action step 
  • In Step Settings, I chose the server from the Automation Server drop down
  • I chose the class from the Object Class dropdown

 

From here, I am lost.  I thought I had to create an object and assign it to an Object Reference variable.  From there I could use the variable to set properties and call methods.  I do not understand how to create the object and assign it to a variable.

 

I see the Create Object check box but am not sure how that might help.

 

What do I choose from the 'action' dropdown (Do Not Call, Call Method...)?

 

Lastly, the analyzer gives me an error saying it "Attempted to load a module for step whose module has not yet been specified."  Am I supposed to tell TestStand where the file is?  

 

0 Kudos
Message 1 of 3
(2,271 Views)

It would be easier to help with some actual code. But for now maybe review TS examples. In the Overriding SequenceFilePostStepRuntimeError Callback example you can see how to set properties or call methods on TS automation server.

 

For a good example on how to implement this, refer to the Overriding SequenceFilePostStepRuntimeError Callback example which should be located by default in 

<TestStand Public>\Examples\Fundamentals\Overriding Engine Callbacks\ 

Note: In TestStand 2013 and previous versions, this example is instead named ErrorHandlerExample.seq and is located in

<TestStand Public>\Examples\Callbacks\PostStepRuntimeErrorCallback\

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
0 Kudos
Message 2 of 3
(2,222 Views)

Thanks for the answer.  However, I did not see where an ActiveX object was created and saved to a variable.

 

After digging around and experimenting, I found the answer.  I will elaborate in case someone has the same issue.

 

To create an ActiveX/COM object and assign it to a variable, you can check the "Create Object" checkbox in Step Settings (Module tab).  This will assign the object to the variable you indicate in the "Object Reference" field.  Of course, you must choose the desired class in the "Object Class" dropdown.  I chose "Do Not Call" in the Call Method/Access Property dropdown.  It is unclear whether this field is important when choosing "Create Object."

 

My confusion was that the step settings do not change at all when creating an object or calling a method or accessing a property.  At least, _I_ find that confusing.

 

I admit that the documentation does describe how to perform all this.  Just hit F1 while in the ActiveX/COM Step Settings.  However, I still find its multiple purposes a bit unintuitive.

 

Message 3 of 3
(2,207 Views)