Skip to main content

NI TestStand Semiconductor Module Python API

Project description

Build Status

nitsm-python

Write code modules with the TestStand Semiconductor Module in python.

Note to End Users

This project is intended for use in automated device validation. Our primary focus is to provide a pythonic approach to automated testing with TestStand and TSM. More emphasis has been placed on simplicity and usability than execution time.

Python Version Support

nitsm supports python versions 3.6, 3.7, and 3.8. Newer versions of python might work, but it is not guaranteed. Python 2.7 is not supported.

Installation

pip install nitsm

nitsm requires NI TestStand 20.0 or higher and NI TestStand Semiconductor Module 20.0 or higher.

To use nitsm in conjunction with nimi-python, you must also install the appropriate NI instrument driver for each device you plan to use:

Visit the nimi-python project for information on which python packages to install alongside each instrument driver.

Usage

Define code modules with the code_module decorator in the nitsm.codemoduleapi module. When called from TestStand, the decorator will convert the pywin32 COM object into an nitsm.codemoduleapi.SemiconductorModuleContext object.

import nidcpower
import nitsm.codemoduleapi

@nitsm.codemoduleapi.code_module
def source_current(tsm_context, pins, current_level):
    pin_query_context, sessions, channel_strings = tsm_context.pins_to_nidcpower_sessions(pins)
    for session, channel_string in zip(sessions, channel_strings):
        session.channels[channel_string].output_function = nidcpower.OutputFunction.DC_CURRENT
        session.channels[channel_string].current_level = current_level
        session.channels[channel_string].initiate()

Known Limitations

  • Instrument alarms are currently not supported
  • The Set Relays TestStand step is not supported when creating relay sessions in python
  • See STATUS.md for additional information about the current state of the API and system tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nitsm-0.2.1.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nitsm-0.2.1-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file nitsm-0.2.1.tar.gz.

File metadata

  • Download URL: nitsm-0.2.1.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nitsm-0.2.1.tar.gz
Algorithm Hash digest
SHA256 fa65ac7d8512105962f843acdf6ac7d9450949c51a1c91cf2b1a280e425c5bc9
MD5 9374bce26825bc8b145a717187a1d1ab
BLAKE2b-256 d8e62f307309a4ce443493a4eebd61603e6966258633169321890f14b2a0cb47

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitsm-0.2.1.tar.gz:

Publisher: publish-pypi.yml on ni/nitsm-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nitsm-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: nitsm-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nitsm-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b596a9ed0366c765da85b7d2c3d6167c6fd9f0611c272060ff64dfab6db35f79
MD5 03c2ea7fcc426322f2cb36de07bd4717
BLAKE2b-256 d9f428b4a73073e88871dd71bbd803d2cadc7a91fabc572856f2f31c2fc53a6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nitsm-0.2.1-py3-none-any.whl:

Publisher: publish-pypi.yml on ni/nitsm-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page