NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get an automation reference in TestStand?

I am trying to connect to an OPC server in TestStand and cannot figure out how to get a reference to the server. I can call the server (implemented as an ActiveX control), but I need to be able to get references to pass to other functions in the server.

In LabVIEW, I call the Automation Open vi with an ActiveX reference. The reference gets its value from right clicking the reference and clicking "Select ActiveX Class" from the drop down list. How do I do this same type of operation in TestStand?
0 Kudos
Message 1 of 5
(3,542 Views)
Hello Lars -

If you're trying to connect to an OPC server for the first time (i.e. you don't have a reference to it yet in TestStand) your only option may be to 'create new' from the TestStand ActiveX adapter. The first field (where you would usually have your reference to an object can either be left blank or simply hold a local variable (of type reference) not used by anyone else, then select the server (your OPC server) and class, and enable the checkbox for 'create new'. The common thing to put in the remote host field is \\localhost. If you provide an unused local variable for the reference, TestStand will store a reference to the activated server in this variable.

If you have already tried this and it returns errors or does not behave as expected
, we may need more information about your OPC server and what it supports.

--Regards

Elaine R.
National Instruments
http://www.ni.com/support
0 Kudos
Message 2 of 5
(3,542 Views)
Hi Elaine,

I tried your answer with two different servers, one our proprietary server, the other from Applicom for their DeviceNet card. With both servers, I get a "Class not registered" error. I also tried with DataSocket and did not get the error. Is registration something NI's software does or is it a Windows function? How can I register the classes?

Thanks!
Larry
0 Kudos
Message 3 of 5
(3,542 Views)
Hello Larry -

That is very mysterious. So long as you're certain you're working with ActiveX servers and not ActiveX controls (TestStand only talks with servers) you shouldn't have a problem opening up a connection. Since you're able to do so from LabVIEW, and you're able to see the name of the item you want in the list (whether it causes errors or not) it's a pretty good bet that you can do it from TestStand.

The Windows function you're probably going to need to look into is called regsvr32 (or some variation there of) it can be executed from the Start>>Run window of your Windows OS although the exact name may change if you're working in Win98. To call this function you're going to need the absolute path to the dll/exe that is your Active
X server.


I hope this helps.

--Regards

Elaine R.
National Instruments
http://www.ni.com/support
0 Kudos
Message 4 of 5
(3,542 Views)

For your information, there is a new TestStand Add-on "OPC DA Connect" which adds a StepType Palette dedicated to OPC Data Access.

You can configure each step by browsing the OPC servers on your network and browsing variables within these servers.

This toolkit has a free deployment licence.

 

Hoping this helps.

Jean-Louis SCHRICKE
CTA - Certified TestStand Architect (2008 - 2022)
CTD - Certified TestStand Developer (2004 & 2007)
CLD - Certified LabVIEW Developer (2003 & 2005)

0 Kudos
Message 5 of 5
(2,858 Views)