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.

2701/7708 gives error -221, but works

Post Reply
yorkamo
Posts: 2
Joined: February 9th, 2017, 1:43 pm
Country: Canada

2701/7708 gives error -221, but works

Post by yorkamo » February 9th, 2017, 2:24 pm

Hi, I have a new 2701 & 7708 (in slot 1) running and returning data from scans, but every time I send a command involving a channel list it beeps and gives error -221, despite behaving as I would expect it to without errors. Here's the code I'm using (python with pyvisa, the SCPI essentially copied from the example in the manual):

The actual SCPI part:

Code: Select all

logger2.write('TRAC:CLE')
logger2.write('INIT:CONT OFF')
logger2.write('TRIG:SOUR IMM')
logger2.write("SENS:FUNC 'VOLT',(@101:"+str(100+nchan)+")") #Error -221 here
logger2.write('TRIG:COUN 1')
logger2.write('SAMP:COUN '+str(nchan))
logger2.write('ROUT:SCAN (@101:'+str(100+nchan)+')') #Error -221 here also
logger2.write('ROUT:SCAN:TSO IMM')
logger2.write('ROUT:SCAN:LSEL INT')
print(logger2.query('READ?'))
First guess was that I was using the wrong scan range for the slot, but I double checked that the 7708 is in slot 1 rather than 2 (both physically and from the 2701 front panel). It's also not my int/string conversion, it behaves the same if I put '101:110' in manually. This still reads & outputs the


The full script:

Code: Select all

import visa
#import time
#time.sleep(10)

nchan = 4

#%% Open resource, set communication settings
rm = visa.ResourceManager()
loggerclose = rm.open_resource('TCPIP0::192.168.1.200::2842::SOCKET')
loggerclose.write('SYST:ETH:SOCK:CLOSE\n')
loggerclose.close()
logger2 = rm.open_resource('TCPIP0::192.168.1.200::1394::SOCKET',
                           read_termination='\n', write_termination='\n')
#print(logger2.query('*IDN?'))

#%% Set up for measurements

logger2.write('TRAC:CLE')
logger2.write('INIT:CONT OFF')
logger2.write('TRIG:SOUR IMM')
logger2.write("SENS:FUNC 'VOLT',(@101:"+str(100+nchan)+")") #Error here
logger2.write('TRIG:COUN 1')
logger2.write('SAMP:COUN '+str(nchan))
logger2.write('ROUT:SCAN (@101:'+str(100+nchan)+')') #Error here also
logger2.write('ROUT:SCAN:TSO IMM')
logger2.write('ROUT:SCAN:LSEL INT')

#%% Run a scan & read outputs
try:
    print(logger2.query('READ?'))
except visa.VisaIOError:
    print('Visa I/O error (probable timeout)')

#%% Finish communicating
logger2.close() #Make sure to always close socket


yorkamo
Posts: 2
Joined: February 9th, 2017, 1:43 pm
Country: Canada

Re: 2701/7708 gives error -221, but works

Post by yorkamo » February 10th, 2017, 7:21 am

Ah, nevermind, just needed to put some waits in between the write operations

Post Reply

Return to “Series 2700 Multimeter/Data Aquisition/Switch System”

Who is online

Users browsing this forum: No registered users and 4 guests