Programming with the TestStand API in Microsoft Visual Basic .NET

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

In Microsoft Visual Basic .NET, you can access the TestStand ActiveX API by first adding the NationalInstruments.TestStand.Interop.API component as a reference in a project.

TestStand installs .NET interop assemblies for the TestStand API in the <TestStand>\API\DotNet\Assemblies directory and in the Global Assembly Cache (GAC). The interop assemblies support the current and earlier versions of the TestStand API, as shown in the following table.

TestStand API Version .NET CLR Version
TestStand 2012 or later .NET CLR 4.0 or later
TestStand versions later than 3.5 and earlier than 2012 .NET CLR 2.0 or later
TestStand 3.5 or earlier .NET CLR 1.1 or later

To add a reference to the TestStand 4.0 or later API assembly in Visual Studio, select the project in the Solution Explorer. Select Project»Add Reference to launch the Reference Manager dialog box. Click Assemblies»Extensions and select the TestStand <Version> <APIName> Interop Assembly component from the list. Click OK to close the Reference Manager dialog box. Then, right-click the project and select Properties, click the References tab, and select the new reference. In the Properties panel, change the Embed Interop Types setting to False. If this setting is True, using any constants such as PropertyOptions in your code will result in compiler errors

If the TestStand Interop assemblies do not appear in the Reference Manager dialog box, exit all running copies of Visual Studio, launch the TestStand Version Selector, select the current version of TestStand, and click the Make Active button.

After you add the NationalInstruments.TestStand.Interop.API component as a reference in a project, add the following directive at the top of the source file:

Imports NationalInstruments.TestStand.Interop.API

All TestStand classes, methods, and properties are available in the Microsoft Visual Studio object browser and are accessible from the Visual Basic .NET source code. Help text for classes, methods, and properties appears in Microsoft IntelliSense.

When you create a new project in a supported version of Visual Studio, you must set Project Properties»Build»Platform Target to x86 so the project can access the TestStand API and User Interface (UI) Controls on 64-bit versions of Microsoft Windows.


See Also

.NET Adapter

WAS THIS ARTICLE HELPFUL?

Not Helpful