Programming Example - Keysight Technologies N4960A User Manual

Serial bert 17 and 32 gb/s
Table of Contents

Advertisement

6.15 Programming Example

# use the PyVISA plugin from http://pyvisa.sourceforge.net/
import visa
import time
def pause():
print 'press return to continue'
cont=raw_input()
# instrument setup, change addresses to suit your equipment
address = "ASRL46" # e.g. "GPIB::18" for GPIB address 18, "ASRL15" for COM15
#
(FTDI driver enables COM over USB)
timeout = 1000
resetN4960A = True # option to reset the instrument when starting
# connect to instrument and turn off local echo if using USB
# -local echo may be on or off, which means the !ECHO OFF
# command may be repeated back to us, this is tricky
print "connecting to " + address
N4960A = visa.instrument(address)
N4960A.clear
if (address.find("ASRL") != -1):
N4960A.write("!ECHO OFF")
N4960A.timeout = 1
try:
tmp = N4960A.read()
except:
N4960A.clear
N4960A.timeout = timeout
# clear errors
null = N4960A.ask("*ESR?").strip("\n")
null = N4960A.ask(":SYST:ERR:ALL?").strip("\n")
# query instrument type
Keysight N4960A Serial BERT 17 and 32 Gb/s User Guide
The following programming example is written in Python, an open-
source programming language that is free to use, even for commercial
products. The open-source PyVISA package enables fast and easy GPIB
and USB instrument control.
The example program below demonstrates some popular methods of
interfacing with the N4960A serial BERT 17 and 32 Gb/s. The program
was written for a 32 Gb/s system. Contact
Technologies.com
if you have any additional questions or if you would
like help programming our instruments.
# default 1s timeout for queries
Remote Operation
support@Keysight
217

Advertisement

Table of Contents
loading

Table of Contents