MODBUS RTU-4 Input and Output Relay Manual

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

MODBUS RTU-4 Input and Output Relay Manual
MODBUS RTU-4 Input and Output Relay ManualFigure

1. Product Introduction

1.1. Product Introduction

The MODBUS-0404 series products are relay devices that use the standard Modbus RTU protocol and support RS485/232 or network communication. Supporting wide voltage power supply and multi-channel input/output control, it can be widely used in various application scenarios such as industrial production, agriculture, smart cities, office buildings, etc.

1.2. Working mode description

Users can modify the working mode of the configuration module in the upper computer software. Please note that the working modes supported by each model of equipment are.

1.2.1. Normal mode

After giving a command to open or close the relay, the relay will take corresponding actions and complete the opening or closing according to the command.

1.2.2. Flash on/off function

Flash off: When the relay is in the closed state, operate the relay to disconnect for a period of time (set parameter * 0.1s) and then it will automatically close;

Flashing: When the relay is in the disconnected state, operate the relay to close for a period of time (set parameter * 0.1s) and then it will automatically disconnect;

Note: The flashing on/off function is implemented by sending instructions and cannot be set using the upper computer software for mode settings. Support separate control of delay actions for a channel.

1.2.5. Local Interlock Mode

The module itself has a board module with optocoupler input and relay output. In this mode, every time the optocoupler inputs a signal, the corresponding relay will engage, and other optocouplers without input signals will disconnect their corresponding relays. Namely:

The optocoupler input signal takes effect ➞ the corresponding relay is engaged and other relays are disconnected;

Optocoupler input signal cancelled ➞ Relay does not operate.

This mode also has the delay problem of non lock mode, but the delay time will not exceed 0.05 seconds.

This mode is mainly used for external signal triggering to control the start and stop of different devices. For example, if a multi-channel optocoupler is connected to an external button and the corresponding relay is connected to an external electrical device, pressing one button will switch the corresponding device to the starting state, and other devices will stop running.

1.2.6. Dual machine non lock linkage mode

This mode requires two devices with the same address and mode to complete. After the two devices are connected through direct 485 or cross 232, the optocoupler status of module 1 will directly control the status of the corresponding relay of module 2. Namely:

The input signal of optocoupler 1 in module 1 is effective, and the relay 1 in module 2 is engaged;

The input signal of optocoupler 1 in module 1 disappears, and the relay 1 in module 2 is disconnected

The corresponding delay time of the relay in this mode is longer than the previous modes, but it will not exceed 0.1 seconds (9600 baud rate)

If a 485 bus is used in this mode, multiple devices can be connected in parallel, with each device matching its address, allowing for remote transmission of switch values. For example, if there are multiple low-speed switch signals on site that need to be transmitted to a control room 500 meters away to control alarm lights or electric bells, then only a few modules need to be arranged in the factory and connected to the corresponding modules in the room through two twisted pair shielded wires to complete the task. Similarly, the button signals for operating the computer room can also be directly transmitted to

Located on the relay of the computer room module.

1.2.7. Dual machine self-locking linkage mode

This mode requires two devices with the same address and mode to complete. After the two devices are connected through direct 485 or cross 232, the optocoupler status of module 1 will take effect and flip the corresponding relay status of control module 2, that is:

Module 1's input signal from optocoupler 1 takes effect ➞ Module 2's relay 1 flips;

The input signal of optocoupler 1 in module 1 disappears, and the relay 1 in module 2 does not operate

The application of this mode is similar to the "dual machine non lock linkage" mode, but it is more suitable for remote control of device start and stop, as long as

Installing a button on the operating end can achieve the action of pressing once to start and once to stop.

Product working mode diagram

2. Specification parameters

Product specifications and parameters

