Skip to content

Y301-220/222 Technical Manual

Y301-220Y301-222
Y301-220Y301-222

Contents

  1. Overview
  2. Default Settings
  3. Modbus Register Map (Modbus Address Only)
  4. Command Examples (CRC Included)
  5. Parameter Configuration
  6. Automation Rules
  7. Troubleshooting

1. Overview

This manual describes the Modbus RTU communication commands for the Y301-220 and Y301-222 I/O modules.

ModelDIDOAIDescription
Y301-220220Dual input + dual relay
Y301-222222Dual input + dual relay + dual analog input

Frame format: [slave address][function code][data][CRC low][CRC high]

The examples below use slave address 0x01. Replace it with the actual device address in your application.


2. Default Settings

ParameterDefault
Slave address1
Baud rate9600 bps
Data bits8
Stop bits1
ParityNone
Output state holdKeep after soft reboot (0x0040 = 1)
Pulse counting edgeRising edge (0x0041 = 1)
Pulse debounce50 ms (0x0042 = 50)

3. Modbus Register Map (Modbus Address Only)

3.1 Digital Input (DI) - Function Code 0x02

ChannelModbus AddressR/W
DI10x0000RO
DI20x0001RO

Return value: 0 = inactive, 1 = active.

3.2 Digital Output (DO) - Function Code 0x01/0x05/0x0F

ChannelModbus AddressR/W
DO10x0000RW
DO20x0001RW

Write value: 0x0000 = open, 0xFF00 = closed.

3.3 Analog Input (AI) - Function Code 0x04 (Y301-222 only)

ChannelModbus AddressDescriptionUnitR/W
AI1 voltage0x0000AI1 sampled voltagemVRO
AI1 current0x0001AI1 sampled currentuARO
AI2 voltage0x0002AI2 sampled voltagemVRO
AI2 current0x0003AI2 sampled currentuARO

Each AI channel can be wired for either voltage or current. The other reading is invalid.

3.4 Common Holding Registers (Parameters) - Function Code 0x03/0x06/0x10

Modbus AddressParameterBytesR/WRange / EnumDefault
0x002ARuntime slave address (device addr + DIP offset)2RO0-255-
0x002BDIP offset address2RO0-310
0x003ESlave address2RW1-2551
0x003FBroadcast mode2RW0=off, 1=recv+reply, 2=recv no reply0
0x0040Output state hold2RW0=no hold, 1=soft reboot hold, 2=soft reboot + power-on hold1
0x0041Pulse count edge2RW0=falling, 1=rising1
0x0042Pulse debounce (ms)2RW5-25550
0x004CSerial heartbeat period (s)2RW0=off, 1-655350
0x004DSerial heartbeat payload16RWstring-
0x0055RTC Unix time4RWuint32-
0x0057Baud rate4RW600-2304009600
0x0059Data bits2RW8, 98
0x005AStop bits2RW1, 21
0x005BParity2RW0=None, 1=Odd, 2=Even0
0x005CPacket timeout (ms)2RW0-255 (0=adaptive)0

Notes:

  • 32-bit values (for example 0x0055, 0x0057) should be written in big-endian word order (high word first).
  • Per manufacturer behavior, changing serial parameters or slave address requires reboot to take effect.

3.5 DI Pulse Counter Registers (Holding Registers)

ChannelModbus AddressBytesR/WDescription
DI1 count0x0500 (uses 0x0500~0x0501)4RWOnly 0 is allowed for write (clear)
DI2 count0x0502 (uses 0x0502~0x0503)4RWOnly 0 is allowed for write (clear)

3.6 Automation Rule Registers (Holding Registers)

Y301-220/222 has 2 DO channels, so total rule groups = DO * 2 = 4.

Rule GroupStart Modbus AddressLength
Rule 10x00808 registers (16 bytes)
Rule 20x00888 registers (16 bytes)
Rule 30x00908 registers (16 bytes)
Rule 40x00988 registers (16 bytes)

Single-group field structure:

OffsetFieldBytes
+0Mode2
+1Action2
+2DO index2
+3DI/AI index2
+4~+5Parameter 14
+6~+7Parameter 24

3.7 Special Register

Modbus AddressNameWrite ValueDescription
0x0800Reboot / Factory reset0x5500=reboot, 0x0055 or 0x5555=factory reset + rebootWO

4. Command Examples (CRC Included)

Tip: each command is shown in an individual code block. VitePress displays a copy icon on the top-right of every code block, so users can click once to copy the Modbus command.

