RS485 module input/output IO extension Modbus RTU protocol

freeFree Technical Resource

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

RS485 module input/output IO extension Modbus RTU protocol

1, Product Features

2. Read the status of the relay

2.Communication interface support RS485, Standard modbus RTU agreement

3.Baud rate 4800, 9600(Default), 14400, 19200, 38400, 56000, 57600, 115200;  4.Can be set 1-255 Device address, 1 As the default address;

5.Equipped with communication timeout judgment function, How many seconds after the communication is disconnected, Relay on or off, Free choice 6.The modules in the input-output series also have an additional linkage function. (Self-locking, Non lock free switching)

7.The default factory settings for the product are: Address: 1, Baud rate 9600, 8 Number of digits, 1 Stop position, No verification

2、 Main parameters

Technical parameters                   Description
Input/output series (Special series) 4 Road input/output, 6 Road input/output,  8 Road input/output, 16 Road input/output (This series Input controllable output, sure 485+Input end  Control the relay together, Below Please make a note when placing an order)
Output series8 Road output, 16 Road output, 32 Road output, 64 Road output
Output relay contactsFour choices5A10A(recommend)16A30A
Communication interfaceStandard RS485 Interface
Communication protocolStandard Modbus-RTU agreement
Baud rate4800, 9600 (Default)  , 14400, 19200  , 38400 , 57600 , 115200
Communication distanceRS485 Communication distance<1000 Rice
Working voltageChoose when placing an order
Communication timeout detectionCommunication timeout detection function!
function code01 02 03 04 05 10 15   (7 Seed  Function code)
Protection levelInput port optocoupler isolation,  Isolation voltage of communication port  3000Vrms  500DC  Continuous,    +/- 15KVESD Protection, Lightning protection, Surge protection; The total load is as high as 256 Node; conform AEC - Q100 Standard; satisfy EN2368 Standard; Tide sensitivity level (MSL) 3
Product stabilityAdopting imported chips,  Built in watchdog, High reliability
Usage environmentTemperature ( -40℃  ~   +85℃),Humidity (0   ~  85% (No condensation) )

3、 Hardware wiring

Terminal name                   definition
AOutput normally open point
BOutput normally closed point
COutput public end
VCCModule power supply (Positive electrode)
GNDModule power supply (negative pole)
SSPhotoelectric switches, etc Input common terminal
X1 -X16Photoelectric switches, etc Input end
Note::  SS Connect to the correct position, X1-X16 We need to accept the negativeSS Accept negative,  X1-X16 Just need to connect
RS485 module input/output IO extension Modbus RTU protocolFigure
RS485 module input/output IO extension Modbus RTU protocolFigure1

4、 Detailed explanation of special instructions(06 Function code)

1.Communication  Timeout  Register description

PLC Address                                 explain
400021-16 Road relay or code
400031-16 Road relay and code
4000417-32 Road relay or code
4000517-32 Road relay and code

If communication is interrupted for some reason, And the fault time is greater than the time set in the timeout register, Consider communication timeout  (The fault indicator light on the module will be constantly on, Flashing only when communication is normal)

The output status of each channel after a communication timeout is determined by the following formula::

Timeout output status              Or code                       With code
Keep unchanged (default)01
open00
closed)11

example: To 16 Taking the relay module as an example

※When communication failure occurs, it exceeds 3 Request in seconds: 0~7 Road disconnection, 8~11 The road remains in its original state, 12~15 close.  1) Firstly, set the timeout period to 3 In seconds: Register 40008=30

Analysis: Register 40008 What are the units inside, What is the timeout period 0.1 Seconds

2) Reset the corresponding settings “Or code” And “With code” Register refers to:

40002H=0xF000 (1111 0000 0000 0000)

40003H=0xFF00 (1111 1111 0000 0000)

The result is: 0~7 Road disconnection, 8~11 The road remains in its original state, 12~15 close

3) Waiting for communication interruption 3 In seconds, You can see the effect immediately.

