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.

Basic PTM

Post Reply
WillPragmatic
Posts: 11
Joined: October 5th, 2015, 9:32 am
Country: United Kingdom

Basic PTM

Post by WillPragmatic » October 7th, 2015, 3:29 am

Hi, I have written a PTM to control an oscilloscope. This works fine. Within this PTM I would also like to set the voltage output and measure current from a group of 2612A SMUs controlled over LAN.

I think I should be able to do this using the forcev() and measi() commands but so far I haven’t been able to get these to work.

Does someone have an example where these functions work? Will they work with a 2612A SMU?

Is there a document that details all the python libraries available in ACS and which functions are in each? All the examples I’ve found import different libraries I’m not sure what is in ACS_PostData, ACSLPT and ptmlpt and what other python libraries are available.

brian.d.smith
Keithley Applications
Keithley Applications
Posts: 402
Joined: June 10th, 2013, 6:00 am
Country: United States

Re: Basic PTM

Post by brian.d.smith » October 7th, 2015, 6:44 am

Controlling a 2612A would normally occur in a Script Test Module (STM). You write and debug your script in Test Script Builder.

Is there a compelling reason to control the 2612A in the PTM?

WillPragmatic
Posts: 11
Joined: October 5th, 2015, 9:32 am
Country: United Kingdom

Re: Basic PTM

Post by WillPragmatic » October 7th, 2015, 8:27 am

I want to be able to set voltage levels on the pins of the DUT, use the scope to measure the output, then change the voltage levels.

I know I could have a series of scripts; STM to set the SMU then PTM to use the scope but I don't want to have to drop my connection to the scope between each test. It would also be good to keep all the results together.

brian.d.smith
Keithley Applications
Keithley Applications
Posts: 402
Joined: June 10th, 2013, 6:00 am
Country: United States

Re: Basic PTM

Post by brian.d.smith » October 7th, 2015, 9:07 am

Here is a python program that controls a 2600B. You should start simple and just send the *IDN?

Code: Select all


import visa
import time
#mysmu = visa.instrument("tcpip::169.254.42.80::instr")
A = visa.instrument("gpib::26::instr")
print( A.ask("*IDN?"))

A.write("local oldcurrent = 0")
A.write("local newcurrent = 0")
A.write("local newgatevoltage = 0")
A.write("local oldgatevoltage = 0")
A.write("local drainvoltage = 5")
A.write("local startgatevoltage = -10")
A.write("local gatevoltageincrement=0.01")
A.write("local vth")

A.write("smua.source.rangev = 10")
A.write("smua.source.levelv = drainvoltage")
A.write("smua.source.limiti = 0.025")

A.write("smua.measure.rangei = 0.100")

A.write("smua.measure.nplc = 1")
A.write("smua.measure.autozero = smua.AUTOZERO_OFF")

A.write("smub.source.rangev = 10")
A.write("smub.source.levelv = startgatevoltage0")
A.write("smub.source.limiti = 0.010")

A.write("smub.measure.rangei = 0.010")
A.write("smub.measure.nplc = 1")

A.write("smua.measure.autozero = smua.AUTOZERO_ONCE")
A.write("smub.measure.autozero = smub.AUTOZERO_ONCE")

A.write("smua.source.output = smua.OUTPUT_ON")
A.write("smub.source.output = smub.OUTPUT_ON")

A.write("newcurrent = smua.measure.i()")

A.write("newgatevoltage=startgatevoltage")

A.write("repeat")
A.write("oldgatevoltage = newgatevoltage")
A.write("oldcurrent =  newcurrent")
A.write("newgatevoltage = newgatevoltage + gatevoltageincrement")
A.write("smub.source.levelv  = newgatevoltage")
A.write("newcurrent = smua.measure.i()")
#newcurrent = A.ask("print(newcurrent)\n")
A.write("until newcurrent >= 0.010")

A.write("vth = oldgatevoltage + (0.001 - oldcurrent)*(newgatevoltage-oldgatevoltage)/(newcurrent-oldcurrent)")

vth = A.ask("print(vth)\n")
print "vth is  ",vth


A.write("smua.source.output = smua.OUTPUT_OFF")
A.write("smub.source.output = smub.OUTPUT_OFF")

#A.write("        ")


#errnum = float(A.ask("print(errorqueue.count)\n"))
#i=0
#for i in range(int(errnum+1)):
#    A.write("code,msg,sev,nod=errorqueue.next()\n")
#    code=int(float(A.ask("print(code)\n")))
#    msg=A.ask("print(msg)\n")
#    print("Error #"+str(code)+"  "+msg)
#A.write("display.clear()")
#time.sleep(1)
#A.write('display.settext("MESSAGE")')    
#time.sleep(1)
#A.write("display.clear()")
#A.write('display.screen = display.SMUA')
#time.sleep(1)
#A.write('display.screen = display.SMUA_SMUB')
#A.close()



WillPragmatic
Posts: 11
Joined: October 5th, 2015, 9:32 am
Country: United Kingdom

Re: Basic PTM

Post by WillPragmatic » October 8th, 2015, 8:32 am

Thanks.

I've got some of this to work. I didn't know the visa library was accessible on ACS.

I guess the best thing to do though is write a few scripts using TSB to upload to the master SMU then I can use visa to call them (reducing the back and forth between ACS and the SMUs)?

I've tested this using a GPIB connection but I really want to use a LAN connection as this is how it is set up in the lab. I assume in that case I just use:

Code: Select all

A = visa.instrument("tcpip::169.254.42.80::instr")
but replace the 169.254.42.80 with the IP address of my device?

Where can I find the IP address? I tried "C:\ACS\KATS\CONFIG\ACS_hdcon_-" but it wasn't in there.

brian.d.smith
Keithley Applications
Keithley Applications
Posts: 402
Joined: June 10th, 2013, 6:00 am
Country: United States

Re: Basic PTM

Post by brian.d.smith » October 8th, 2015, 9:07 am

The IP address can be queried and changed from the front panel.

MENU -> LAN -> STATUS -> IP ADDRESS is the query

MENU -> LAN -> CONFIG -> IP ADDRESS is for changing

WillPragmatic
Posts: 11
Joined: October 5th, 2015, 9:32 am
Country: United Kingdom

Re: Basic PTM

Post by WillPragmatic » October 27th, 2015, 3:53 am

Hi, this is still causing me problems.

As a regular Python script outside ACS the program for controlling a 2600B works fine. When I try to "import visa" in a PTM i get:

Code: Select all

ERROR error occured when ktmserver execute ptm:File "C:\ACS\Projects\default\lib\tm_ptm.py", line 4 in ?ImportError:No module named visa
To try and solve this I copied the visa.py file and pyvisa directory from my python install into the PTMLib directory in ACS. I then get the error:

Code: Select all

ERROR error occured when ktmserver execute ptm:File "C:\ACS\Projects\default\lib\tm_ptm.py", line 4 in ?SyntaxError: future feature unicode_literals is not defined (visa.py, line14)
Any suggestions?

My main goal is still to control a 2600A series SMU, connected to the PC by a network connection, from a PTM.

Post Reply

Return to “ACS Software Products”

Who is online

Users browsing this forum: No registered users and 2 guests