Update urrobot.py

This commit is contained in:
Byeongdulee 2023-07-26 07:52:08 -05:00
parent 80e0c2e917
commit 96ec077236

View File

@ -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)