From 96ec07723646297c031810f7ebad3778db46f404 Mon Sep 17 00:00:00 2001 From: Byeongdulee Date: Wed, 26 Jul 2023 07:52:08 -0500 Subject: [PATCH] Update urrobot.py --- urx/urrobot.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/urx/urrobot.py b/urx/urrobot.py index 56d124a..b990c8d 100644 --- a/urx/urrobot.py +++ b/urx/urrobot.py @@ -251,26 +251,28 @@ class URRobot(object): """ set voltage to be delivered to the tool, val is 0, 12 or 24 """ + assert(val in [0, 12, 24]) prog = "set_tool_voltage(%s)" % (val) self.send_program(prog) - def set_tool_digital_in(self, input_id): - """ - set voltage to be delivered to the tool, val is 0, 12 or 24 - """ - prog = "set_tool_digital_in(%s)" % (input_id) - self.send_program(prog) + # def get_tool_digital_in(self, input_id): + # """ + # get tool digitial input + # """ + # prog = "get_tool_digital_in(%s)" % (input_id) + # self.send_program(prog) def set_tool_digital_out(self, input_id, signal_level): """ - set voltage to be delivered to the tool, val is 0, 12 or 24 + set tool digital output """ + assert(input_id in [0, 1]) prog = "set_tool_digital_out(%s, %s)" % (input_id, signal_level) self.send_program(prog) def set_tool_communication(self, enabled=True, baud_rate=9600, parity=0, stop_bits=1, rx_idle_chars=1.0, tx_idle_chars=3.5): """ - set voltage to be delivered to the tool, val is 0, 12 or 24 + set tool RS485 communication protocol. """ prog = "set_tool_communication(%s, %s, %s, %s, %s, %s)" % (enabled, baud_rate, parity, stop_bits, rx_idle_chars, tx_idle_chars) self.send_program(prog)