USBHub2x4 Example with National Instruments TestStand

2016 April 12

 

We've recently been getting questions regarding the use of the Acroname USBHub2x4 from within National Instruments TestStand test management software. So we put together two example projects which wraps the BrainStem2 library and provides the critical interfaces you need to do basic things with the USBHub2x4, like enabling and disabling a downstream port.

From NI: What is TestStand?

TestStand is industry-standard test management software that helps test and validation engineers build and deploy automated test systems faster. TestStand includes a ready-to-run test sequence engine that supports multiple test code languages, flexible result reporting, and parallel/multithreaded test.

Basically:

The project contains a VisualStudio2013 project which builds TS_USBHub2x4.dll, and that .dll is used by TestStands C/C++ DLL adapter to create sequenced actions. 

  • Example #1: NI-TestStand_USBHub2x4:

This example project provides interface functions to connect to a single USBHub2x4 via a serial number, as well as functions for the enabling and disabling of the downstream USB channels. 

  • Example #2: NI-TestStand_MultiUSBHub2x4:

This example project provides interface functions to connect to multiple USBHub2x4's via an array of serial numbers, as well as functions for the enabling and disabling of downstream USB channels based on a serial number.

You'll need:

How To Start:

  1. There is a README.txt file, read that.
  2. copy the lib folder from the BrainStem Development Kit into the NI-TestStand-USBHub2x4 example folder.
  3. Build the VisualStudio project for the given architecture of NI TestStand you have installed (i.e. x86/x64)
  4. Open the sequence file included in the project.
  5. Edit the SerialNumber/s local variable wihin TestStand so that it matches the serial number/s of your USBHub2x4 device. 
    • To find your serial number, run Updater.exe from the command line; i.e. "C:\path\to\bin\Updater.exe -D 
  6. Run the sequence file with your USBHub plugged in, and a device plugged in to channel 1. You should see the channel power off and then back on.

Please contact us if you have questions as you try out the example.