parameterExplanation
Working Voltage9-28V DC (supports anti reverse connection)
Equipment power consumption (W)12V power supply: not open:<0.5; Fully open:<324V power supply: not open:<0.5; Fully open:<3
power indicatorwith 1 red LED indicator
communication interfaceisolated RS485
communication protocolstandard Modbus RTU
baud rate1200240048009600 (default), 1920038400 can be modified through software
Default communication format9600, n, 8, 1
Device address0-255, 5-digit address dip switch can set 1-31 address codes, and those greater than 31 can be set through software;
IO interface4-channel DI (optocoupler isolation); 4-channel DO (normally open and normally closed, output terminal contact isolation)
Output contact capacity10A/30VDC or 10A/250VAC
Durability100000 times
Output indicationEquipped with 4-channel red LED indicator lights
Equipment size115 * 90 * 40mm
WeightApproximately 330g
Operating temperatureIndustrial grade, -40 ° C~70 ° C
Operating humidity5~85% RH
Product functionFlash on/off, computer upper computer control, local non lock linkage, local self-locking linkage, dual machine non lock linkage, dual machine self-locking linkage, local interlock mode
Software supportWork mode change; Relay independent control; Query of switch status; Relay overall control; Debugging information query; Control software; Support various configuration software; Support Labview, etc
Card rail installationStandard DIN35mm rail installation

3. Product dimensions

Product dimension diagram

4. Communication protocol and data format

4.1. Upper computer software download

"Langhand IO Controller Configuration Tool"

Software screenshot

4.2. Device communication configuration

4.2.1. Introduction to DIP switch function

Device address (slave address)=DIP address+software address

For example, if the DIP address is set to 11 and the software address is set to 110, then the device address is 121. Change address

needs to be powered off and restarted before it can take effect.

5-digit dip switch

The device is equipped with a dip switch for users to quickly modify the device address. When all five dialing codes are dialed to the top, it is the address "31"; When all five dialing codes are dialed to the bottom, it is the address "0";

When all five dialing codes are dialed to the top, it is the address "31";

(2) When all five dialing codes are dialed to the bottom, it is the address' 0 ';

(3) The leftmost 1 is the binary lowest bit;

(4) Dialing Address Table:

Dialing Switch Address

4.2.2. Software Address Setting and Reading

Click "Read" or "Set" after the software address below the upper computer software to read or set the software address of the device.

Software Address Setting

Device Address

4.2.3. Setting and Reading of Baud Rate

Click on "Read" and "Set" in the baud rate setting bar of the upper computer software to read and set the baud rate

and address respectively. After operation, the device needs to be restarted and the computer serial port settings need to be modified.

Baud rate setting

4.3. Communication protocol description

This product supports standard Modbus instructions. For detailed instruction generation and parsing methods, please refer to the register table in

in this article and refer to the "Modbus Protocol Chinese Version". This product supports Modbus RTU format.

4.3.1. Modbus Register Description

Coil Register Address Table:

Register Name PLC Register AddressDescription
Coil Control
Coil 1Write Coil 1 Instruction Code00001First Relay Output
Coil 200002Second Relay Output
Coil 300003Third Relay Output
Coil 400004Fourth Relay Output
Discrete Input
Input 1Switch No.2 Instruction100011st Input
Input 2100022nd Input
Input 3100033rd Input
Input 4100044th Input

Configuration Parameters

Register NameModbus Register AddressPLC Register AddressDescription
Communication baud rateHolding register03E8H41001Refer to the table below for the corresponding baud rate values. The default value is 0 and supports 0-5. This register also determines the communication baud rate for RS232 and RS485
Backup03E9H41002Backup, and users cannot write any values
Offset address03EAH41003Device Address=Offset Address+DIP Switch Address
Operating Mode03EBH41004Users can use, store user data

Remarks:

(1) Modbus device instructions support the following Modbus addresses:

00001 to 09999 are discrete outputs (coils)

10001 to 19999 are discrete inputs (contacts)

30001 to 39999 are input registers (usually analog inputs)

40001 to 49999 are hold registers (usually storing device configuration information)

Adopting a 5-bit code format, the One character determines the register type, and the remaining four characters represent the address. Address 1 starts from 0, such as 00001 corresponding to 0000.

(2) Baud Rate Value Correspondence Table

ValueBaud rate
09600
12400
24800
39600
419200
538400

