4 in 4 out Modbus RTU relay module manual

freeFree Technical Resource

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

4 in 4 out Modbus RTU relay module manual

Product Features

30001 to 39999 are input registers (usually analog inputs)

Relay output contact isolation;

Communication baud rate: 2400,4800,9600,19200,38400 (Can be modified through software, Default9600) ;

Communication protocol: Support standardsmodbus RTUagreement;

Can be set0-255Device address, 5The address dip switch can be set1-31Address code, Greater than31It can be set up through software;

Capable of flashing, Flashing function, You can include parameters in the instruction, Operate the relay to automatically turn off after a period of time; Equipped with strobe function, Can control the periodic switching of relays.

Product functionality

Four way relay control;

Four channel switch input;

Support manual control through computer software;

Support local non lock linkage mode;

Support local self-locking linkage mode;

Support interlock mode;

Dual machine non lock linkage mode;

Dual machine self-locking linkage mode;

Main parameters

Parametersexplain
Contact capacity10A/30VDC  10A/250VAC
Durability10Ten thousand times
Communication interfaceRS485
Rated voltageDC 7-30V
Power indicator1The road is redLEDinstructions (Always on when not in communication, Flashing during communication)
Output indication4The road is redLEDinstructions
Temperature rangeIndustrial grade, -40℃~85℃
Size115*95*41mm
Weight330g
Default communication format9600,n,8,1
Baud rate2400,4800,9600,19200,38400
Software supportSupporting configuration software, Control software; Support various configuration software; supportLabviewdWait
Main parameters

Interface description

4 in 4 out Modbus RTU relay module manualFigure

Input/output wiring

1, Relay wiring instructions

4 in 4 out Modbus RTU relay module manualFigure1

2, Schematic diagram of active switch wiring

4 in 4 out Modbus RTU relay module manualFigure2

3, Schematic diagram of passive switch wiring

4 in 4 out Modbus RTU relay module manualFigure3
4 in 4 out Modbus RTU relay module manualFigure4
Representative dry contact switch

Introduction to the address of the device dip switch

4 in 4 out Modbus RTU relay module manualFigure5

All five dialing codes have been dialed“ON”When in position, For the address“31”;

All five dialing codes have been dialed“OFF”When in position, For the address“0”;

The leftmost 1 is the binary lowest bit.

Address table:

4 in 4 out Modbus RTU relay module manualFigure6

Working mode

Introduction to working mode functions

Non lock linkage mode of this machine

A board module with optocoupler input and relay output, In this mode, The input optocoupler and relay are directly linked. That is: The optocoupler input signal takes effect—>Corresponding relay engagement, The optocoupler input signal is cancelled—>The corresponding relay is disconnected.

Due to mechanical and program delays in this mode, There will be a certain delay in the action of the relay when the optocoupler input signal is received, But the maximum will not exceed0.05Seconds.

Due to the fact that all relays in this mode are directly linked by optocouplers, So there may be a phenomenon where the serial port cannot operate the relay, This is not an abnormal phenomenon, But after operating the relay through the serial port, The status of the optocoupler was linked before the relay was activated.

Local self-locking linkage mode

The module itself is a board module with optocoupler input and relay output, In this mode, The optocoupler inputs a signal every time, Flip the corresponding relay once. That is:

The optocoupler input signal takes effect—>Relay flipping (Pull in and disconnect, Disconnect and switch to suction) ;

The optocoupler input signal is cancelled—>The relay does not operate;

This mode also has the delay problem of non lock mode, But the delay time will also not exceed0.05Seconds.

This mode can mainly be used in situations where external signals are triggered to control the start and stop of equipment, For example, an optocoupler with an external button, Corresponding relay external electrical equipment, Press the button every time, The device will switch between start and stop states once.

Interlocking mode

The module itself is a board module with optocoupler input and relay output, In this mode, The optocoupler inputs a signal every time, The corresponding relay will close, Other optocouplers without input signals will disconnect their corresponding relays. That is:

Optocoupler input signal takes effect—>The corresponding relay is engaged and other relays are disconnected;

The optocoupler input signal is cancelled—>The relay does not operate;

This mode also has the delay problem of non lock mode, But the delay time will also not exceed0.05Seconds.

This mode can mainly be used for external signal triggering to control the start and stop of different devices, For example, if there is no external button connected to a multi-channel optocoupler, Corresponding relay external electrical equipment, Press one button, The corresponding device will switch to the startup state, Other devices will stop running.

Dual machine non lock linkage mode

This mode requires two addresses to be the same, Devices with the same mode completed, Two devices are directly connected485Or cross232After connecting, The optocoupler status of module 1 will directly control the status of the corresponding relay of module 2, That is:

