0% found this document useful (0 votes)
12 views3 pages

Homework

The document provides examples of Modbus RTU, ASCII and TCP request and response messages with interpretations. It asks to write out messages for reading and writing registers and inputs, and interpret additional example requests and responses by specifying what is requested from which slave devices and what the responses contain.

Uploaded by

s129006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views3 pages

Homework

The document provides examples of Modbus RTU, ASCII and TCP request and response messages with interpretations. It asks to write out messages for reading and writing registers and inputs, and interpret additional example requests and responses by specifying what is requested from which slave devices and what the responses contain.

Uploaded by

s129006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Sultan Qaboos University

College of Engineering
ECE Department

Industrial Networks and Operating Systems (ECCE5231)


Spring 2024
Homework

Problem: 1

For each of the following request and response messages, write it in the form of Modbus RTU,
Modbus ASCII, and Modbus TCP and the number of total bytes in each message.

 For Modbus ASCII, you can assume any valid value (one byte/two ASCII Character) for
LRC.
 For Modbus RTU, you have to calculate the CRC value using CRC-calculator which can
be downloaded from the link: http://www.simplymodbus.ca/crc.xls
 For Modbus TCP, you can assume any valid value (2 bytes) of transaction ID for request
and response messages.
 For example request and response messages, you can refer
http://www.simplymodbus.ca/FAQ.htm

1. Request: Read 20 inputs starting at discrete input number 12001 from a slave device with
address 90.

Response: The discrete input number 12002, 12009 and 12015 are set (1) and all others are clear
(0).

Protocol Request Total Response Total


Bytes Bytes
Modbus
RTU 5A 02 07 D0 00 14 75A3 8 bytes 5A 02 03 02 41 00 E4F5 8 bytes

Modbus
ASCII 3A 3541 3032 3037 4430 17 bytes 3A 3541 3032 3033 3032 3431 17 bytes
3030 3134 4339 0D 0A 3030 3641 0D 0A
Modbus
TCP 00 12 00 00 00 06 5A 02 07 12 bytes 00 12 00 00 00 06 5A 02 03 02 12 bytes
D0 00 14 41 00
Sultan Qaboos University
College of Engineering
ECE Department

2. Request: Read 4 input registers starting at register number 31040 from a slave device with
address 42. Response returns register 31040 value 10000, and register 30202 value 50000:

Response: Return the contents of register number 31040 to 31043 and the contents of register
31040 to 31043 are B170, A27D, 11CC, A213 respectively.

Protocol Request Total Response Total


Bytes Bytes
Modbus
RTU 2A 04 04 0F 00 04 C6E1 8 bytes 2A 04 08 B170 A27D 11CC 13 bytes
A213 9970

Modbus 3A 3241 3034 3038 4231 3730


ASCII 3A 3241 3034 3034 3046 17 bytes 4132 3744 3131 4343 4132 3133 27 bytes
3030 3034 3939 0D 0A 4237 0D 0A
Modbus
TCP 00 12 00 00 00 06 2A 04 04 12 bytes 00 12 00 00 00 0B 2A 04 08 B1 17 bytes
0F 00 04 70 A2 7D 11 CC A2 13

Problem: 2

Interpret the following request message by specifying precisely what is requested from which
slave devices?
Modbus ASCII Request: 3A 30 31 30 36 30 30 36 34 33 41 39 38 43 33 0D 0A

ASCII Hex 3A 30 31 30 36 30 30 36 34 33 41 39 38 43 33 0D 0A
Hexadecimal : 0 1 0 6 0 0 6 4 3 A 9 8 C 3
Format Start Slave Function Register address Data address LRC End
address code (100) (15000)
(1)

What will be corresponding Modbus ASCII response of above request message if request is successfully
fulfilled by slave device?

Hexadecimal : 0 1 0 6 0 0 6 4 3 A 9 8 C 3
Sultan Qaboos University
College of Engineering
ECE Department

Format Start Slave Function Register address Data to be LRC End


address code (100) written (15000)

ASCII Hex 3A 30 31 30 36 30 30 36 34 33 41 39 38 43 33 0D 0A
Modbus ASCII Response: 3A 30 31 30 36 30 30 36 34 33 41 39 38 43 33 0D 0A

Problem: 3

Interpret the following request and response message by specifying precisely what is requested
from which slave devices? and what was the response?
Modbus TCP Request: 00 0F 00 00 00 06 01 03 02 58 00 02

TCP 00 0F 00 00 00 06 01 03 02 58 00 02
Format Transaction Protocol Id Length Slave Function Data Number
Id (15) (6 bytes) addres code address of input
s (1) (Read (600 + registers
holding 40001offse (2)
register) t = 40601)

Modbus TCP Response: 00 0F 00 00 00 07 01 03 04 03 E8 13 88

TCP 00 0F 00 00 00 07 01 03 04 03 E8 13 88
Format Transaction Protocol Length Slave Function Length First Second
Id (15) Id (7 bytes) address code (4 register register
(1) (Read bytes) address address
holding (1000) (5000)
register)

You might also like