2.Relay delay action command

1. Delay action register description

PLC Address                                 explain
40014Starting channel (which channel to start from)
40015how many relays to control
40016control delay time   (number*0.1S)
400171 represents flashing 2 represents flashing

for example, starting from channel 1 how many relays to control, delay time 8 seconds, flashing mode (momentary opening 3 second closing, sending instruction, 3 field name) base: 01 10 00 0D 00 04 08 00 00 00 08 00 1E 00 01 1B AE

device addressHex(16 function code)
high byte of register starting address01
low byte of register starting address10
th register starting00
high byte of register quantity0D (low byte of register quantity 14 write)
register00
number of register data bytes)04(write 4 A register)
Number of bytes of register data08
High byte data bit00
Low byte data bit00
High byte data bit00
Low byte data bit08
High byte data bit00
Low byte data bit1E
High byte data bit00
Low byte data bit01
CRC16 Verify low byte---
CRC16 Verify high byte---

3.Description of other special registers

PLC Address                  Value                       Description
40001: 0The standard mode and linkage mode of the input port Choose to be a register 40001 The value is as follows: 3 Seed One of the modes, The input port will change Change mode0. Standard mode (not associated, input and output output do not interfere with each other)1. non lock mode (associated mode, 485+object physical control)2. self-locking mode (associated mode, 485+object physical control)
400020communication status or code (1-16 path)
4000365535communication status mask (1-16 path)
400040communication status or code (17-32 path)
4000565535communication status mask (17-32 path)
400060communication status or code (33-48 path)
4000765535communication status mask (33-48 path)
4000820communication timeout time (unit: second)
400090power-off memory save mode: after power on,  relay is in the state before power off0. not saved (default)1. save
400511station number bit, value is what, station number is what
400521baud rate setting. RS485 module input/output IO extension Modbus RTU protocolFigure2    0:4800RS485 module input/output IO extension Modbus RTU protocolFigure2     1: 9600RS485 module input/output IO extension Modbus RTU protocolFigure2    2:14400RS485 module input/output IO extension Modbus RTU protocolFigure2    3:19200RS485 module input/output IO extension Modbus RTU protocolFigure2    4:38400RS485 module input/output IO extension Modbus RTU protocolFigure2    5: 56000RS485 module input/output IO extension Modbus RTU protocolFigure2    6: 57600RS485 module input/output IO extension Modbus RTU protocolFigure2    7:115200note: this parameter is saved when power off
400530checksum0. no checksum1. even checksum2. odd checksum

5. General) Instruction Explanation(01 02 05 15  Conventional function codes)

1.Relay output

Control 1 Road relay (Taking the first road as an example)

Sent by the upper computer: 01 05 00 00 FF 00 8C 3A

Fields   (hexadecimal)         meaning                       remarks
01Equipment addressStation number
0505 InstructionsControl single channel instructions
00 00Register addressRegister address of relay
FF 00InstructionsThe action of opening (00 FF To close)
8C 3ACRC16CRC Verification code

IO Board return code: 01 05 00 00 FF 00 8C 3A

Fields (hexadecimal) meaningremarks
01Equipment addressStation number
0505 InstructionsControl single channel instructions
00 00Register addressRegister address of relay
00 FFInstructionsThe action of opening (00 FF To close)
8C 3ACRC16CRC Verification code

2.Read the status of the relay

Relay query (query route 1 sent by the upper computer)

field: 01 01 00 00 00 01 FD CA

hexadecimal (meaning)            remark                       equipment address
01station numberinstruction
0101 query relay status instructionstarting address
00 00first relay to be queriedaddress query quantity
00 01number of relays to be queriedchecksum
FD CACRC16CRC board return

IO field: 01 01 01 01 90 48

hexadecimal (meaning)            remark                       equipment address
01station number)station number
0101 InstructionsQuery relay status command
01Byte countThe first relay to be queried Address
01Query status01 Open;  00 Close
90 48CRC16CRC Verification code

