-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
26 lines (22 loc) · 828 Bytes
/
test.py
File metadata and controls
26 lines (22 loc) · 828 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
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 27 15:24:05 2014
@author: Veronika Schrenk
This script shows how the load_all_devices.linux_devices()-class can be used
"""
import load_all_devices;
devices = load_all_devices.linux_devices();
#example of how you can use the GPIB_DEVICE_LIST:
devices.fill_gpib_device_list();
print("gpib devices:" + str(devices.GPIB_DEVICE_LIST))
if len(devices.GPIB_DEVICE_LIST) > 0:
devices.GPIB_DEVICE_LIST[0].clear();
devices.GPIB_DEVICE_LIST[0].write('freq?')
resp = devices.GPIB_DEVICE_LIST[0].read(100)
devices.GPIB_DEVICE_LIST[0].clear();
print(resp)
devices.close_gpib_devices();
#example of how you can use the USBTMC_DEVICE_LIST:
devices.fill_usbtmc_device_list();
print("usbtmc devices:" + str(devices.USBTMC_DEVICE_LIST))
devices.close_usbtmc_devices();