Tektronix Technical Forums are maintained by community involvement. Feel free to post questions or respond to questions by other members. Should you require a time-sensitive answer, please contact your local Tektronix support center here.
I have python communicating to a Keithley 2602A perfectly fine, but I want to run some TSP script which I have developed in the TestScript Builder. I want to run these TSP scripts without having to call run on the console of the TSB. I have the following questions:
How would I run a TSP script in python? Is there an example?
How would I upload a TSP script into the 2602A?
I've read the manual for the 2602A and there are instructions on interacting with LabVIEW, MATLAB, and importing scripts into TSB from the sourcmeter and running scripts that are already uploaded from the front panel, but nothing that I understood about uploading scripts into the sourcemeter or running it from python. Anyone have any ideas? Thanks!
- Keithley Applications
- Posts: 1280
- Joined: October 15th, 2010, 10:35 am
- Country: United States
Use the loadandrunscript/endscript construct to load the function into the runtime memory of the Test Script Processor.
Then call your function.
The very simple code below illustrates the concept:
Code: Select all
import visa mysmu=visa.instrument('gpib0::26::instr') mysmu.write('reset()') mysmu.write('errorqueue.clear()') mysmu.write('loadandrunscript') mysmu.write('function DoMyThing(duration, frequency)') mysmu.write('beeper.beep(duration, frequency)') mysmu.write('end') mysmu.write('endscript') # call custom function mysmu.write('DoMyThing(1, 800)') mysmu.close()
Who is online
Users browsing this forum: No registered users and 2 guests