Home Programming

Discussion

Left ArrowBack to discussions page
james77james77 Posts: 10 Apprentice
Let's say there's an encoder and PLC (for example) calculates distance the encoder moved.
The calculated distance is transmitted using MODBUS. Is it possible to UR to get the integer/float distance value using MODBUS?

Thank you

Best Answer

Comments

  • matthewd92matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
    The only way is to multiply it and send as an integer and then divide on the robot side. That’s the same way UR does stuff such as joint angles in modbus. They send the angle in milliradians and then you need to divide by 1000 to convert to radians for consume them. 

    Just need to decide what your precision can be since the integer is limited in modbus. 

    If you’re using a PLC can you use Ethernet IP or Profinet instead?  Then you have float registers you can write to
  • james77james77 Posts: 10 Apprentice
    The only way is to multiply it and send as an integer and then divide on the robot side. That’s the same way UR does stuff such as joint angles in modbus. They send the angle in milliradians and then you need to divide by 1000 to convert to radians for consume them. 

    Just need to decide what your precision can be since the integer is limited in modbus. 

    If you’re using a PLC can you use Ethernet IP or Profinet instead?  Then you have float registers you can write to
    Yes I do have the Ethernet. Then to pass the float values from PLC to robot, which function in URscript will be used? It seems there's few different functions that reads input from registers.
    Besides Ethernet IP/Profinet (let's consider MODBUS is only option), is it impossible to do the same with the MODBUS?
  • james77james77 Posts: 10 Apprentice
    With EthernetIP/Profinet you would store the value directly in the register with the PLC then the robot would use one of the read methods such as read_float_register(n) (name may be slightly different) to read the value. 

    With modbus you would have to convert the number to an integer and then convert it back on the robot. Easy enough to do. Modbus is just limited on what can be transmitted. It’s an integer based system. It’s a fairly old protocol and also slow. If you need the value for real time control the other fieldbus protocols are much faster, think 5X or 10X faster. We’ve recorded round trip write to read, so robot writes to a register, PLC reads it and writes to a register which the robot receives and reads in the 40ms range. Modbus was around 300-400 ms. 
    So for MODBUS, modbus_get_signal_status would work then?
Sign In or Register to comment.
Left ArrowBack to discussions page