HomeKnowledgeOperating instructions for the XB6S-C01SP Slice serial Communication module in the Modbus protocol

Operating instructions for the XB6S-C01SP Slice serial Communication module in the Modbus protocol

2024-12-18
Operating instructions for the XB6S-C01SP Slice serial Communication module in the Modbus protocol

↑ Solidot Slice serial Communication moduleXB6S-C01SP

Temperature meters and weighing indicators used in the food and medical industries, pressure gauges used in the 3C industry, and variable frequency drives, which are most widely used in the automotive lithium battery and logistics industries, all communicate via the Modbus protocol. In practical applications, however, they cannot communicate directly with the fieldbus and require a module for relaying, so as to read the current state of the device or change its output state.

This is precisely the function of the Solidot Slice serial Communication module XB6S-C01SP: it can convert other bus protocols into a serial communication protocol. Based on the Modbus protocol, this document explains in detail the operating instructions of the XB6S-C01SP module under the Modbus protocol.

1. Definition of the Modbus protocol

The Modbus protocol is a general-purpose communication protocol that has been widely used in today's industrial control field. Through this protocol, controllers can communicate with each other or with other devices via a network (such as Ethernet).

2. Function of the Modbus protocol

A protocol generally defines the conditions and factors required for information transmission; it is a set of rules established to enable communication. For example, A needs to query B to obtain some states of B. A sends a set of data to B: 12345. After receiving this set of data, B replies to A: 54321. This completes one data exchange, but such data is not convenient to transmit using ordinary language or characters.

In this case, digital transmission becomes particularly important. However, the meanings represented by the digits must be defined in advance. The purpose of defining a protocol is to enable two parties to interpret a transmitted set of data according to that protocol, which gave rise to the Modbus serial communication protocol.

3. Modbus protocol modes

In practice, Modbus transmission is divided into 3 methods:

1. Modbus RTU

2. Modbus ASCII

3. Modbus TCP

All three protocols actually belong to the Modbus protocol, because their telegram formats are generally consistent. Among them, the RTU type is the most common serial form, and TCP refers to transmission over the Ethernet cable.

4. Modbus protocol Communication Methods

The Modbus protocol is a master-slave communication, meaning it requires a "question-and-answer" exchange. During communication, the slave responds only after the master sends a request command; if the master does not send, the slave does not respond. This is also a limitation of Modbus. When this "question-and-answer" mode can occur with one master corresponding to multiple slaves, each slave must be distinguished by giving it a "name", which is how the slave Station number came about.

5. Specific Expression Forms of the Modbus protocol

Modbus protocol frame structure = address + function code + data + Check

1. Address: the slave "name" mentioned earlier — the slave Station number

2. Function code: specifies what the command does — whether it is a query or an execute command

3. Data: used to fill in the location information for executing the specific command

4. Check: since errors may exist in the data Area, a check is added by calculating over all the data to verify the correctness of the transmitted telegram

6. Modbus protocol Examples

Now that we understand the composition of the Modbus protocol, let us analyze the following two examples — read and write:

[example 1] read Holding Registers (03)

Send: 01 03 00 00 00 02 C4 0B

Receive: 01 03 04 A0 B0 C0 D0 88 48

Send: Slave Station number (01) + read Holding Registers function code (03) + Modbus start register address (00 00) + number of Registers to read (00 02) + Modbus check code (C4 0B)

Receive: Slave Station number (01) + read Holding Registers function code (03) + total number of bytes read 2 * number of Registers (04) + read register data content (01 02 03 04) + Modbus check code (88 48)

[example 2] write Holding Registers (16)

Send: 01 10 00 10 00 03 06 01 02 03 04 05 06 5D D3

Receive: 01 10 00 10 00 03 81 CD

Send: Slave Station number (01) + write Holding Registers function code (10) + Modbus start register address (00 10) + number of Registers to write (00 03) + total number of bytes written (06) + write register data content (01 02 03 04 05 06) + Modbus check code (5D D3)

Receive: Slave Station number (01) + write Holding Registers function code (10) + Modbus start register address (00 10) + number of Registers to write (00 03) + Modbus check code (81 CD)

7. XB6S-C01SP module Operating instructions

Through the detailed explanation above, we now understand how the Modbus protocol is used. Next, we need to use the XB6S-C01SP module instead of a serial port to send telegrams and achieve information transmission between devices. Use the XB6S-C01SP module as the master, connect it to the PC with a serial communication cable, and use the function code telegrams from the cases above to control the ModbusSlave software (Modbus slave simulation) and to read telegrams with a serial debugging assistant, demonstrating —

1. First perform configuration. Here the EtherCAT protocol is used as an example, together with the Solidot XB6S-EC protocol Coupler XB6S-EC2002:

Operating instructions for the XB6S-C01SP Slice serial Communication module in the Modbus protocol

2. Configure the module parameters, setting the function, baud rate, stop Bit, Parity Bit and other parameters to match those of the serial device:

Operating instructions for the XB6S-C01SP Slice serial Communication module in the Modbus protocol

The definitions within the Node parameters are rather special and are the most important part of the configuration parameters. Fill in the required function code, address and other data according to the calculation table to obtain the final calculation:

No.     SubModule group                 SubModule       SubModule ID    Start Address (0000-FFFF)   Slave Station Number (1-247)            ExByte Flag

param1         param2

0 

Control&status

None

None

1 

Modbus Master Read Holding Registers

Read 2Regs

Ox0302

  0000 

1 

0: No exchange

Ox00000302

Ox0000001

2 

Modbus_Master_Write_Hold

Write 3 Regs

Ox0603

  0010 

1 

0: No exchange

Ox00100603

Ox00000001

Node_1_Param01 (302)

Node_1_Param02 (1)

Node_2_Param01 (1000603)

Node_1_Param02 (1)

3. Fill in the parameter data to be sent:

Operating instructions for the XB6S-C01SP Slice serial Communication module in the Modbus protocol

After setting the parameters, write them to the module. Open the serial assistant and you can see that the module automatically composes the example telegrams above and sends them out via the serial port.

4. Open ModbusSlave and switch to Holding register. The data sent by the module can now be read after address (00 10), and data A0 B0 C0 D0 can be written into the address; the data can also be read on the Coupler. Through the above operations, the XB6S-C01SP module replaces the need to write telegrams manually and enables communication with the device. The above is a detailed introduction to the operating instructions of the Solidot Slice serial communication module XB6S-C01SP in the Modbus protocol.

If you have any questions, please feel free to contact us. We will be glad to be of service!