(3) Relay status, query relay status and control through address 00001;

Switch status, query switch status through address 10002.

The register address follows the PLC naming convention, where the real address is obtained by removing the highest bit and then subtracting one.

4.3.2. Instruction List

Instruction NameRTU Format (hexadecimal)
Query Four Channel StatusFE 01 00 00 04 29 C6
Query Instruction Return InformationFE 01 00 61 9C
Control the first channel to openFE 05 00 00 FF 00 98 35
Control the return informationFE 05 00 FF 00 98 35
Control the first channel to closeFE 05 00 00 00 D9 C5
Control the return informationFE 05 00 00 00 D9 C5
Control the second channel to openFE 05 00 01 FF 00 C9 F5
Control the second channel to closeFE 05 00 01 00 88 05
Control the opening of the third channelFE 05 00 02 FF 00 39 F5
Control the closing of the third channelFE 05 00 00 78 05
Control the opening of the fourth channelFE 05 00 03 FF 00 68 35
Control the closing of the fourth channelFE 05 00 00 00 29 C5
Read the first channel optocouplerFE 02 00 00 01 AD C5
Return informationFE 02 01 00 91 9C
Read the 2nd optocouplerFE 02 00 01 01 FC 05
Read the 3rd optocouplerFE 02 00 01 0C 05
Read the 4th optocouplerFE 02 00 03 00 01 5D C5

4.3.3. Instruction Explanation

4.3.3.1. Relay Output

Control the 1st relay (taking the 1st channel as an example, refer to this example for other channels)

Send Code: FE 05 00 00 00 FF 00 98 35

FieldMeaningRemark
FEDevice addressThis is the broadcast address
0505 instructionSingle control instruction
00 00AddressTo control the relay register address
FF 00InstructionThe action of closing the relay
98 35CRC 16CRC 16 checksum for the first 6 bytes of data

Relay module return information:

Return code: FE 05 00 00 FF 00 98 35

fieldmeaningRemark
FEDevice addressThis is the broadcast address
0505 instructionSingle control instruction
00 00AddressTo control relay register address
FF 00InstructionRelay closing action
98 35CRC 16CRC 16 checksum of the first 6 bytes of data

4.3.3.2. Relay status

Relay query

Send instruction code: FE 01 00 00 04 29 C6

FieldMeaningRemarks
FEEquipment AddressHere is the broadcast address
0101 InstructionQuery Relay Status Instruction
00 00Starting AddressFirst Relay Register Address to be queried
00 04Query QuantityNumber of Relays to be queried
29 C6CRC 16CRC 16 checksum of the first 6 bytes of data

Relay return information:

Return code: FE 01 00 61 9C

FieldMeaningRemarks
FEDevice address 
0101 instructionReturn instruction. If the query is incorrect, return 0x81
01byte countReturn all bytes of status information.  1+(n-1)/8
00Query statusThe return value is hexadecimal, converted to binary data, with 0 indicating off and 1 indicating on. For example, if the return field of a 4-channel relay is 08 and converted to binary 1000, then the 1st, 2nd, and 3rd channels will be turned off and the 4th channel will be turned on.
61 9CCRC 16CRC 16 checksum of the first 6 bytes of data

4.3.3.3. Optocoupler input

query optocoupler

Send instruction code: FE 02 00 00 00 04 6D C6

FieldMeaningRemarks
FEDevice Address 
0202 InstructionQuery Discrete Input (Optocoupler Input) Status Instruction
00 00Starting AddressRegister Address of the First Optocoupler to be queried
00 04Query QuantityOptocoupler Status to be queried
6D C6CRC 16CRC 16 checksum for the first 6 bytes of data

Optocoupler return information:

Return code: FE 02 01 00 91 9C

fieldmeaningRemark
FEDevice address 
0202 instructionReturn instruction. If the query is incorrect, return 0x82
01byte countReturn all bytes of status information.
     00and the optocoupler status returned by. Bit0: First optocoupler status Bit1: Second optocoupler status... Bit7: Eighth optocoupler status
