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.
- 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.
- 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.
- 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.
- Connect your Modbus unit to your network.
- Connect your robot to your network, and turn on your robot if it is not already running.
- 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).
- Select "Setup Network".
- Choose "Static Address".
- 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.
- Press the "Apply" button, and then check your settings by pressing "Update" afterwards. After updating, make sure that the settings are as intended.
- Press the "Back" button and then go to "Program Robot".
- 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.
- Press the large "+" button to set up communication with the Modbus unit you previously in this guide connected to your network.
- 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.
- 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.
- 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.
- Depending on the type of signal you chose, different views appear, but some fields are common and will now be explained.
- To the right of the signal type menu, you will see two fields and two "Keyboard" buttons.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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