On this page
Xinje Modbus
This plugin reads and writes XC, XD, and XL-series devices using Xinje PLC address rules. It is named Xinje Modbus in the device selector.
See Collection Configuration for common channel, device, variable, data-format, and import operations. This page covers only series selection, address differences, and debug.
Compatible devices and models
| Device series / model examples | Connection requirements |
|---|---|
| XC1, XC2, XC3, XC5, XCM, XCC | Select XC mapping and use a Modbus slave interface supported by the PLC. Configure base and extended areas using the mixed mapping rules used by this plugin. |
| XD1, XD2, XD3, XD5, XD5E, XDM, XDC, XDME, XDH | Select XD mapping. Modbus TCP availability depends on the actual CPU or communication module. |
| XL1, XL3, XL5, XL5E, XLME | Select XL mapping and configure the corresponding Modbus mode for the serial or Ethernet interface. The dedicated internal TCP protocol uses the separate Internal plugin. |
Configure PLC communication
This example uses an XD Ethernet CPU as a Modbus TCP server. Identify the XC, XD or XL family from the CPU, then confirm the interfaces provided by that CPU or communication module.
- Open the matching CPU project in XDPPro and connect through the programming cable. Open
PLC Config → ethernetand selectRead From PLCfirst. - For a fixed address select
Use the following IP address. This example uses PLC192.168.1.10, mask255.255.255.0, and another address in that subnet for the collection host. Configure the actual router for routed networks.
The window is from Xinje’s TCP/IP communication based on Ethernet, version 1.4.3. Select Write To PLC and restart the PLC as required by its model. The Ethernet models covered by the manual provide a Modbus TCP Server on port 502 at power-on. The PLC does not need to be configured as a Modbus master for this connection.
- Alternatively, connect to the PLC in XINJEConfig 2.3.0.9, open
Ethernet → General, select the actual interface, read the current values and write the static IP settings. The vendor illustration uses192.168.6.6; the gateway example below uses192.168.1.10.
- Connect the PLC and collection host through the same Ethernet network or a configured route. Check for duplicate IP addresses and access to TCP502. XNet and EtherNet/IP use different services and messages.
For a serial connection, configure the selected PLC port as a Modbus RTU slave, download its station and serial settings, and match baud rate, data bits, parity and stop bits in the gateway. Wire RS-485 according to the module’s signal functions, including its reference and the bus termination design; A/B naming varies between vendors. Close programming software that holds the same COM port.
Create the channel and device
In Development configuration → Collection configuration, create the channel and a device using Xinje Modbus. See Collection configuration for shared fields.
| Physical link | Channel | Modbus format | Setting |
|---|---|---|---|
| Direct PLC Ethernet | TcpClient | ModbusTcp | Remote endpoint 192.168.1.10:502; the PLC is the server. |
| Local serial / USB-RS485 | SerialPort | ModbusRtu | Match the COM port and all PLC serial settings. Set the station in plugin properties. |
| Connect to a transparent serial server | TcpClient | ModbusRtu | Use the server’s transparent transport port; it forwards RTU bytes to the PLC. |
| DTU connects to the gateway | TcpService | ModbusRtu | Listen on the host’s address and port. Configure the DTU to connect there and match its registration ID. |
ModbusTcp requires a TCP client channel. Serial and TCP server transparent links use ModbusRtu. The shared format list also shows ModbusAscii, but that option is not supported by this Xinje entry.
Leave SSL off for a normal PLC interface. Start with maximum concurrency 1 to avoid interleaved serial messages. Connection timeout covers TCP establishment; plugin timeout covers the protocol response. Associate the device with this channel, use an example interval of 1000 ms and enable it after configuring the variables.
Plugin properties
| Property | Purpose and setting |
|---|---|
| PLC family | Default XC; options XC / XD / XL. Match the CPU. This changes device-to-protocol mapping, so an identical X0 does not have the same physical offset in every family. |
| Modbus format | Default ModbusTcp. Use TCP for native Ethernet and RTU for serial or transparent links. ASCII is not applicable. |
| Default station | Default 1; addresses require 1–247. Match the slave station/Unit ID. s=2;D100 overrides it for one variable. IP, TCP port and station identify different layers of the target. |
| FC1 maximum read coils | Default 1600, range 1–2000 bits per FC1 request. Reduce for a target with a smaller limit; it does not count variables. |
| FC2 maximum read discrete inputs | Default 1600, range 1–2000 bits per FC2 request. Does not alter X/Y mapping or write permissions. |
| FC3 maximum read holding registers | Default 100, range 1–125 16-bit registers per request. A Float occupies two registers. |
| FC4 maximum read input registers | Default 100, range 1–125 registers per FC4 request. Does not convert a read-only area to a writable holding register. |
| FC15 maximum write coils | Default 1968, range 1–1968 bits per multiple-coil write. Larger continuous tasks split into requests. |
| FC16 maximum write registers | Default 123, range 1–123 WORDs. Reduce to the PLC’s accepted limit. A split write is not atomic across the whole batch. |
| DTU ID | Empty by default; leave empty for direct PLC access. In a TCP server DTU configuration, match the actual registration ID rather than the PLC IP or station. |
| Heartbeat | Empty by default. Used only by TCP server default DTU mode; a value overrides the channel heartbeat, while empty inherits it. Match the actual heartbeat bytes. |
| Heartbeat Hex | Off: UTF-8 text matching. On: hexadecimal byte matching. Does not select numeric display radix or change the channel’s DTU ID encoding. |
| Read/write timeout | Default 3000 ms for the complete protocol response. Account for slow serial transmission; extra timeout cannot repair an invalid address. |
| Delay before frame | Default 0 ms before each request, including split frames. Increase only when the target requires spacing. |
| Retry count | Default 3. Extends a failed polling cycle; diagnose wiring, station and format before increasing it. |
| Read/write duty cycle | Default 3, minimum 1. Schedules a read after the specified number of writes under sustained write traffic. |
| Write priority | Off by default. Allows a write to cancel the current polling read; frequent writes can delay refresh. |
| Reverse string bytes within WORD | Off by default. Corrects reversed character pairs in String values without changing numeric byte order. |
| Data order | Default CDAB; options ABCD / BADC / CDAB / DCBA. Determine from a known multi-WORD PLC value. A variable can override it independently. |
Map PLC devices to variables
For a signed 16-bit value monitored at D100, create Xinje_Modbus_D100, address D100, type Int16, array length 1, read-only. A PLC value of 1234 should appear as the same integer. Enter device names here, not 40001, 4x100 or a manually calculated Modbus offset.
| Family | Boolean addresses | WORD addresses |
|---|---|---|
| XC | X0, Y0, M0, S0, T0, C0, and D0.0 | D0, F0, E0, T0, C0. Boolean versus numeric type distinguishes a timer/counter contact from its current value. |
| XD / XL | X0, Y0, M0, S0, SM0, T0, C0, ET0, SEM0, HM0, HS0, HT0, HC0, HSC0; register bits D0.0, SD0.0, HD0.0 | D0, ID0, QD0, SD0, TD0, CD0, ETD0, HD0, HSD0, HTD0, HCD0, HSCD0, FD0, SFD0, FS0. |
X/Y numbers are octal: X10 is continuous bit 8; X8 is invalid. Other area numbers are decimal. The CPU must provide the requested range. X and XD/XL ID are read-only; configure other points according to their role in the PLC program.
Use Field editor for a basic address. Enter supported extended device names directly in the address box when they are absent from the shared area list.
| Address field | Setting and behavior |
|---|---|
| Device area / offset | Select D, offset 100, to generate D100. Match Boolean bit areas versus numeric WORD areas. |
| Bit index | Leave unset for a normal bit area. For a supported Boolean WORD-bit address use 0–15, for example D100.3. The shared control’s displayed maximum31 does not make16–31 valid for this protocol. |
| Station override | Inherits the device station when unset; 2 generates s=2;D100. Valid range 1–247. |
| Byte order override | Changes conversion for one variable, for example data=ABCD;D100, leaving others at device order CDAB. |
| Encoding override | Match the String character encoding, for example encoding=ASCII;. Unnecessary for numeric values. |
| String byte length | For example len=10;D200 occupies five WORDs. Count encoded bytes for UTF-8 and other multibyte encodings. |
| BCD override | Match actual BCD/Gray storage, for example bcd=C8421;. Leave unset for normal binary values. |
| Variable-length string override | Use only with the corresponding length-bearing layout. Leave unset for a fixed character area; it does not discover an unknown length. |
Int32/UInt32/Float occupy two WORDs; Int64/UInt64/Double occupy four. Array length counts typed elements: D100, Int32, length3 covers D100–D105. Boolean arrays advance through consecutive bits; register-bit arrays can span adjacent WORDs. There are no extra variable properties or special methods for this entry.
Low addresses D0/D100 map to FC3 physical offsets 0/100. Other areas and segments differ: XC X0 maps to 0x4000, XD/XL to 0x5000, and XC D8000 maps to 0x4000. A universal address-minus-one rule is incorrect.
Modbus TCP switches to Xinje internal commands at the critical boundary of some extended areas, for example D20480; the endpoint must support those commands. RTU/RTU-over-TCP require a mapping encodable as a 16-bit physical address. High-address WORD.bit access does not upgrade: read complete WORDs and extract bits. Low-address WORD-bit writes read the whole WORD, modify bits and write it back; they are not atomic against the PLC program or another client.
Compare a low address using Modbus Slave
This example uses Modbus Slave 64 Bit 7.4.1.
- Open
Connection → Connect, selectModbus TCP/IP, bind127.0.0.1, port15020, leaveIgnore Unit IDoff and connect. Use the server’s actual network interface address when the gateway is on another computer.
- Open
Setup → Slave Definition(F8):Slave ID=1,03 Holding Register (4x), decimalAddress=0,Quantity=10. Zero is the message offset; the displayedPLC address=40001is the tool’s reference number.
- Set table offset0 to
1234, using signed16-bit decimal display.
- Set the gateway channel to
TcpClient,127.0.0.1:15020; choose familyXD, formatModbusTcp, station1. ConfigureD0,Int16, length1 and enable channel and device. - Open variable Details: check
D0, sources=1;D0, current value1234, and advancing collection timestamps.
Compare independently with Modbus Poll
In Modbus Poll 9.5.1, open Connection → Connect (F3) and select Modbus TCP/IP, destination 127.0.0.1, port 15020. If Slave runs on another PC, use that PC’s actual address. Response Timeout=1000 ms bounds one response; Connect Timeout=3000 ms bounds TCP connection establishment. Serial framing and RTU Over TCP/IP do not apply to this TCP example.
Open Setup → Read/Write Definition (F8): Slave ID=1, 03 Read Holding Registers (4x), decimal Address=0, Quantity=10, and Scan Rate=1000 ms. Clear PLC Addresses (Base 1). Zero-based offset 0 maps to Xinje low address D0. The dialog’s PLC address=40001 is Poll’s reference number; keep D0 as the Xinje gateway address.
Click OK. Offset 0 shows 1234, Tx increases, and Err=0. The gateway’s D0 / Int16 / 1 should match. After checking Poll’s unit ID, framing and offset, check the gateway CPU family, variable type and word order. Do not add or subtract one from D0 to correct an address mismatch.
Compare PLC values and diagnose
Monitor the same device online in XDPPro and compare type, value and timestamps. Protocol debugging → Read/write performs a single D100 / Int16 / 1 read; Messages shows station, request and response. Use allowed non-control points for writes, enable the appropriate access, read back and restore as required.
| Symptom | Check |
|---|---|
| TCP connection failure | PLC IP, port502, routing and server availability. Use the actual transparent service port for a serial server. |
| Connected but no response | Station, TCP/RTU format and CPU family; also all serial settings for an RTU link. |
| Basic D reads work but extended areas fail | CPU range, family mapping,16-bit physical limits and internal command support. Do not treat high register bits as ordinary coils. |
| Offset or floating-point error | X/Y octal notation, element count, multi-WORD span and CDAB conversion. |
| Reversed character pairs | String byte reversal; also check encoding and byte length for garbled text. |
Related operations
- Xinje Internal: TCP access through internal logical addresses.
- Collection configuration: shared channel, variable, expression, alarm and write permissions.















