-
Notifications
You must be signed in to change notification settings - Fork 0
/
n5700.py
45 lines (36 loc) · 1.09 KB
/
n5700.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 14 16:30:18 2012
Driver for N5700 series power supply
@author: bram
"""
from visa import *
import string, os, sys, time
class device:
def __init__(self, name):
self.name = instrument(name)
n5700 = self.name
print n5700.ask('IDN?')
def setVoltage(self, input):
n5700 = self.name
n5700.write('VOLT'+str(input))
def setCurrent(self, input):
n5700 = self.name
n5700.write('CURR'+str(input))
def setOverVoltage(self,input):
n5700 = self.name
n5700.write('VOLT:PROT:LEV'+str(input))
def setOverCurrent(self,input):
n5700 = self.name
n5700.write('CURR:PROT:LEV'+str(input))
def outputOn(self):
n5700 = self.name
n5700.write('OUTP ON')
time.sleep(0.01)
return n5700.ask('*OPC')
def measureVoltage(self):
n5700 = self.name
return n5700.ask('Meas:Volt?')
def checkError(self):
n5700 = self.name
return n5700.ask('Syst:err?')