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.

Convert Keithley's code into Python

Post Reply
thanos
Posts: 2
Joined: September 9th, 2018, 6:51 am
Country: Greece

Convert Keithley's code into Python

Post by thanos » September 16th, 2018, 3:58 am

I am new in IEEE-488 Bus programming (SCPI), so I have started with small and simple examples. I use a 7001 Switch with a Model 7065 Hall Effect Card in Slot 1.
I am try to convert an example program written in Hewlett-Packard BASIC. This is from Keithley's Model 7065 Hall Effect Card, Instruction Manual Addendum.

Code: Select all

10 REMOTE 7008		                                ! Put 7001 in remote.
20 OUTPUT 708;  ":CONF:SLOT1:CTYPE C7065"	! Slot 1 = 7065 card
30 OUTPUT 708;  ":CLOS  (@1!1!1, 1!2!3)"          ! Close 1,1 and 2,2
40 PRINT "PRESS 'CONT' TO OPEN" 		        
50 PAUSE
60 OUTPUT 708,  ":OPEN ALL"				! Open all channels
Python Code using pyVisa package.

Code: Select all

import visa
rm = visa.ResourceManager()
keithley = rm.open_resource("GPIB::7")
keithley.write("*rst; status:preset; *cls")
keihtley.write(":CONF:SLOT1:CTYPE C7065")
keithley.write(":CLOS (@1!1!1,1!2!3)")
cont = input("Press CONT to open all channels ")
while cont != 'CONT':
	cont = input("Press CONT to open all channels")
keithley.write(":OPEN ALL")
It is right or I has to modify this. In the same manner I convert program's written in Basic from Manual in Python. There something I should consider?

Post Reply

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests