forked from RedPitaya/RedPitaya
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidentification.py
More file actions
executable file
·29 lines (21 loc) · 992 Bytes
/
identification.py
File metadata and controls
executable file
·29 lines (21 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
import argparse
parser = argparse.ArgumentParser(description='SCPI test.')
parser.add_argument('adr', help='provide IP address or URL')
parser.add_argument('-p', '--port', type=int, default=5000, help='specify SCPI port (default is 5000)')
args = parser.parse_args()
###############################################################################
# connect to the instrument
###############################################################################
import visa
rm = visa.ResourceManager('@py')
#rm.list_resources()
rp = rm.open_resource('TCPIP::{}::{}::SOCKET'.format(args.adr, args.port), read_termination = '\r\n')
###############################################################################
# SCPI exchange
###############################################################################
# read identification string
print(rp.query("*IDN?"))
# read SCPI standard version
print(rp.query("SYSTem:VERSion?"))
rp.close()