自动化测试电机电流功能迁移完成
This commit is contained in:
@ -157,7 +157,7 @@ class ModbusRequest(object):
|
||||
clibs.insert_logdb("INFO", "openapi", f"modbus: 40101 将 {probe} 写入")
|
||||
|
||||
def write_pon(self, pon):
|
||||
self.__c.write_register(40101, pon)
|
||||
self.__c.write_register(40102, pon)
|
||||
clibs.insert_logdb("INFO", "openapi", f"modbus: 40102 将 {pon} 写入")
|
||||
|
||||
def write_axis(self, axis):
|
||||
@ -318,13 +318,12 @@ class ModbusRequest(object):
|
||||
return result.registers[0]
|
||||
|
||||
def read_scenario_time(self):
|
||||
results = self.__c.read_holding_registers(41002, count=2)
|
||||
result = BinaryPayloadDecoder.fromRegisters(results.registers, byteorder=Endian.BIG, wordorder=Endian.LITTLE)
|
||||
result = f"{result.decode_32bit_float():.3f}"
|
||||
results = self.__c.read_holding_registers(40601, count=2)
|
||||
result = self.__c.convert_from_registers(results.registers, data_type=self.__c.DATATYPE.FLOAT32, word_order="little")
|
||||
return result
|
||||
|
||||
def read_brake_done(self):
|
||||
result = self.__c.read_holding_registers(41007, count=1)
|
||||
result = self.__c.read_holding_registers(40603, count=1)
|
||||
return result.registers[0]
|
||||
|
||||
|
||||
@ -721,7 +720,7 @@ class HmiRequest(object):
|
||||
self.close()
|
||||
clibs.w2t(f"请求 {msg_id} 发送失败......\n", "red", "ReqSendFailed")
|
||||
for _ in range(3):
|
||||
time.sleep(clibs.interval * 2)
|
||||
time.sleep(clibs.interval * 4)
|
||||
try:
|
||||
clibs.lock.acquire(True)
|
||||
clibs.cursor.execute(f"select content from logs where content like '{f_text}'")
|
||||
|
Reference in New Issue
Block a user