NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I call the Python attribute node in the Semiconductor Multi Test step in the TestStand to get the voltage measurement results?

Background: Since Teststand's TSM does not support python, I hope to use TSM's multi test step to implement SMU voltage/current measurement and generate reports using the built-in report plugin(csv test results log).

Current situation: I used "Getting Started with Semiconductor Module.seq" as a template and modified the test step. The test part of the code in multi test vi was changed to call the node of python to implement voltage/current measurement, that is, only the measurement part of the code is implemented in python, and the rest is still implemented in LabVIEW.

Problems encountered: When the Teststand program is running, an error will be reported in the python call, and the session conflict. The python code has no problem measuring voltage/current and can run independently.

 

 
import nidcpower

def configure_and_measure(resource_name, voltage,current):
    session = nidcpower.Session(resource_name=f"{resource_name}", options={})
    session.source_mode = nidcpower.SourceMode.SINGLE_POINT
    # if channel == "0":
        # Channel 0 configuration
    session.channels[0].output_function = nidcpower.OutputFunction.DC_VOLTAGE
    session.channels[0].voltage_level = voltage
    session.channels[0].current_limit_range = 10e-3
    session.channels[0].current_limit = 10e-3

    session.commit()

    # with session.initiate():
    # session.initiate()
    session.wait_for_event(event_id=nidcpower.Event.SOURCE_COMPLETE, timeout=5)
    measurements = session.measure_multiple()

    # Return measurement based on the channel
    # if channel == "0":
    return measurements[0][0]  # Measurement for channel 0

 

0 Kudos
Message 1 of 1
(54 Views)