The input signal of optocoupler 1 in module 1 is effective—>The No.1 relay of module 2 is engaged

The input signal of optocoupler 1 in module 1 has disappeared—>The No.1 relay of module 2 is disconnected

The corresponding delay time of the relay in this mode is longer than the previous modes, But it will not be greater than0.1Seconds (9600Baud rate)

If used in this mode485If it is a bus, multiple devices can be connected in parallel, Among them, the addresses of the devices match pairwise, This can achieve remote transmission of switch values. For example: There are multiple low-speed switch values on site that need to be transmitted to500Control the alarm lights or electric bells in the control room located meters away, Then only a few modules need to be arranged in the factory and connected to the corresponding modules in the computer room through two twisted pair shielded wires, You can complete the task. Similarly, the button signals for operating the computer room can also be directly transmitted to the relays located in the computer room module.

Dual machine self-locking linkage mode

This mode requires two addresses to be the same, Devices with the same mode completed, Two devices are directly connected485Or cross232After connecting, The optocoupler status of module 1 will flip the corresponding relay status of control module 2 when it takes effect, That is:

The input signal of optocoupler 1 in module 1 is effective—>The No.1 relay of module 2 is flipped

The input signal of optocoupler 1 in module 1 has disappeared—>The No.1 relay of module 2 does not operate

The application of this mode and“Dual machine non lock linkage”Similar patterns, But it is more suitable for remote control of device start and stop, Simply install a button on the operating end to achieve the action of pressing once to start and once to stop.

Flashing function and settings

Introduction to flashing and disconnecting functions

Manual mode: Operate the relay every time, The relay flips once (Open when closed, Close when disconnected) ;

Flash mode: Operate the relay every time, The relay will close for 1 second (Actual time [in seconds]=set number*0.1) Then disconnect it on its own;

Flash mode: Operate the relay every time, The relay is disconnected1.Seconds (Adjustable time) Close it on its own afterwards;

Flashing and disconnecting settings

The flashing mode cannot be written into the device's interior, It can be achieved by sending instructions, This function can be achieved on the Juying configuration software.

4 in 4 out Modbus RTU relay module manualFigure7

Note:: The flashing mode cannot be written into the device chip, After selecting the flashing and disconnecting mode on the software, All channels are in flash off mode, Single channel control can be achieved by sending a flash off command for a single channel, Does not affect the normal control of other channels.

Development documentation description

Communication protocol description

This product supports standardsmodbusInstructions, Detailed instruction generation and parsing methods, You can refer to the Chinese version of the protocol based on the register table in this articleMODBUSThis product supports both.

Formatmodbus  RTU Register description

2, ModbusRegister name

FunctionRegister addressexplainCoil control
Coil
Write coils1The first relay output0x0001Coil
Write coils2Second relay output0x0002Coil
Write coils3Third relay output0x0003Coil
Write coils4Fourth relay output0x0004Discrete input
Input
Switching quantity1The first input1x0001Input
Switching quantity2Second input1x0002Input
Switching quantity3Third input1x0003Third input
Input4Switching quantity1x0004Fourth input
Configure parameters
Communication baud rateMaintain registers4x1001Refer to the table below for the corresponding baud rate values, The default is0, support0-5
spareMaintain registers4x1002spare, Users are not allowed to write any values.
Offset addressMaintain registers4x1003Device address=offset address+dip switch address
Working modeMaintain registers4x1004Users can use it, Store user data
Delay timeMaintain registers4x1005Users can use it, Store user data

remarks:

①: ModbusThe device instructions support the following:ModbusAddress:

00001To09999It is a discrete output (Coil)

10001To19999It is a discrete input (Contact point)

30001To39999It is an input register (Usually it is an analog input)

40001To49999It is to maintain registers (Usually storing device configuration information)

Adopting a 5-digit code format, The first character determines the register type, The remaining 4 characters represent the address. Address 1 starts from 0, Like00001corresponding0000.

Table of baud rate values correspondence

Numerical valueBaud rate
09600
12400
24800
39600
419200
538400

③: Relay status, Through30002The address can be queried, It can also be done through00001---00002Address inquiry, But control can only be used00001---00002Address.

30002The length of the address data is16bit. Can represent at most16A relay.

The corresponding results are as follows::

Bit1514131211109876543210
Relay position87654321161514131211109

Namely registers30009Databit8 And registers00001The data is the same.

Similarly: The same goes for optocoupler input. Register30003of And registersbit8, bit9 All correspond to designated hardware10001, 10002Register address according to.

Naming rulesPLCThe real address is to remove the highest bit, Then subtract one, Instruction list.

explain