4.1 Read Digital Inputs

OperationRequest
Read DI101 02 00 00 00 01 B9 CA
Read DI201 02 00 01 00 01 E8 0A
Read DI1~DI2 in one shot01 02 00 00 00 02 F9 CB

4.2 Read Digital Output Status

Query (0x01):

OperationRequest
Read DO101 01 00 00 00 01 FD CA
Read DO201 01 00 01 00 01 AC 0A
Read DO1~DO2 in one shot01 01 00 00 00 02 BD CB

Single-channel control (0x05):

OperationRequest
Open DO101 05 00 00 00 00 CD CA
Close DO101 05 00 00 FF 00 8C 3A
Open DO201 05 00 01 00 00 9C 0A
Close DO201 05 00 01 FF 00 DD FA

Multi-channel control (0x0F):

OperationRequest
Close DO1 and DO2 together01 0F 00 00 00 02 01 03 9E 96
Open DO1 and DO2 together01 0F 00 00 00 02 01 00 DE 97

4.3 Read Analog Inputs (Y301-222 only)

OperationRequest
Read AI1 voltage01 04 00 00 00 01 31 CA
Read AI1 current01 04 00 01 00 01 60 0A
Read AI2 voltage01 04 00 02 00 01 90 0A
Read AI2 current01 04 00 03 00 01 C1 CA
Read AI1+AI2 (voltage+current, 4 regs)01 04 00 00 00 04 F1 C9

4.4 Parameter Read/Write (0x03/0x06/0x10)

Device address:

OperationRequest
Read slave address (0x003E)01 03 00 3E 00 01 E5 C6
Write slave address = 501 06 00 3E 00 05 28 05

Serial parameters:

OperationRequest
Read baud rate (0x0057, 2 regs)01 03 00 57 00 02 75 DB
Write baud rate = 115200 (0x0001C200)01 10 00 57 00 02 04 00 01 C2 00 B7 D5
Write baud rate = 9600 (0x00002580)01 10 00 57 00 02 04 00 00 25 80 AC 45
Read data/stop/parity (0x0059~0x005B)01 03 00 59 00 03 D5 D8
Write 8N101 10 00 59 00 03 06 00 08 00 01 00 00 85 EF

State hold and count settings:

OperationRequest
Read output state hold (0x0040)01 03 00 40 00 01 85 DE
Write output state hold = 201 06 00 40 00 02 09 DF
Read pulse edge (0x0041)01 03 00 41 00 01 D4 1E
Write pulse edge = 1 (rising)01 06 00 41 00 01 18 1E
Read debounce (0x0042)01 03 00 42 00 01 24 1E
Write debounce = 50 ms01 06 00 42 00 32 A8 0B

4.5 DI Pulse Counter Read/Write

OperationRequest
Read DI1 count (0x0500, 2 regs)01 03 05 00 00 02 C4 C7
Read DI2 count (0x0502, 2 regs)01 03 05 02 00 02 65 07
Clear DI1 count (write 0)01 10 05 00 00 02 04 00 00 00 00 CC FF

4.6 Special Operations

OperationRequest
Reboot (0x0800=0x5500)01 06 08 00 55 00 B4 FA
Factory reset + reboot (0x0800=0x0055)01 06 08 00 00 55 4B 95

4.7 Copy-Ready Command Blocks

Commonly used commands are listed below as plain command blocks for one-click copy:

text
01 02 00 00 00 02 F9 CB
text
01 0F 00 00 00 02 01 03 9E 96
text
01 04 00 00 00 04 F1 C9
text
01 10 00 57 00 02 04 00 01 C2 00 B7 D5

5. Parameter Configuration

5.1 Runtime Slave Address

Runtime slave address = configured device address (0x003E) + DIP offset (0x002B).

For hardware versions without DIP offset support, 0x002B is usually 0, so runtime address equals device address.

5.2 Serial Settings

  • Baud rate is stored at 0x0057 as a 32-bit value, so use 0x10 to write 2 registers.
  • Data bit / stop bit / parity are located at 0x0059~0x005B.
  • Per manufacturer behavior, serial parameters and slave address require reboot to take effect.

5.3 Broadcast Mode (0x003F)

ValueMeaning
0Broadcast processing off
1Receive and reply to broadcast
2Receive but do not reply

5.4 Output State Hold (0x0040)

ValueMeaning
0No hold
1Hold after soft reboot
2Hold after soft reboot and power-on reboot

