Session per Instrument (TSM)
- Updated2025-06-26
- 3 minute(s) read
This example demonstrates how to define instruments that TSM does not natively support, how to create API for the instruments, and how to use the API in a code module for a TSM test program. Each instrument in this example shares session data across the entire instrument, similar to an NI-HSDIO instrument. The code module opens one session per instrument.
Example File Locations | <TestStand Public> \Examples\NI_SemiconductorModule\Custom Instruments\Session per Instrument\LabVIEW\Session per Instrument.seq |
Highlighted Features |
|
Major API |
TSM Code Module API |
Prerequisites |
|
Complete the following steps to use this example.
- Complete the following steps to review the
pin map file
associated with the test program.
- Select Edit Pin Map
File
button on the TSM toolbar to open the <TestStand Public>\Examples\NI_SemiconductorModule\Custom Instruments\Session per Instrument\LabVIEW\Session per Instrument.pinmap file in the Pin Map Editor. The pin map file defines the following information:
- Two custom instruments named dev1 and dev2, respectively, each with an instrumentTypeId attribute value of SessionPerInstrument and eight available channels contained in a single channel group
- Four DUT pinsDUT pins named A, B, C, and D, respectively
- Four sites on the tester
- A series of connections for each site, in which each connection specifies a DUT pin, a site number, an instrument, and an instrument channel
or click the
- Select Edit Pin Map
File
- Complete the following steps to review the code module that
communicates with the custom instruments.
- Click the LabVIEW Module tab on the Step Settings pane. The Project Path control specifies a file path to the <TestStand Public>\Examples\NI_SemiconductorModule\Custom Instruments\Session per Instrument\LabVIEW\Session per Instrument.lvproj LabVIEW project file.
- Click the Edit LabVIEW
Project
button, located to the right of the Project Path control, to open Session per Instrument.lvproj in LabVIEW.
- In the Project Explorer window, expand the API folder.
- Open and review the following VIs that
correspond to operations TSM performs on the pin map:
VI Description Session per Instrument - Get All Instrument Names.vi Obtains all instruments of the SessionPerInstrument instrument type, as defined in the pin map file, so that the initialization code module can open sessions and store them in the SemiconductorModuleContext object. Session per Instrument - Get All Sessions.vi Obtains all stored sessions so that the clean up code module can close the sessions that were previously opened and stored in the SemiconductorModuleContext object. Session per Instrument - Pins To Sessions.vi Queries the DUT pins and returns the associated instruments and channel lists associated with a SemiconductorModuleContext object. Session per Instrument - Store Instrument Session.vi Stores the sessions in the SemiconductorModuleContext object so that other parts of the test program can access the sessions.
- In TestStand, select the ProcessSetup sequence on the Sequences pane. The step in this sequence initializes the instrument sessions.
- On the Sequences pane, select the ProcessCleanup sequence. The step in this sequence closes the instrument sessions.
- Click the Start Lot
button on the TSM toolbar to run the test program.