Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the TSP examples from TSB with Toolkit configs #60

Merged
merged 10 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Application_Specific/LIV_Diode_Testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# LIV Diode Testing

These TSP scripts are for performing Light-Current-Voltage (LIV) testing with a photodiode with a [2601B-PULSE 10us Pulser/SMU](https://www.tek.com/products/keithley/source-measure-units/2601b-pulse-system-sourcemeter) and other instruments.

Case I is with a DMM6500 or DMM7510
Case II is with a 2602B SMU
Case III is with a 2461 SMU

See the code comments for more information.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Description:
and analysis.

Required Equipment: 1 Model 2601B-PULSE System SourceMeter instrument
1 2602B System SourceMeter intrument

Note: The function does not perform any error checking. It is the user's
responsibility to specify settings that are compatible with the
Expand Down
3 changes: 3 additions & 0 deletions Application_Specific/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ Files to be used with LabVIEW 2018 for controlling a 3765 plug-in card for a 370
* **[Increase 4-Wire Resistance Measurement Capability with Common-side Ohms](./Increase_4-Wire_Resistance_Measurement_Capability_with_Common-side_Ohms)**
C# and Python code examples to target increased 4-wire measurement bandwidth per multiplexer card using the Common-side Ohms functionality.

* **[LIV Diode Testing](./LIV_Diode_Testing/)**
TSP code for performing Light-Current-Voltage (LIV) testing with a 2601B-PULSE and other instruments.

* **[Rds(On) of SiC MOSFET](./Rds(On)_of_SiC_MOSFET/)**
Supplemental TSP code to a series of videos made by Keithley Applications Engineer Andrea Clary using a 2461 High Current Source Measure Unit and a 2450 SMU.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- Reset the instrument to the default settings
reset()

-- Establish channel settings for the scan card configuration...
channel.setdmm("101", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_AC_VOLTAGE)
channel.setdmm("101", dmm.ATTR_MEAS_DETECTBW, dmm.DETECTBW_30HZ)
channel.setdmm("102:110", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_DC_VOLTAGE)
channel.setdmm("111:114", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_TEMPERATURE)
channel.setdmm("111:114", dmm.ATTR_MEAS_TRANSDUCER, dmm.TRANS_THERMOCOUPLE)
channel.setdmm("111:114", dmm.ATTR_MEAS_THERMOCOUPLE, dmm.THERMOCOUPLE_K)
channel.setdmm("111:114", dmm.ATTR_MEAS_REF_JUNCTION, dmm.REFJUNCT_SIMULATED)
channel.setdmm("111:114", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_TEMPERATURE, dmm.ATTR_MEAS_SIM_REF_TEMP, 23)
channel.setlabel("101", "ACSource")
channel.setlabel("111", "Reg12VTemp")
channel.setlabel("112", "Reg5VTemp")
channel.setlabel("113", "LoadTemp1")
channel.setlabel("114", "LoadTemp2")
channel.setdmm("121", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_AC_CURRENT)
channel.setdmm("122", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_DC_CURRENT)

-- Generate the scan...
scan.create("101:114,121,122")
scan.scancount = 10

-- Clear and size the buffer...
defbuffer1.clear()
defbuffer1.capacity = 10 * 16

-- Start the scan and wait...
trigger.model.initiate()
waitcomplete()

-- Extract the data...
printbuffer(1, defbuffer1.n, defbuffer1, defbuffer1.readings, defbuffer1.channels)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This example application demonstrates how to use the DAQ6510 to perform complex multi-channel,
mixed function scanning in a production-test environment.
The DAQ6510 can perform more than one function in a multichannel scan, providing a range of dataacquisition
The DAQ6510 can perform more than one function in a multichannel scan, providing a range of data acquisition
options in a single test.
In this production environment the DAQ6510 is:

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- monitor temperature on channel 101
reset()
channel.setdmm("101", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_TEMPERATURE, dmm.ATTR_MEAS_TRANSDUCER, dmm.TRANS_THERMOCOUPLE, dmm.ATTR_MEAS_THERMOCOUPLE, dmm.THERMOCOUPLE_K, dmm.ATTR_MEAS_REF_JUNCTION, dmm.REFJUNCT_INTERNAL) channel.setdmm("101", dmm.ATTR_MEAS_UNIT, dmm.UNIT_CELSIUS)

-- set limit high on monitor and trigger scan when high limit exceeds
scan.monitor.channel = "101"
scan.monitor.limit.high.value = 30
scan.monitor.mode = scan.MODE_HIGH

-- scan 2-wire resistance on channel 102:105
channel.setdmm("102:105", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_RESISTANCE, dmm.ATTR_MEAS_RANGE_AUTO, dmm.ON)

-- create scan
scan.create("101:105")
scan.scancount = 10

-- initiates the monitoring of channel 101 conditions, which will enable the scan when it crosses the temperature threshold.
trigger.model.initiate()
Binary file not shown.
12 changes: 6 additions & 6 deletions Instrument_Examples/DAQ6510/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Visual Basic example (with dummy TSP script) to load and run a TSP file.
Python example to scan thermocouples over 24+ hours and plot results with matplotlib. See README in directory for more.

* **[Mixed Function Multi-Channel Scanning](./Mixed_Function_Multi-Channel_Scanning/)**
Python and Visual Basic examples to perform more complex scans with multiple measurement functions. See README in directory for more.
Both TSP and Python with Visual Basic examples to perform more complex scans with multiple measurement functions. See README in directory for more.

* **[Mixed Signal Scanning](./Mixed_Signal_Scanning/)**
Python and MatLab example with RS-232 to set up and execute a scan with multiple measurement functions.
Expand All @@ -27,19 +27,19 @@ Python and MatLab example with RS-232 to set up and execute a scan with multiple
Zipped C# project to control the DIO ports on the 7707 Differential Multiplexer Switch Card and TSP Script to configure the same card. See README in directory for more.

* **[Pre-Scan Monitor](./Pre-Scan_Monitor/)**
Python examples with TSP and SCPI commands to wait for a temperature chamber to come up to temperature before executing a scan. See README in directory for more.
Native TSP and Python examples with TSP and SCPI commands to wait for a temperature chamber to come up to temperature before executing a scan. See README in directory for more.

* **[Scan Temperature using Thermocouples](./Scan_Temperaure_Using_Thermocouples/)**
Python and Visual Basic examples to scan temperature with thermocouples. See README in directory for more.
TSP and Python with Visual Basic examples to scan temperature with thermocouples. See README in directory for more.

* **[Scanning Low Level DC Voltage](./Scanning_Low_Level_DC_Voltage/)**
Python examples demonstrating the use of NPLC and Autozero functions to accurately measure low voltage. See README in directory for more.
TSP and Python examples demonstrating the use of NPLC and Autozero functions to accurately measure low voltage. See README in directory for more.

* **[Scannig Resistors with 4W Measurement](./Scanning_Resistors_Using_4W_Measurement/)**
* **[Scanning Resistors with 4W Measurement](./Scanning_Resistors_Using_4W_Measurement/)**
Python examples to scan ressitance measurements with a preference for 4-wire/Kelvin connections. See README in directory for more.

* **[Speed Scanning for Increased Throughput](./Speed_Scanning_for_Increased_Test_Throughput/)**
Python examples demonstrating differences in scan speed between the 7700, 7703, and 7710 multiplexer modules. See README in directory for more.
TSP and Python examples demonstrating differences in scan speed between the 7700, 7703, and 7710 multiplexer modules. See README in directory for more.

* **[Three Ways to Manage Scanning](./Three_Ways_To_Manage_Scanning/)**
Three python examples demonstrating different ways to control a scan: a traditional triggered approach, a manual approach, and a interval triggered approach. See README in directory for more.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- Reset the instrument to the default settings
reset()

-- Set up channel settings for Slot 1
channel.setdmm("101:110", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_TEMPERATURE)
channel.setdmm("101:110", dmm.ATTR_MEAS_TRANSDUCER, dmm.TRANS_THERMOCOUPLE)
channel.setdmm("101:110", dmm.ATTR_MEAS_THERMOCOUPLE, dmm.THERMOCOUPLE_K)
channel.setdmm("101:110", dmm.ATTR_MEAS_REF_JUNCTION, dmm.REFJUNCT_INTERNAL)
channel.setdmm("101:110", dmm.ATTR_MEAS_OPEN_DETECTOR, dmm.ON)

-- set up Scan
scan.create("101:110")

-- Set the scan count to 24hrs * 60min/hr = 1440
scan.scancount = 1440

-- Set the time between scans to 60s
scan.scaninterval = 6.000e+01

-- Ensure data gets written to a connected USB drive after each scan
scan.export("/usb1/scan24hr.csv", scan.WRITE_AFTER_SCAN, buffer.SAVE_RELATIVE_TIME)

-- Enable scan restart after power failure
scan.restart = scan.ON

-- Trigger to start the scan...
trigger.model.initiate()

-- Ensure that the display shows the SCAN swipe and carousel
display.changescreen(display.SCREEN_SCAN_SWIPE)
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- Reset the instrument to the default settings
reset()
scanCount = 100

-- set up each channels function, range and offset compensation
channel.setdmm("101, 102", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_4W_RESISTANCE, dmm.ATTR_MEAS_RANGE, 100, dmm.ATTR_MEAS_OFFCOMP_ENABLE, dmm.OCOMP_ON)
channel.setdmm("103, 104", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_4W_RESISTANCE, dmm.ATTR_MEAS_RANGE, 10, dmm.ATTR_MEAS_OFFCOMP_ENABLE, dmm.OCOMP_ON)
channel.setdmm("105, 106", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_4W_RESISTANCE, dmm.ATTR_MEAS_RANGE, 1, dmm.ATTR_MEAS_OFFCOMP_ENABLE, dmm.OCOMP_ON)

-- set up Scan
scan.add("101,102,103,104,105,106")
scan.scancount = 100

-- set up trigger model
trigger.model.initiate()

-- wait till scan completes
waitcomplete()
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- Reset the instrument to the default settings
reset()
channelCount = 6
scanCount = 10
bufferSize = channelCount * scanCount
defbuffer1.capacity = bufferSize

scan.buffer = defbuffer1 -- not necessary when using the default buffer, but added to show command use case

-- set up channels
channel.setdmm("101:106", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_DC_VOLTAGE, dmm.ATTR_MEAS_RANGE_AUTO, dmm.ON, dmm.ATTR_MEAS_AUTO_ZERO, dmm.ON, dmm.ATTR_MEAS_NPLC, 5)

-- set up Scan
scan.add("101:106")
scan.scancount = scanCount

-- set up trigger model
trigger.model.initiate()

-- print measurement data to console
i = 1
while i <= bufferSize do
delay(2)
lastIndex = defbuffer1.n
printbuffer(i, lastIndex, defbuffer1.readings)
i = lastIndex + 1
end

-- save buffer data from defbuffer1 to USB
buffer.save(defbuffer1, "/usb1/MyData.csv")
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-- Set up variables to be referenced during the scan
local scanCnt = 1000
local sampleCnt = 0
local chanCnt = 0
local actualRdgs = 0
local rcvBuffer = ""

-- Get the initial timestamp for end-of-run comparison
local x = os.clock()

-- Reset the instrument and clear the buffer
reset()
defbuffer1.clear()

-- Set up reading buffer format and establish scan count
format.data = format.ASCII
scan.scancount = scanCnt
-- Configure the scan channels for the Slot 1 card
channel.setdmm("101:120", dmm.ATTR_MEAS_FUNCTION, dmm.FUNC_DC_VOLTAGE)
channel.setdmm("101:120", dmm.ATTR_MEAS_RANGE, 1)
channel.setdmm("101:120", dmm.ATTR_MEAS_RANGE_AUTO, dmm.OFF)
channel.setdmm("101:120", dmm.ATTR_MEAS_AUTO_ZERO, dmm.OFF)
channel.setdmm("101:120", dmm.ATTR_MEAS_DIGITS, dmm.DIGITS_4_5)
channel.setdmm("101:120", dmm.ATTR_MEAS_NPLC, 0.0005)
channel.setdmm("101:120", dmm.ATTR_MEAS_APERTURE, 8.33333e-06)
channel.setdmm("101:120", dmm.ATTR_MEAS_LINE_SYNC, dmm.OFF)
channel.setdmm("101:120", dmm.ATTR_MEAS_LIMIT_ENABLE_1, dmm.OFF)
channel.setdmm("101:120", dmm.ATTR_MEAS_LIMIT_ENABLE_2, dmm.OFF)

-- Dim the display...
display.lightstate = display.STATE_LCD_OFF

-- Generate the scan...
scan.create("101:120")
scan.scaninterval = 0.0
chanCnt = scan.stepcount

-- Calculate the overall sample count and use it to size the buffer
sampleCnt = scanCnt * chanCnt
defbuffer1.capacity = sampleCnt

-- Start the scan...
trigger.model.initiate()

-- Loop to capture and print readings
i = 1
while i <= sampleCnt do
delay(0.5)
myCnt = defbuffer1.n
-- NOTE: Can be supplemented or replaced by writing to USB
printbuffer(i, myCnt, defbuffer1.readings)
i = myCnt + 1
end

-- Turn the display back on...
display.lightstate = display.STATE_LCD_50

-- Output the elapsed time to the user
print(string.format("Elapsed Time: %2f\n", os.clock() - x))
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,59 +1,61 @@
--[[

***********************************************************
*** Copyright 2019 Tektronix, Inc. ***
*** See www.tek.com/sample-license for licensing terms. ***
***********************************************************

This example is from the DMM6500's User's Manual. Check there for more details on running this example.

This sequence of TSP commands will grade resistors into established bins of accuracy.

After the code executes, the data is displayed in the Instrument Console of Test Script Builder.

]]

-- Reset the instrument to default settings
reset()

-- Create a user-defined reading buffer that can store up to 1 million readings
bufferVar = buffer.make(1000000)
local bufferVar = buffer.make(1000000)
bufferVar.clear()
-- Set the measure function to 4-wire resistance

--Set the measure function to 4-wire resistance
dmm.measure.func = dmm.FUNC_4W_RESISTANCE

-- Set the number of power line cycles 1 PLC
dmm.measure.nplc = 1

-- Immediately update autozero reference measurements and then disable the autozero function
dmm.measure.autozero.once()

-- Enable offset compensation for more accurate resistance reading
dmm.measure.offsetcompensation.enable = dmm.ON

-- Configure digital I/O lines 1 through 4 as digital outputs. These I/O lines are used to output binning code to component handler
digio.line[1].mode = digio.MODE_DIGITAL_OUT
digio.line[2].mode = digio.MODE_DIGITAL_OUT
digio.line[3].mode = digio.MODE_DIGITAL_OUT
digio.line[4].mode = digio.MODE_DIGITAL_OUT

-- Clear digital I/O lines to 0
digio.line[1].state = digio.STATE_LOW
digio.line[2].state = digio.STATE_LOW
digio.line[3].state = digio.STATE_LOW
digio.line[4].state = digio.STATE_LOW
-- Configure digital I/0 line 5 as a trigger input used to detect the start-of-test trigger from the component handler

-- Configure digital I/0 line 5 as a trigger input used to detect
-- the start-of-test trigger from the component handler
digio.line[5].mode = digio.MODE_TRIGGER_IN

-- Set trigger detector to detect falling edge
trigger.digin[5].edge = trigger.EDGE_FALLING
-- Configure digital I/0 line 6 as a trigger output used to send an end-of-test trigger to the component handler

-- Configure digital I/0 line 6 as a trigger output used to send
-- an end-of-test trigger to the component handler
digio.line[6].mode = digio.MODE_TRIGGER_OUT

-- Output a falling edge trigger
trigger.digout[6].logic = trigger.LOGIC_NEGATIVE

-- Set width of output trigger pulse to 10 us
trigger.digout[6].pulsewidth = 10E-6

-- Trigger pulse is output when the Notify Block generates an event
trigger.digout[6].stimulus = trigger.EVENT_NOTIFY2
-- Load Component Binning trigger model template
-- See the Reference Manual for details on these parameters
trigger.model.load("GradeBinning", 100, 5, 0.1, 0.1, 120, 80, 15, 4, 110, 90, 1, 105, 95, 2, 101, 99, 3, bufferVar)
-- Initiate trigger model and wait until finished

--Load Component Binning trigger model template
trigger.model.load("GradeBinning", 100, 5, .1, .1, 120, 80, 15, 4, 110, 90, 1, 105, 95, 2, 101, 99, 3, bufferVar)

--Initiate trigger model and wait until finished
trigger.model.initiate()
waitcomplete()
-- Display on front panel USER swipe screen after binning test completes

--Display on front panel USER swipe screen after binning test completes
display.changescreen(display.SCREEN_USER_SWIPE)
display.settext(display.TEXT1, "Test Completed")
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--Reset the Model DMM6500 to the default settings.
reset()

--Set the measure function to 4-wire resistance.
dmm.measure.func = dmm.FUNC_4W_RESISTANCE

--Enable autorange.
dmm.measure.autorange = dmm.ON

--Enable autozero.
dmm.measure.autozero.enable = dmm.ON

--Enable offset compensation.
dmm.measure.offsetcompensation.enable = dmm.ON

--Set the number of power line cycles to 1.
dmm.measure.nplc = 1

--Read the resistance value.
print(dmm.measure.read())


Binary file not shown.
Loading
Loading