919CCRC 16CRC 16 checksum of the first 6 bytes of data

4.3.3.4. Flash on/off command

Flash off sending code: FE 10 00 03 00 02 04 00 0A 41 6B

Flash development sending code: FE 10 00 03 00 02 04 00 0A A1 6A

FieldMeaningRemarks
FEDevice addressHexadecimal, representing decimal 254 broadcast address
1010 InstructionsWrite multiple register function codes
00 03Relay address3+5 (n-1), n represents which channel to control, decimal needs to be converted to hexadecimal
00 02Control the number of instructions2+5 (n-1), where n represents the number of controlled channels and only supports controlling the delay action of one channel separately
04Control the byte length of content4+10 (n-1), where n represents the number of channels to be controlled and only supports the delay action of controlling one channel separately
00 04 or 00 02Instruction00 04 is the flash close command and 00 02 is the flash open command
00 0AFlash off time00 0A is converted from hexadecimal to decimal, which is 10. The interval time is (0.1 seconds * 10)
41 6B or A1 6ACRC 16check digit

Return code: FE 10 00 03 00 02 A5 C7

fieldmeaningRemark
FEDevice address 
1010 InstructionsReturn instruction. If the query is incorrect, return 0x82
00 03Device addressQuery the address of the device
00 02Number of accepted commandsThe number of instructions received by the device
A5 C7CRC 16check digit

Example: 1 second off/off time

Channel 1 Flash Closed FE 10 00 03 00 02 04 00 04 00 0A 41 6B

2-channel flashing closure FE 10 00 08 00 02 04 00 04 00 0A 00 D8

3-channel flash closure FE 10 00 0D 00 02 04 00 04 00 0A C0 E7

4-channel flash closure FE 10 00 12 00 02 04 00 04 00 0A 81 AB

Channel 1 flashes FE 10 00 03 00 02 04 00 02 00 0A A1 6A

2-channel flashing FE 10 00 08 00 02 04 00 02 00 0A E0 D9

3-channel flashing FE 10 00 0D 00 02 04 00 02 00 0A 20 E6

4-channel flashing FE 10 00 12 00 02 04 00 02 00 0A 61 AA

4.3.3.5. Fully open and fully close command

Full development code: FE 0F 00 00 04 01 FF 31 D2

Total disconnection sending code: FE 0F 00 00 04 01 00 71 92

fieldmeaningRemark
FEDevice address 
0F0F instructionReturn instruction. If the query is incorrect, return 0x82
00 00starting address 
00 04Control quantityNumber of relays controlled
01byte countNumber of instruction bytes sent
FF (or 00)Fully open (fully closed) commandFF fully open command; 00 full close instruction
31 D2 (or 71 92)CRC 16check digit

Complete disconnection and full open return code: FE 0F 00 00 04 40 07

fieldmeaningRemark
FEDevice address 
0F0F instructionReturn instruction. If the query is incorrect, return 0x82
00 00starting address 
00 04quantityNumber of relays returning information
40 07CRC 16check digit

4.4. Proactively report protocol

This function is a non-standard Modbus protocol and can only be used in dual machine mode. It is suitable for serial port relays to actively report changes in switch values.

FieldMeaningRemarks
0x40 0x57Header 
0x01Device Address 
0x02IO Status Low Eight Bits 
0x00IO Status High Eight Bits 
0x42+0x01+0x02+0x00Check Bit0x42+Device Address+IO Status Low Eight Bits+IO Status High Eight Bits

5. Electrical Wiring

5.1. Product Usage Topology

5.2. Product Terminal Definition

Product Terminal Definition

