Modbus slave addresses - 16369
Using Modbus slave addresses .
Using Modbus slave addresses.
Examples are valid for:
CB2 Software version: prior to 1.4
CB2 Software version: 1.8.16941
CB3 Software version: 3.1.17779
e-Series Software version: All versions
Note that older or newer software versions may behave differently.
There might be circumstances in which it is essential to be able to set specific slave addresses (slave number, slave ID) for the Modbus signals that you have set up by e.g. following the guide Set up Modbus communication - 16357
Since the slave address is not always needed, it is set to a default value of 255. In case you need the slave address for some signal to be set differently follow the steps below, depending on the SW version you are working with:
SW versions higher than 1.4
The “Show advanced options” check box on the Modbus client setup was introduced in the Polyscope SW version 1.4. Since then the Modbus slave address of each signal can be configured from there, just changing the default address 255 to the desired value on the corresponding box. As an example you might added an output signal named "out1" with IP address "154.140.1.12" and signal address "203", using the slave address “25”.
SW versions lower than 1.4
If you are working with a SW version lower that 1.4 then you must follow the following steps:
- Add the Modbus signal to your installation, specifying its IP address, signal address, signal type and name. When this is done, the signal connection will use slave address 255. As an example you might added an output signal named "out1" with IP address "154.140.1.12" and signal address "203".
- Make a new empty robot program.
- Select the Advanced tab from the Structure menu.
- Press "Script Code", and select the Command tab.
- In the text field, enter the script command "modbus_add_signal()", which takes arguments as described in the script manual found here. When using the script command to add Modbus signals, you have the opportunity to specify a custom slave address. If e.g. you want to change the slave address of your signal to 25, enter 25 as the second argument to the command. All other arguments must then match exactly the values you set up under step 1
- Push the "Play" button to run this little program that you just made.
- Now the signal will instead use the specified slave address as opposed to the value of 255 which was used when the signal was initially set up.
- In case you have more than one signal, you want to change the slave address of, you should add multiple script command lines in the small program, one for each signal to be changed.
NOTE:
Each time a robot program is run, the Modbus signals are reset. This means that if you have followed the steps above in order to change a slave address, and a program is then started, each signal will then again use the default slave address value of 255.
Therefore, it is important that you add the same script command lines as presented above to the very beginning of all robot programs in which you use Modbus signals which need a certain slave address value.