3.Optocoupler input

Query optocoupler

Sent by the upper computer: 01 02 00 00 00 01 B9 CA (Query the 1 Road status)

Fields (hexadecimal)            meaning                       remarks
01Equipment addressStation number
0202 InstructionsQuery discrete input (Optocoupler input Enter status command
00 00Starting addressThe first optocoupler to be queried Register address
00 01Query quantity 
B9 CACRC16CRC Verification code

IO Board return: 01 02 01 00 A1 88

Fields (hexadecimal) meaningremarks
01Equipment addressStation number
0202 InstructionsQuery discrete input (Optocoupler input Enter status command
01Byte countThe number of bytes to be queried
00Query status00 And 01
A1 88CRC16CRC Verification code

4.Fully open and fully close command OF(Write multiple relay commands)

16 Fully open the road: 01 0F 00 00 00 10 02 FF FF E3 90

16 Road closure: 01 0F 00 00 00 10 02 00 00 E2 20

Fields   (hexadecimal)         meaning                       remarks
01Equipment addressStation number
0F0F InstructionsWrite multiple relays
00 00Starting address 
00 10Control quantityhexadecimal 10 Equivalent to decimal system 16,  Control 16 Relay status
02Byte countCommand byte count(FF FF 2 Bytes)
FF FF (Or 00 00) Fully open (Or fully closed) CommandFF Fully open 00 Fully closed
E3 90 (Or E2 20) CRC16CRC Verification code

Complete disconnection and full open return code: 01 0F 00 00 00 10 54 07

Fields   (hexadecimal)         meaning                       remarks
01Equipment addressStation number
0F0F Instructions 
00 00Starting address 
00 10Query quantity 
54 07CRC16CRC Verification code

5.Instruction list (individual examples):

control the first path to open: 01 05 00 00 FF 00 8C 3A

control the return information: 01 05 00 00 FF 00 8C 3A

control the first path to close: 01 05 00 00 00 FF 8D 8A

control the return information: 01 05 00 00 00 FF 8D 8A

control the second path to open: 01 05 00 01 FF 00 DD FA

control the return information: 01 05 00 01 FF 00 DD FA

control the second path to close: 01 05 00 01 00 FF DC 4A

control the return information: 01 05 00 01 00 FF DC 4A

control the third path to open: 01 05 00 02 FF 00 2D FA

control the return information: 01 05 00 02 FF 00 2D FA

control the third path to close: 01 05 00 02 00 FF 2C 4A

control the return information: 01 05 00 02 00 FF 2C 4A

control the fourth path to open: 01 05 00 03 FF 00 7C 3A

control the return information: 01 05 00 03 FF 00 7C 3A

control the fifth path to open: 01 05 00 03 00 FF 7D 8A

control the return information: 01 05 00 03 00 FF 7D 8A

control the sixth path to open: 01 05 00 04 FF 00 CD FB

control the return information: 01 05 00 04 FF 00 CD FB

control the sixth path to close: 01 05 00 04 00 FF CC 4B

control the return information: 01 05 00 04 00 FF CC 4B

six: 01 05 00 05 FF 00 9C 3B

upper computer part: 01 05 00 05 FF 00 9C 3B

upper computer explanation: 01 05 00 05 00 FF 9D 8B

double-click: 01 05 00 05 00 FF 9D 8B

select serial port.baud rate

click

1.connect app, button, such as As shown in the following figure, Click  “Connect”  button. as shown in the figure below:

RS485 module input/output IO extension Modbus RTU protocolFigure3

2.After connection,    Click the button“Open parameter settings”

RS485 module input/output IO extension Modbus RTU protocolFigure4

3.Click the button“Read parameters”. The upper computer will automatically obtain all parameter settings of the module(Parameters

After setting up, To restart and take effect)

RS485 module input/output IO extension Modbus RTU protocolFigure5

4.Turn on the relay,    Click the button

RS485 module input/output IO extension Modbus RTU protocolFigure6
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 *.