Serial NumberPinDescription
1+Positive pole of power supply
2-Negative pole of power supply
3A+RS485 A+
4MODBUS RTU-4 Input and Output Relay ManualFigure1-RS485 B -
5VINUsed for short circuiting VIN and COM+when passive input, please refer to the input wiring diagram
6COM+Used for short circuiting VIN and COM+when passive input, please refer to the input wiring diagram
7IN11st switch input
8IN2Second switch input
9IN3Third switch input
10IN4Fourth switch input
11COM -Used for passive input, please refer to the input wiring diagram
12Normally openFourth relay output normally open
13Common terminalFourth relay output common terminal
14Normally closedFourth relay output normally closed terminal
15Normally OpenThe output of the third relay is normally open
16Public EndThird relay output common terminal
17normally closedThe output of the third relay is normally closed
18Normally OpenThe second relay output normally starts
19Public EndSecond relay output common terminal
20normally closedSecond relay output normally closed terminal
21Normally OpenThe first relay output normally starts
22Public EndThe first relay output common terminal
23normally closedThe first relay output is normally closed terminal

5.3. Product input wiring diagram

5.4. Product output wiring diagram

6. Product maintenance and upkeep

6.1. Equipment usage environment

  1. The working voltage of the equipment is 9~28V. If the input voltage is too high or too low, it may cause the equipment to malfunction or even malfunction

Damaged.

2. The DI input terminal of the device adopts optocoupler isolation protection, with a carrying voltage of 5~24V.

3. It is strictly prohibited to overload the DO output terminal of the device. Please wire it correctly within the allowed range (see wiring diagram for details).

4. The equipment is allowed to have an air humidity of 5~85% RH and does not have waterproof capability. In condensation or liquid immersion environments, please

Do not use this product.

5. Relays are components with a certain service life. When the theoretical service life is reached, please replace them in a timely manner to avoid occurrence

danger

6.2. Common Problems and Solutions

(1) 232 Communication, Device Control Has No Response, Does Not Act

The device communicates with the upper computer using a 232 direct connection. RX to RX, TX to TX, GND to GND. (2) Relays can only be turned on, not off

Check whether the read address is the actual device address, whether there is a return command in the debugging information column, and whether the return command is correct. If the read address fails, there is no return command or the return command is abnormal, check the communication line and communication converter.

(3) The relay board cannot establish communication and control using the 485 interface after power supply.

1. Whether the 485 line is reversed and whether the voltage is within the specified range;

2. Fill in the device address of 254 on the software and test whether different baud rates can be controlled.

(4) Multiple devices mounted on the 485 bus failed to send relay closing operation at broadcast address 254.

Broadcast address is used to test when there is only one device on the bus. If there are more than one device, please use a dip switch to distinguish the address and control it, or set the address through software (multiple devices are configured with different addresses), otherwise it will cause all devices to respond simultaneously and cannot be executed correctly.

(5) PLC and equipment cannot communicate normally.

1. Whether the PLC communication parameters match the relay equipment;

2. Is the PLC communication protocol standard Modbus RTU;

3. The definition of Siemens 485 bus AB is opposite to that of this device.

(6) How to restore factory settings

For models with dip switches, the dip switch can be used to restore factory settings. The operation steps are as follows: when powered on, all dip switches should be turned on, and bit5 should be used to respond 6 times (one time, one response counts as one time). Then, all dip switches should be turned off, and the upper computer software (baud rate 9600, address 254) can be used for communication

7. After sales service

7.1. After sales service commitment

Our company provides after-sales service for this machine within one year from the date of sale, but does not include damage caused by improper use. If repair or adjustment is needed, please send it back, but the shipping cost will be borne by yourself. When returning, it is necessary to ensure that the packaging is good to avoid damage during transportation. Our company will provide free repair for any damage to the instrument.

7.2. Disclaimers

This document does not grant any intellectual property license, nor does it grant any intellectual property license, express or implied, or by prohibiting speech or other means. Our company assumes no other responsibility except for the responsibility stated in the sales terms and conditions of its products. And our company makes no express or implied warranties regarding the sale and/or use of this product, including warranties of specific suitability for a particular purpose, merchantability, or liability for infringement of any patent, copyright, or other intellectual property rights. Our company may make modifications to product specifications and descriptions at any time without prior notice.

7.3. contact information

Address: 218 Skyway Creative Building, No. 25 Huangxu Road, Tiangongyuan Street, Daxing District, Beijing

Website: www.modbus.cn

Email: cloud@modbus.cn

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.