Appearance
Y331-0011/0022/0044/0066/0088 Analog Input/Output Modules RS485 Technical Manual
Contents
- Overview
- Default Settings
- Modbus Register Map (Modbus Address Only)
- Command Examples (CRC Included)
- Parameter Configuration
- Analog Value Conversion
- Troubleshooting
1. Overview
Y331-0011/0022/0044/0066/0088 modules combine analog acquisition with analog output control over Modbus RTU. The Specification lists signal ranges, electrical data, and ordering options.
| Model | DI | DO | AI | AO |
|---|---|---|---|---|
| Y331-0011 | 0 | 0 | 1 | 1 |
| Y331-0022 | 0 | 0 | 2 | 2 |
| Y331-0044 | 0 | 0 | 4 | 4 |
| Y331-0066 | 0 | 0 | 6 | 6 |
| Y331-0088 | 0 | 0 | 8 | 8 |
The four-position model code follows DI / DO / AI / AO, including zeros. The standard interface is isolated RS485; RS232 and isolated CAN are optional. RS232 wiring and settings, and CAN message definitions, require interface-specific documentation.
Frame format: [slave address][function code][data][CRC low][CRC high]
Command examples specify slave address 0x01. Replace it with the device address and recalculate the CRC. Send register addresses and data words high byte first, and CRC bytes low byte first.
2. Default Settings
| Parameter | Default |
|---|---|
| Slave address | 1 |
| Baud rate | 9600 bps |
| Data bits | 8 |
| Stop bits | 1 |
| Parity | None |
Active upload interval (0x0031) | 0; disabled |
Input data format (0x003A) | Read back and configure before decoding |
| AO setpoint registers | Reset value 0; not retained after power loss |
The default AI format is unverified because the input/output manual gives conflicting defaults. Read 0x003A and set the required format before decoding AI values. For AO encoding and startup behavior, see Section 3.2.
3. Modbus Register Map (Modbus Address Only)
Register addresses are zero-based protocol addresses. Registers hold unsigned 16-bit values. RO means read only; RW means read/write.
3.1 Analog Input (AI) - Function Code 0x04
| Channel | Modbus Address | Description | Unit | R/W |
|---|---|---|---|---|
| AI1 | 0x0000 | AI1 sampled value | V* | RO |
| AI2 | 0x0001 | AI2 sampled value | V* | RO |
| AI3 | 0x0002 | AI3 sampled value | V* | RO |
| AI4 | 0x0003 | AI4 sampled value | V* | RO |
| AI5 | 0x0004 | AI5 sampled value | V* | RO |
| AI6 | 0x0005 | AI6 sampled value | V* | RO |
| AI7 | 0x0006 | AI7 sampled value | V* | RO |
| AI8 | 0x0007 | AI8 sampled value | V* | RO |
*Voltage inputs decode in V. Milliamp inputs decode as the voltage across a 249 Ω sampling resistor; convert to current as described in Analog Value Conversion.
Each AI channel uses one register. Read only the fitted AI count in the model code: for example, AI1-AI4 on Y331-0044 and AI1 only on Y331-0011.
3.2 Analog Output (AO) - Function Code 0x03/0x06/0x10
| Channel | Modbus Address | Description | Unit | R/W |
|---|---|---|---|---|
| AO1 | 0x000A | AO1 setpoint × 1000 | V / mA | RW |
| AO2 | 0x000B | AO2 setpoint × 1000 | V / mA | RW |
| AO3 | 0x000C | AO3 setpoint × 1000 | V / mA | RW |
| AO4 | 0x000D | AO4 setpoint × 1000 | V / mA | RW |
| AO5 | 0x000E | AO5 setpoint × 1000 | V / mA | RW |
| AO6 | 0x000F | AO6 setpoint × 1000 | V / mA | RW |
| AO7 | 0x0010 | AO7 setpoint × 1000 | V / mA | RW |
| AO8 | 0x0011 | AO8 setpoint × 1000 | V / mA | RW |
AO uses fixed three-decimal encoding independently of the AI format. This gives register increments of 1 mV or 1 µA; physical output resolution is unspecified. Write only fitted channels and use the formulas in Section 6.5.
Readback returns the stored setpoint, not a measured output. Setpoints do not persist after power loss; the register resets to 0. The physical startup current of a 4-20 mA version is unspecified.
3.3 Common Holding Registers (Parameters) - Function Code 0x03/0x06/0x10
| Modbus Address | Parameter | Bytes | R/W | Range / Enum | Default |
|---|---|---|---|---|---|
0x0031 | Active upload interval | 2 | RW | Interval unit unverified; 0 disables upload | 0 |
0x0032 | Slave address | 2 | RW | 1-255 | 1 |
0x0033 | Baud-rate code | 2 | RW | 0-7; see Section 5.3 | 1 |
0x003A | Input data format | 2 | RW | 0-3; see Section 5.4 | Read back |
0x003D | Parity | 2 | RW | 0=none, 1=odd, 2=even | 0 |
4. Command Examples (CRC Included)
Send each request as hexadecimal bytes, including its CRC.
4.1 Read Analog Inputs
| Operation | Request (Hex) |
|---|---|
| Read AI1 | 01 04 00 00 00 01 31 CA |
| Read AI2 | 01 04 00 01 00 01 60 0A |
| Read AI3 | 01 04 00 02 00 01 90 0A |
| Read AI4 | 01 04 00 03 00 01 C1 CA |
| Read AI5 | 01 04 00 04 00 01 70 0B |
| Read AI6 | 01 04 00 05 00 01 21 CB |
| Read AI7 | 01 04 00 06 00 01 D1 CB |
| Read AI8 | 01 04 00 07 00 01 80 0B |
4.2 Read All Fitted Analog Inputs
| Operation | Request (Hex) |
|---|---|
| Y331-0011: read AI1 | 01 04 00 00 00 01 31 CA |
| Y331-0022: read AI1-AI2 | 01 04 00 00 00 02 71 CB |
| Y331-0044: read AI1-AI4 | 01 04 00 00 00 04 F1 C9 |
| Y331-0066: read AI1-AI6 | 01 04 00 00 00 06 70 08 |
| Y331-0088: read AI1-AI8 | 01 04 00 00 00 08 F1 CC |
4.3 Interpret an AI1 Response
text
Request: 01 04 00 00 00 01 31 CA
Response: 01 04 02 03 E8 B9 8EThe returned word is 0x03E8, decimal 1000. In fixed three-decimal format, this is 1.000 V on a voltage input or approximately 4.016 mA on a 249 Ω milliamp input. Decode according to the actual 0x003A setting.
4.4 Read and Set Analog Outputs
Before writing an AO setpoint, verify the output type, range, and receiver load against the ordered hardware specifications. A 10 V example applies only to a 0-10 V output. The two-channel example requires at least two AO channels.
| Operation | Request (Hex) |
|---|---|
| Read AO1 setpoint | 01 03 00 0A 00 01 A4 08 |
| Set AO1 = 1 V (voltage version) | 01 06 00 0A 03 E8 A9 76 |
| Set AO1 = 12 mA (current version) | 01 06 00 0A 2E E0 B5 E0 |
| Set AO1 = 10 V or 10 mA | 01 06 00 0A 27 10 B3 F4 |
| Set AO1-AO2 = 10 V or 10 mA | 01 10 00 0A 00 02 04 27 10 27 10 62 9D |
After setting AO1 to 10 V or 10 mA, the read response is:
text
01 03 02 27 10 A2 780x2710 = 10000, which represents a setpoint of 10.000 V or 10.000 mA for the corresponding output type.
4.5 Parameter Read/Write
| Operation | Request (Hex) |
|---|---|
Read slave address (0x0032) | 01 03 00 32 00 01 25 C5 |
| Write slave address = 2 | 01 06 00 32 00 02 A9 C4 |
Read baud-rate code (0x0033) | 01 03 00 33 00 01 74 05 |
| Write baud rate = 38400 bps (code 4) | 01 06 00 33 00 04 78 06 |
Read input data format (0x003A) | 01 03 00 3A 00 01 A4 07 |
| Write fixed three-decimal format (code 2) | 01 06 00 3A 00 02 28 06 |
Slave address, baud rate, parity, and input data format persist after power loss. Changes take effect after power cycling. Reconnect using the new serial settings.
5. Parameter Configuration
5.1 Wiring and First Connection
Mounting: Screw mounting. Secure the module to a cabinet backplate or another flat surface using the enclosure mounting slots before wiring.
| Terminal | Connection |
|---|---|
+ / - | 6-36 VDC supply positive / negative |
A / B | RS485 positive / negative |
AI+ / AI- | Channel input positive / negative |
AO+ / AO- | Channel output positive / negative |
With power disconnected, check the ordered input range and terminal labels. Wire voltage inputs across the signal source and current inputs in series with the measured circuit. For milliamp transmitters, include the supply required by the transmitter's wiring arrangement.
The 0-5 V / milliamp combination hardware uses one jumper per input: open for voltage, closed for current. Set the jumper before applying the signal. For 0-10 V inputs, follow the wiring instructions for the ordered hardware.
Connect A and B to the matching terminals of the RS485 host or USB converter. Start with one module on the bus, read AI1, and check its decoded value against a known signal. Assign a unique address to each module and run one RS485 master on the bus.
Wire AO to a receiver that accepts the ordered output range and meets the hardware's load requirements. Measure its startup output and test a setpoint within the range. The input jumper does not configure the output type.
5.2 Slave Address
Write a value from 1 to 255 to register 0x0032.
5.3 Serial Settings
Baud rate uses a 16-bit code at 0x0033.
| Baud-rate code | Baud rate (bps) |
|---|---|
| 0 | 4800 |
| 1 | 9600 |
| 2 | 14400 |
| 3 | 19200 |
| 4 | 38400 |
| 5 | 56000 |
| 6 | 57600 |
| 7 | 115200 |
Set parity at 0x003D: 0 = none, 1 = odd, 2 = even. Serial frames have 8 data bits and 1 stop bit.
5.4 Input Data Format
Set the decimal format at 0x003A:
| Code | Format |
|---|---|
| 0 | Variable decimal |
| 1 | Fixed two decimals |
| 2 | Fixed three decimals |
| 3 | Fixed four decimals |
Register 0x003A controls AI value encoding, not the physical signal range or AO encoding. The ordered hardware determines the input and output ranges.
5.5 Active Upload Interval
Register 0x0031 controls active upload; 0 disables it. The interval unit is unverified because the input/output manual's unit and example disagree. Obtain the firmware-specific interval unit before enabling upload. Keep upload disabled during initial polling.
6. Analog Value Conversion
6.1 Variable Decimal Input Format
For raw register value R, the ten-thousands digit sets the number of decimal places. The remaining four digits give the magnitude:
text
d = floor(R / 10000)
n = R % 10000
decoded value = n / 10^dExample: R = 31000 gives d = 3, n = 1000, and a decoded value of 1.000.
6.2 Fixed Decimal Input Format
text
decoded value = R / 10^dThe value of d is 2, 3, or 4, as selected by register 0x003A. With fixed three-decimal format, R = 1000 gives 1.000.
Fixed four-decimal voltage encoding represents at most 6.5535 V in an unsigned 16-bit register. Select two- or three-decimal encoding for the full range of 0-10 V inputs.
6.3 Voltage Inputs
The decoded input value is in volts. For example, 1.000 V equals 1000 mV.
6.4 Milliamp Inputs: 0-20 mA and 4-20 mA
The decoded value is the voltage across the 249 Ω sampling resistor. Convert it to current:
text
current (A) = decoded voltage (V) / 249
current (mA) = decoded voltage (V) × 1000 / 249Example: 1.000 V / 249 Ω = 0.004016 A, approximately 4.016 mA. This is the measured loop current. Scale it separately to the transmitter's engineering range when required.
For a 4-20 mA transmitter whose endpoints are low and high:
text
engineering value = low + (current_mA - 4) × (high - low) / 166.5 Analog Output Setpoints
text
raw setpoint = voltage (V) × 1000
raw setpoint = current (mA) × 1000Examples: 2.500 V → 2500 (0x09C4); 12.000 mA → 12000 (0x2EE0). Write a setpoint within the ordered output range to the corresponding AO holding register. The 249 Ω conversion applies to milliamp inputs only; it is not used for output setpoints.
7. Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
| No response | Supply, wiring, or communication setting mismatch | Check supply, A/B polarity, address, baud rate, and parity |
| Response stops after configuration | Module and host settings differ | Power-cycle and reconnect using the new settings |
| Input value has the wrong scale | Incorrect decimal format | Read 0x003A and decode with the corresponding format |
| Milliamp value is incorrect | Sampling voltage has not been converted to current | Decode the voltage, then divide by 249 Ω |
| Some channels cannot be read | Request exceeds the fitted AI count | Match the register count to the model |
| AO read/write fails | Request exceeds the fitted AO count | Match the request to the fitted AO count |
| AO value has the wrong scale | Input conversion used for an output setpoint | Encode the setpoint as V or mA × 1000, within the ordered output range |
| AO setpoint is lost after power loss | Output setpoints are not retained | Verify the startup state and reapply the required setpoints from the host |
LED Indicators
| Indicator | Function |
|---|---|
| Power | Supply status |
| Communication | Bus activity |
For troubleshooting assistance, email [email protected] with the full model, signal ranges, serial settings, request frame, and response frame.
- Manufacturer: Hunan YenGear Tech Co., Ltd.
- Email: [email protected]
- Website: www.yengear.com