6. Automation Rules

6.1 Supported Modes

ModeNameDescription
0DisabledRule is disabled
1DI followDO follows DI (normal/inverse by action)
2Pulse outputDO returns after delay
3Delayed controlOpen/close/all actions delayed
4Timed changeExecute once after delay from reboot
5Cyclic changeToggle by parameter1/parameter2 cycle
6Button (jog)DI works as a button to trigger DO
7Fixed-point one-shotExecute once at target Unix time
8Fixed-point cyclicRepeat by interval from target time
9Daily scheduleExecute every day at target second-of-day
10AI voltage > thresholdY301-222 only
11AI voltage < thresholdY301-222 only
12AI current > thresholdY301-222 only
13AI current < thresholdY301-222 only
14Delayed followFollow DI after delay
15Logical ANDMulti-channel DI/DO AND logic
16Logical ORMulti-channel DI/DO OR logic
17Logical XORMulti-channel DI/DO XOR logic

6.2 Rule Command Examples

All examples below write to Rule 1 (start 0x0080) with slave address 0x01.
For Rule 2/3/4, replace start address with 0x0088 / 0x0090 / 0x0098 and recalculate CRC.

Action code reference: 0=open, 1=close, 2=toggle (depends on mode).

  • Case 1: DI Follow (Mode 1): DO1 follows DI1
FieldValueDescription
Mode0x0001DI follow
Action0x0001Forward follow (close when DI=1)
DO index0x0001DO1
DI/AI index0x0001DI1
Parameter 10x00000000Not used
Parameter 20x00000000Not used
text
01 10 00 80 00 08 10 00 01 00 01 00 01 00 01 00 00 00 00 00 00 00 00 CC FE
  • Case 2: AI Voltage > Threshold (Mode 10): if AI1 > 5V, open DO1
FieldValueDescription
Mode0x000AAI voltage greater than threshold
Action0x0000Open
DO index0x0001DO1
DI/AI index0x0001AI1
Parameter 10x00001388Threshold 5000 mV (= 5 V)
Parameter 20x000003E8Execution interval 1000 ms (debounce)
text
01 10 00 80 00 08 10 00 0A 00 00 00 01 00 01 00 00 13 88 00 00 03 E8 67 7A
  • Case 3: AI Voltage < Threshold (Mode 11): if AI1 < 2V, close DO1
FieldValueDescription
Mode0x000BAI voltage lower than threshold
Action0x0001Close
DO index0x0001DO1
DI/AI index0x0001AI1
Parameter 10x000007D0Threshold 2000 mV (= 2 V)
Parameter 20x000003E8Execution interval 1000 ms
text
01 10 00 80 00 08 10 00 0B 00 01 00 01 00 01 00 00 07 D0 00 00 03 E8 86 22

Detailed breakdown for this case (later examples follow the same pattern):

Byte SequenceMeaning
01Slave address = 0x01
10Function code = 0x10 (Write Multiple Holding Registers)
00 80Start register = 0x0080 (Rule 1 base address)
00 08Register count = 8 (16-byte rule payload)
10Byte count = 16
00 0BMode = 0x000B (AI voltage lower than threshold)
00 01Action = 0x0001 (close)
00 01DO index = 1 (DO1)
00 01DI/AI index = 1 (AI1)
00 00 07 D0Parameter 1 = 2000 mV = 2.0V threshold
00 00 03 E8Parameter 2 = 1000 ms trigger interval / debounce
86 22CRC16 (low byte first)

Meaning summary: this writes a rule to Rule 1 so that when AI1 voltage is lower than 2V, DO1 closes, with a minimum execution interval of 1000 ms.

  • Case 4: AI Current > Threshold (Mode 12): if AI1 > 10mA, close DO1
FieldValueDescription
Mode0x000CAI current greater than threshold
Action0x0001Close (turn on)
DO index0x0001DO1
DI/AI index0x0001AI1
Parameter 10x00002710Threshold 10000 uA (= 10 mA)
Parameter 20x000003E8Execution interval 1000 ms (debounce)
text
01 10 00 80 00 08 10 00 0C 00 01 00 01 00 01 00 00 27 10 00 00 03 E8 C6 51
  • Case 5: AI Current < Threshold (Mode 13): if AI1 < 4mA, open DO1
FieldValueDescription
Mode0x000DAI current lower than threshold
Action0x0000Open
DO index0x0001DO1
DI/AI index0x0001AI1
Parameter 10x00000FA0Threshold 4000 uA (= 4 mA)
Parameter 20x000003E8Execution interval 1000 ms
text
01 10 00 80 00 08 10 00 0D 00 00 00 01 00 01 00 00 0F A0 00 00 03 E8 42 22
  • Case 6: Pulse Output (Mode 2): DO1 normally open, auto-recover after 2s close
FieldValueDescription
Mode0x0002Pulse output
Action0x0000Normally open
DO index0x0001DO1
DI/AI index0x0000Not used
Parameter 10x000007D0Pulse duration 2000 ms
Parameter 20x00000000Not used
text
01 10 00 80 00 08 10 00 02 00 00 00 01 00 00 00 00 07 D0 00 00 00 00 40 8B
  • Case 7: Delayed Control (Mode 3): DO1 open command delayed by 3s
FieldValueDescription
Mode0x0003Delayed control
Action0x0000Delayed open only
DO index0x0001DO1
DI/AI index0x0000Not used
Parameter 10x00000BB8Delay 3000 ms
Parameter 20x00000000Not used
text
01 10 00 80 00 08 10 00 03 00 00 00 01 00 00 00 00 0B B8 00 00 00 00 E0 8E
  • Case 8: Cyclic Change (Mode 5): DO1 open 1s, close 2s in cycle
FieldValueDescription
Mode0x0005Cyclic change
Action0x0000Open first
DO index0x0001DO1
DI/AI index0x0000Not used
Parameter 10x000003E8Open duration 1000 ms
Parameter 20x000007D0Close duration 2000 ms
text
01 10 00 80 00 08 10 00 05 00 00 00 01 00 00 00 00 03 E8 00 00 07 D0 A4 64
  • Case 9: Button/Jog (Mode 6): DI1 button toggles DO1
FieldValueDescription
Mode0x0006Button (jog)
Action0x0002Toggle
DO index0x0001DO1
DI/AI index0x0001DI1 as button input
Parameter 10x000003E8Press duration 1000 ms
Parameter 20x00000000Not used
text
01 10 00 80 00 08 10 00 06 00 02 00 01 00 01 00 00 03 E8 00 00 00 00 EE 1B
  • Case 10: Logical AND (Mode 15): DO1 close only when DO2=close and DI1+DI2=active
FieldValueDescription
Mode0x000FLogical AND
Action0x0004Close (hold)
DO index0x0001DO1
DI/AI index0x0000Not used
Parameter 10x00000002DO2 participates in logic (bit1=1)
Parameter 20x00000003DI1+DI2 participate in logic (bit0+bit1=1)
text
01 10 00 80 00 08 10 00 0F 00 04 00 01 00 00 00 00 00 02 00 00 00 03 7A AE
  • Case 11: Timed Change (Mode 4): after reboot, close DO1 in 5s
FieldValueDescription
Mode0x0004Timed change
Action0x0001Close
DO index0x0001DO1
DI/AI index0x0000Not used
Parameter 10x00001388Timer 5000 ms
Parameter 20x00000000Not used
text
01 10 00 80 00 08 10 00 04 00 01 00 01 00 00 00 00 13 88 00 00 00 00 E6 D1
  • Case 12: Daily Schedule (Mode 9): open DO1 every day at 18:00:00
FieldValueDescription
Mode0x0009Daily schedule
Action0x0000Open
DO index0x0001DO1
DI/AI index0x0000Not used
Parameter 10x0000FD20Seconds of day 64800 (18x3600)
Parameter 20x00000000Not used
text
01 10 00 80 00 08 10 00 09 00 00 00 01 00 00 00 00 FD 20 00 00 00 00 5F C3

Note: modes 7~9 depend on RTC time. After reboot, write current Unix timestamp to RTC register 0x0055 first.


7. Troubleshooting

SymptomCauseSolution
No responseWrong address or baud rateCheck settings and try broadcast address 0
CRC errorWiring issue or interferenceCheck RS485 polarity and add termination resistors
DO does not switchLoad exceeds ratingReduce the load and verify contact ratings
DI always reads 0Wiring errorCheck COM/DI wiring and input voltage
AI reading is abnormalWrong wiring modeVerify voltage/current wiring; each channel supports only one mode at a time

LED Indicators

LEDStatusMeaning
POWERSolid onPower is normal
TXFlashingData is being transmitted
RXFlashingData is being received
DI1/DI2OnInput is active
DO1/DO2OnRelay is closed