Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 910 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 910 Bytes

Modbus_URCap

A tool modbus RTU URCap.

The URCap runs on port: 40408 on a daemon. Following script functions is added by this URCap:

  • init_tool_modbus(address) where port is string and address is an int.
  • tool_modbus_write(register_address, data) both parameter is an int.
  • tool_modbus_read(register_address) parameter is an int.

The RS485 settings is controlled with the built in function:

set_tool_communication(enabled,baud_rate,parity,stop_bits,rx_idle_chars,tx_idle_chars)

And tool supply voltage is controlled with:

set_tool_voltage(voltage)

An example script program (with OnRobot VGP20):

set_tool_voltage(24)
set_tool_communication(True, 1000000, 2, 1, 1.5, 3.5)

init_tool_modbus(65)

while True:
               tool_modbus_write(0,60)
               sleep(1)
               tool_modbus_write(0,0)
               sleep(1)
end