Commit 738cb9d3 authored by Mateus Goto's avatar Mateus Goto

[TEST] system commands

parent 64e385f7
...@@ -119,6 +119,8 @@ class NHR9400(): ...@@ -119,6 +119,8 @@ class NHR9400():
return self.receiveString(value) return self.receiveString(value)
def close(self): def close(self):
self.systWatchdogService()
self.__s.send("SOUR:OUTP:ON 0\n".encode()) self.__s.send("SOUR:OUTP:ON 0\n".encode())
self.__s.send("ABOR\n".encode()) self.__s.send("ABOR\n".encode())
self.__s.send("SYST:LOC\n".encode()) self.__s.send("SYST:LOC\n".encode())
...@@ -145,16 +147,22 @@ class NHR9400(): ...@@ -145,16 +147,22 @@ class NHR9400():
#Command specifies the interval (Seconds) in which a command must be received. Query returns the programmed watchdog interval (Seconds). #Command specifies the interval (Seconds) in which a command must be received. Query returns the programmed watchdog interval (Seconds).
def systWatchdogInterval(self, interval): def systWatchdogInterval(self, interval):
if interval < 0: return -1 if interval < 0: return -1
self.__s.send(("SYST:WATC:INT" + str(interval) +"\n").encode()) self.__s.send(("SYST:WATC:SERV\n").encode())
self.__s.send(("SYST:WATC:INT " + str(interval) +"\n").encode())
self.__s.send(("SYST:WATC:SERV\n").encode())
print(self.checkErrors())
#Command determines the type communication required to reset the watchdog timer. Query returns the type of communication required to reset the watchdog timer. #Command determines the type communication required to reset the watchdog timer. Query returns the type of communication required to reset the watchdog timer.
def systWatchdogRobust(self, bool): def systWatchdogRobust(self, bool):
if bool != 0 or bool != 1: return -1 if bool != 0 or bool != 1: return -1
self.__s.send(("SYST:WATC:ROB" + str(bool) +"\n").encode()) self.__s.send(("SYST:WATC:ROB " + str(bool) +"\n").encode())
value = self.__s.recv(1024)
return self.receiveString(value)
#Command resets watchdog timer #Command resets watchdog timer
def systWatchdogService(self): def systWatchdogService(self):
self.__s.send(("SYST:WATC:SERV\n").encode()) self.__s.send(("SYST:WATC:SERV\n").encode())
################################# Digital Subsystem ############################ ################################# Digital Subsystem ############################
......
...@@ -22,16 +22,24 @@ def main(): ...@@ -22,16 +22,24 @@ def main():
for elem in nhr10: for elem in nhr10:
print("nhr10 ip: ",elem.getIp()) print("nhr10 ip: ",elem.getIp())
print("nhr10 max current: ", elem.instrumentCapCurrent()) print("nhr10 max current: ", elem.instrumentCapCurrent())
print("nhr10 max current range: ", elem.instrumentCapCurrentRange()) print("nhr10 current range: ", elem.instrumentCapCurrentRange())
print("nhr10 max freq range: ", elem.instrumentCapFreqRange()) print("nhr10 freq range: ", elem.instrumentCapFreqRange())
print("nhr10 max power range: ", elem.instrumentCapPowerMax()) print("nhr10 power range: ", elem.instrumentCapPowerMax())
print("nhr10 max voltage range: ", elem.instrumentCapVoltageMaxMin()) print("nhr10 voltage range: ", elem.instrumentCapVoltageMaxMin())
print("nhr10 watch dog interval: ", elem.systWatchdogInterval(5))
for elem in nhr30: for elem in nhr30:
print("nhr30 ip: ",elem.getIp()) print("nhr30 ip: ",elem.getIp())
print("nhr30 max current: ", elem.instrumentCapCurrent())
print("nhr30 current range: ", elem.instrumentCapCurrentRange())
print("nhr30 freq range: ", elem.instrumentCapFreqRange())
print("nhr30 power range: ", elem.instrumentCapPowerMax())
print("nhr30 voltage range: ", elem.instrumentCapVoltageMaxMin())
print("nhr30 range: ", elem.instrumentCapResistenceRL())
time.sleep(3) time.sleep(3)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment