0% found this document useful (0 votes)
731 views

Intro To MiRModbusTCP

This document discusses using Modbus TCP to control and monitor a MiR robot. It describes the functionality available over Modbus including controlling robot status, getting information, and manipulating registers. It explains how Modbus works with the robot acting as a slave device and potential masters polling data. It provides details on object types, address ranges, data encoding, and includes examples using Modbus Poll software to simulate control and monitoring of the robot.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
731 views

Intro To MiRModbusTCP

This document discusses using Modbus TCP to control and monitor a MiR robot. It describes the functionality available over Modbus including controlling robot status, getting information, and manipulating registers. It explains how Modbus works with the robot acting as a slave device and potential masters polling data. It provides details on object types, address ranges, data encoding, and includes examples using Modbus Poll software to simulate control and monitoring of the robot.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Intro to MiR Modbus TCP

The functionality of MiR Modbus


To control status of the robot
Pause/Continue, Cancel current mission, Clear mission queue, Clear error message.
To get basic information from the robot
Status, power percentage, error message, etc.
To manipulate registers in the robot
Read and write integer and float register.
To trigger a preset mission

How MiR Modbus work


The Modbus server is running on the robot and broadcasting on both local network IP (192.168.12.20) and external wifi IP address. It is listening
on the standard port 502 for commands from outside devices. Usually, the device would be a PLC acting as the master device and the MiR robot
would be the slave device. The master device is the one in charge of polling the data.

Potentially an unlimited amount of masters could retrieve and send data from/to the robot. Each client/server communication is threaded.

The data is cached to avoid a high-frequency load of requests on the API while providing with a response to any request.

Address and data types


Object types
The following is a table of object types provided by a Modbus slave device to a Modbus master device:

Object type Access Size Address range

Coil Read-write 1 bit 0xxxx

Discrete input Read-only 1 bit 1xxxx

Input register Read-only 16 bits 3xxxx

Holding register Read-write 16 bits 4xxxx

In the MiR robot, the content of Coil and Discrete input are match with each other, so as the Input register and Holding register. So you can get
the same data from them. But only Coil and Holding register can be send information to.

In the representation of the address, some PLC would use the full 5 digits address while others will only use the last 4 digits since it knows the
object type already.

Address allocation

Functionality Address range Data type

Control robot status 00001 - 00005 Coil

Mission trigger 01001 - 02000 Coil

Get robot's information 40001 - 40019 Holding register

Integer register 41001 - 41200 Holding register

Floating register 42001 - 42200 Holding register

Integer register
MiR robot saves the integer in 32 bits but the modbus communications are 16 bits encoded. So in modbus, two addresses are combined to
represent one integer value in the robot. And MiR modbus uses big endian encoding as standard configuration. This method is applied to all of
the integer registers and integer values of robot's information.

Floating register
MiR modbus use IEEE 754 ISO standard to encode floating point values.

Address offset
Due to some historical reason, the address received in the server would be the number minus 1. For example if you are writing to address 41001,
the address received in the server would be 41000.

"A workaround has been implemented to deal with this situation BUT if another PLC sends the addresses differently we can face an offset of 1
FOR ALL of the Modbus communications."

Please be aware of this culprit.

Modbus simulation software


Modbus Poll
http://www.modbustools.com/modbus_poll.html

Modbus Poll is a modbus master simulator and it is a licensed software with a 30 days free trial. Within the trial period, there is a 10 minutes from
connection limit. After 10 minutes the connection is disconnected. Re-starting the application will initiate another 10-minutes demonstration period.
A single-user license would cause $129.

The example project


After you installed Modbus Poll, you can open the project file MiR_Modbus.mbw. Then the project will load all 4 configuration files ended with
.mbp inside the simulator.

Set up the connection

Turn on the modbus feature on MiR


Log in to the robot's interface, go to System > Settings > Features, select True for the Modbus then click save.

Connect Modbus Poll to MiR


In the drop menu of Modbus Poll, choose Connection, Connect... to start the connection. Then the registration window will pop up. You can
purchase the license and input the key at here or just choose OK to buy later.

Then you can setup the connection by choosing Modbus TCP/IP in the connection drop menu, then input the IP of the robot at the bottom, make
sure the Server Port is 502, then click OK to connect the robot. The data in the form should be updated to your robot now.
And you can check the connection from the robot interface. Just go to Monitoring > Hardware health > Modbus.

Control robot's status


The form to the up-left corner named mir_command.mbp is to control the status of the robot. You can choose Read/write Definition from the
right-click menu to check the definition of the form.

The function is been set to Read Coils 0x, and the PLC Addresses (Base 1) is been checked to compensate the address offset. The form reads 5
objects from the address 1, which is from 00001 to 00005.

You can double-click a value cell to change its value. For example you can double click the cell at address 2 to change the robot's status to
Pause. The robot will perform the command and set the value back to 0.

Get robot's information


The form to the bottom-left named mir_status.mbp shows the status information of the robot. From the Read/Write Definition you can see the
function is been set to Read Holding Registers, so the data address must starts with 4x. Then it reads from address 40000 to 40019. I'm not
checking the PLC Addresses (Base 1) so this form probably doesn't match the address what you thought.
When representing data, the row of Error Code, Uptime and Length Driven, etc are all using two 16-bits addresses to represent 32-bits integer.
Right click from the Format menu, you can see the data shown in the table is Unsigned integer.

Read/Write robot registers


For the matter of address offset and how the modbus storing the 32-bits integer, when you set value at 41001, the result will be shown at 41000.
Trigger a preset mission
Before you can trigger a mission by modbus, you need to link the Modbus address to the preset mission. Then Coil address 1001 - 2000 are for
mission triggering. You can do the settings at System > Triggers.

After you've done the triggers setting, you can call up the mission from Modbus Poll.

Python test script and Click PLC Demo project

You might also like