Modbus communication - 16357

Guide on how to set up Modbus communication channels on the robot.

Examples are valid for:
CB2 Software version: 1.8.16941
CB3 Software version: 3.1.17779
Note that older or newer software versions may behave differently.

If you experience problems when connecting robot (Client) to external device (Master), consult this ModBus client troubleshooting - 16374

This guide will take you through the steps needed to successfully using the Modbus communication feature of the Universal Robots PolyScope user interface. Images shown on this page are only presented as examples and the specific values, signals, names, connections, addresses and so forth are only for illustrative purpose.

  1. Verify that your Modbus unit supports function codes 1, 2, 3, 4, 5 and 6, since these function codes are used by the robot to communicate with the Modbus unit.
  2. Check the IP address of your Modbus unit. It is most likely that this address is user configurable, so you might want to change it to some prefered value.
  3. Carefully study the process image of your Modbus unit. This might also be configurable, so verify the addresses of your extension modules (and signals connected to those) in the process image.
  4. Connect your Modbus unit to your network. 

Modbus

  1. Connect your robot to your network, and turn on your robot if it is not already running.
  2. If you have a program running on the robot, stop this and go to the "Setup Robot" screen from the "PolyScope Robot User Interface" screen (Welcome screen).
  3. Select "Setup Network".
  4. Choose "Static Address".
  5. Select an IP address and a subnet mask which matches the network configuration of your Modbus unit. Most important you must make sure that the Modbus unit and the robot are on the same subnet. Contact your network administrator if this causes problems. 

Setup Network

  1. Press the "Apply" button, and then check your settings by pressing "Update" afterwards. After updating, make sure that the settings are as intended.
  2. Press the "Back" button and then go to "Program Robot".
  3. Choose the "Installation" tab and press "MODBUS client" in the menu on the left. Now you see the main screen for setting up the Modbus communication. On this screen, as well as others, you may press "?" button to show the online manual, which will also describe the various fields and buttons.
  4. Press the large "+" button to set up communication with the Modbus unit you previously in this guide connected to your network.
  5. Now an IP address field and a "Keyboard" button appears. Use the button to change the IP address to the one of your Modbus unit.
  6. When the IP address has been set correctly, you can add a signal that you want to supervise (input) or control (output). This is done by pressing the small "+" button which has now appeared inside the box together with the IP address field. You will then see a line with a few fields and options.

Setup Client 1

  1. First, from the menu showing "Please select" select what kind of signal you want to add to your Modbus unit. Note: Digital inputs and outputs are equivalent with the Modbus technical term "discrete coils". Register inputs and outputs can be used to read and/or write any register in the process image of your Modbus unit.
  2. Depending on the type of signal you chose, different views appear, but some fields are common and will now be explained.
  3. To the right of the signal type menu, you will see two fields and two "Keyboard" buttons.
  4. The first field and button you use to set the address of the signal you have just added. In Modbus manuals, addresses are typically written in hexadecimal, but here the address must be given as a normal base-10 number. This will most likely force you to convert your hexadecimal process image addresses to base-10. Note: This is the point, where it is very important that you know your process image, such that the address you enter here, will correctly be associated with the right signal on one of your extension modules.
  5. The second field and button you use to give your signal a unique name which explains the meaning of the signal, e.g. "pumpOn". This will be an advantage when using signals in your robot programs. Note: The name must at maximum contain 15 characters and must start with a letter.
  6. At the very left you will see a round icon. The colour of this icon will be either grey or green. Grey means that there is no contact with the signal and green means that the signal is "alive" and that you can supervise or control it as desired. Only signals with a green icon can be used in a robot program.
  7. At the very right you will see some "-" buttons. These can be used to delete a signal from your Modbus unit or to delete a complete Modbus unit with all its signals.
  8. At the upper right corner there is a typical "refresh" button. This can be used to update the connectivity status of all signals present on the screen. Signals that are correctly connected to the network and also correctly configured on this screen, pressing the "Refresh" button, will make their respective icon on the left turn green.
  9. Now the differences between the four signal types on this screen will be explained. They all applies to the fields that appear between the round icon and the signal type menu:
    Digital input: An indicator will appear which shows the current status of the discrete input signal, i.e. either it is on or off.
    Digital output: A button will appear with which you can set and view the current status of the discrete output signal.
    Register input: A field with a number will appear. The number in this field is the current value of the input register. Note: This value is written as a base-10 number.
    Register output: A field and a "Keyboard" button appear. The field showing the value currently written to the output register. The button is used to change the value of the value to write to the register. 

Setup Client 2

Now, you can add additional signals to the Modbus unit by following this guide from step 14 onwards. The maximal allowed number of Modbus signals is 56, but this also depends on the device you are connecting to the robot. Some devices can run +40 signals while others are only capable of running <10 signals, depending on the update frequency selected. 

You can also add more Modbus units by again pressing the large "+" button. Make sure that if you do this, the IP address of all Modbus units you want to communicate with, and also the robot, must be on the same subnet. 

If you have successfully configured the communication with your Modbus Units and signals, you may want to use them in a program. How to do this is presented here: Using Modbus signals in robot programs - 16363

Want to get notified about updates?

You are welcome to sign up for notifications about new relevant information and articles that could be interesting for you.

Universal Robots A/S needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at anytime. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, check out our Privacy Policy.

Need help?

Did you find what you needed on this site? For additional information please contact one of our distributors.