FormatRTUBinary transmission (16Query the status of four channels)
Query command returns informationFE 01 00 00 00 04 29 C6
Control the opening of the first routeFE 01 01 00 61 9C
Control return informationFE 05 00 00 FF 00 98 35
Control the first passFE 05 00 00 FF 00 98 35
Control return informationFE 05 00 00 00 00 D9 C5
Control the opening of the second pathFE 05 00 00 00 00 D9 C5
Control the second passFE 05 00 01 FF 00 C9 F5
Control the opening of the third pathFE 05 00 01 00 00 88 05
Control the third passFE 05 00 02 FF 00 39 F5
Control the opening of the fourth routeFE 05 00 02 00 00 78 05
Control the fourth passFE 05 00 03 FF 00 68 35
Read the first optocouplerFE 05 00 03 00 00 29 C5
Return informationFE 02 00 00 00 01 AD C5
Read the second optocouplerFE 02 01 00 91 9C
Read the third optocouplerFE 02 00 01 00 01 FC 05
Read the fourth optocouplerFE 02 00 02 00 01 0C 05
InstructionsFE 02 00 03 00 01 5D C5

Detailed explanationRelay output

Relay inquiry

    Road relay (4Send command code)

Fields: FE 01 00 00 00 04 29 C6

meaningremarksEquipment address
FEThis is the broadcast addressInstructions
0101Query relay status commandStarting address
00 00The first relay register address to be queriedQuery quantity
00 04The number of relays to be queriedThe first 6 bytes of data
29 C6CRC16ChecksumCRC16Relay card returns information

Return code:

Fields: FE 01 01 00 61 9C

meaningremarksDevice address
FEDevice address 
0101InstructionsReturn instruction: If the query is incorrect, return0x81
01Byte countReturn all bytes of status information. 1+(n-1)/8
00Query statusReturn relay status. Bit0:The first relay statusBit1:The second relay status. . . . . . . Bit7:The eighth relay status
61 9CCRC16The first 6 bytes of dataCRC16Checksum

Optocoupler input

Query optocoupler (4Road optical coupling)

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

Fieldsmeaningremarks
FEEquipment address 
0202InstructionsQuery discrete input (Optocoupler input status command
00 00Starting addressThe register address of the first optocoupler to be queried
00 04Query quantityThe number of optocoupler states to be queried
6D C6CRC16The first 6 bytes of dataCRC16Checksum

Optocoupler returns information:

Return code: FE 02 01 00 91 9C

Fieldsmeaningremarks
FEEquipment address 
0202InstructionsReturn instruction: If the query is incorrect, return0x82
01Byte countReturn all bytes of status information.
00Query statusThe status of the returned optocoupler. Bit0:The status of the first optocouplerBit1:The status of the second optocoupler. . . . . . . Bit7:The status of the eighth optocoupler
91 9CCRC16The first 6 bytes of dataCRC16Checksum

Flash open/close command

Analysis of flashing open and close instructions

Flash development code submission: FE 10 00 03 00 02 04 00 04 00 0A 00 D8

Flashing sending code: FE 10 00 03 00 02 04 00 02 00 14 21 62

Fieldsmeaningremarks
FEEquipment address 
1010InstructionsQuery input register instruction
00 03Relay addressThe address of the device to be controlled
00 02Control the number of commandsThe number of commands required for the relay
04Byte countThe total number of bytes for controlling information commands. 1+(n-1)/8
00 04Or00 02Instructions00 04To flash the instruction 00 02To execute a flashing command
00 0AIntermittent time00 0ATo convert hexadecimal to decimal is:10The interval time is (0.1Seconds*10)
00 D8CRC16Verification method

Return code: FE 10 00 03 00 02 A5 C7

Fieldsmeaningremarks
FEEquipment address 
1010InstructionsReturn instruction: If the query is incorrect, return0x82
00 03Equipment addressQuery the address of the device
00 02Number of received commandsThe number of commands received by the device
A5 C7CRC16Checksum

Fully open and fully close command

   Analysis of fully open and fully closed commands

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

Completely cut off sending code: FE 0F 00 00 00 04 01 00 71 92

Fieldsmeaningremarks
FEEquipment address 
0F0FInstructionsReturn instruction: If the query is incorrect, return0x82
00 00Starting address 
00 04Control quantityNumber of relays controlled
01Byte countNumber of command bytes sent
FF (Or00) Fully open and fully close commandFF Fully open command 00 Full close command
31 D2 (Or71 92) CRC16Checksum

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

Fieldsmeaningremarks
FEEquipment address 
0F0FInstructionsReturn instruction: If the query is incorrect, Return0x82
00 00Starting address 
00 04quantity Number of relays that return informationcheck digit
40 07CRC16check digit
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 *.