Skip to Content
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 examplesConnection requirements
XC1, XC2, XC3, XC5, XCM, XCCSelect 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, XDHSelect XD mapping. Modbus TCP availability depends on the actual CPU or communication module.
XL1, XL3, XL5, XL5E, XLMESelect 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.

  1. Open the matching CPU project in XDPPro and connect through the programming cable. Open PLC Config → ethernet and select Read From PLC first.
  2. For a fixed address select Use the following IP address. This example uses PLC 192.168.1.10, mask 255.255.255.0, and another address in that subnet for the collection host. Configure the actual router for routed networks.

XDPPro ethernet Set with IP fields and PLC read/write buttons

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.

  1. 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 uses 192.168.6.6; the gateway example below uses 192.168.1.10.

XINJEConfig Ethernet General static IP and Write controls

  1. 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 linkChannelModbus formatSetting
Direct PLC EthernetTcpClientModbusTcpRemote endpoint 192.168.1.10:502; the PLC is the server.
Local serial / USB-RS485SerialPortModbusRtuMatch the COM port and all PLC serial settings. Set the station in plugin properties.
Connect to a transparent serial serverTcpClientModbusRtuUse the server’s transparent transport port; it forwards RTU bytes to the PLC.
DTU connects to the gatewayTcpServiceModbusRtuListen 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.

Xinje Modbus TCP client endpoint and single request concurrency

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.

Xinje Modbus identity, associated channel and interval

Plugin properties

Xinje family, format, station and six packing limits

PropertyPurpose and setting
PLC familyDefault 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 formatDefault ModbusTcp. Use TCP for native Ethernet and RTU for serial or transparent links. ASCII is not applicable.
Default stationDefault 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 coilsDefault 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 inputsDefault 1600, range 1–2000 bits per FC2 request. Does not alter X/Y mapping or write permissions.
FC3 maximum read holding registersDefault 100, range 1–125 16-bit registers per request. A Float occupies two registers.
FC4 maximum read input registersDefault 100, range 1–125 registers per FC4 request. Does not convert a read-only area to a writable holding register.
FC15 maximum write coilsDefault 1968, range 1–1968 bits per multiple-coil write. Larger continuous tasks split into requests.
FC16 maximum write registersDefault 123, range 1–123 WORDs. Reduce to the PLC’s accepted limit. A split write is not atomic across the whole batch.
DTU IDEmpty 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.
HeartbeatEmpty 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 HexOff: UTF-8 text matching. On: hexadecimal byte matching. Does not select numeric display radix or change the channel’s DTU ID encoding.
Read/write timeoutDefault 3000 ms for the complete protocol response. Account for slow serial transmission; extra timeout cannot repair an invalid address.
Delay before frameDefault 0 ms before each request, including split frames. Increase only when the target requires spacing.
Retry countDefault 3. Extends a failed polling cycle; diagnose wiring, station and format before increasing it.
Read/write duty cycleDefault 3, minimum 1. Schedules a read after the specified number of writes under sustained write traffic.
Write priorityOff by default. Allows a write to cancel the current polling read; frequent writes can delay refresh.
Reverse string bytes within WORDOff by default. Corrects reversed character pairs in String values without changing numeric byte order.
Data orderDefault CDAB; options ABCD / BADC / CDAB / DCBA. Determine from a known multi-WORD PLC value. A variable can override it independently.

DTU identifier and heartbeat fields

Xinje Modbus scheduling, string and CDAB settings

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.

Xinje D100 Int16 variable with one element

FamilyBoolean addressesWORD addresses
XCX0, Y0, M0, S0, T0, C0, and D0.0D0, F0, E0, T0, C0. Boolean versus numeric type distinguishes a timer/counter contact from its current value.
XD / XLX0, Y0, M0, S0, SM0, T0, C0, ET0, SEM0, HM0, HS0, HT0, HC0, HSC0; register bits D0.0, SD0.0, HD0.0D0, 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.

Xinje Modbus D area, offset 100 and communication overrides

Address fieldSetting and behavior
Device area / offsetSelect D, offset 100, to generate D100. Match Boolean bit areas versus numeric WORD areas.
Bit indexLeave 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 overrideInherits the device station when unset; 2 generates s=2;D100. Valid range 1–247.
Byte order overrideChanges conversion for one variable, for example data=ABCD;D100, leaving others at device order CDAB.
Encoding overrideMatch the String character encoding, for example encoding=ASCII;. Unnecessary for numeric values.
String byte lengthFor example len=10;D200 occupies five WORDs. Count encoded bytes for UTF-8 and other multibyte encodings.
BCD overrideMatch actual BCD/Gray storage, for example bcd=C8421;. Leave unset for normal binary values.
Variable-length string overrideUse 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.

  1. Open Connection → Connect, select Modbus TCP/IP, bind 127.0.0.1, port 15020, leave Ignore Unit ID off and connect. Use the server’s actual network interface address when the gateway is on another computer.

Modbus Slave TCP listener127.0.0.1 port15020

  1. Open Setup → Slave Definition (F8): Slave ID=1, 03 Holding Register (4x), decimal Address=0, Quantity=10. Zero is the message offset; the displayed PLC address=40001 is the tool’s reference number.

Modbus Slave station1 FC03 zero-based offset and ten registers

  1. Set table offset0 to 1234, using signed16-bit decimal display.

Modbus Slave offset0 contains1234

  1. Set the gateway channel to TcpClient, 127.0.0.1:15020; choose family XD, format ModbusTcp, station1. Configure D0, Int16, length1 and enable channel and device.
  2. Open variable Details: check D0, source s=1;D0, current value 1234, and advancing collection timestamps.

Xinje Modbus D0 details show source address, normal state and1234

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.

Modbus Poll Modbus TCP/IP destination127.0.0.1 and port15020

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.

Modbus Poll station1 FC03 offset0 quantity10 and1000ms scan rate

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.

Modbus Poll offset0 value1234 with zero errors

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.

SymptomCheck
TCP connection failurePLC IP, port502, routing and server availability. Use the actual transparent service port for a serial server.
Connected but no responseStation, TCP/RTU format and CPU family; also all serial settings for an RTU link.
Basic D reads work but extended areas failCPU range, family mapping,16-bit physical limits and internal command support. Do not treat high register bits as ordinary coils.
Offset or floating-point errorX/Y octal notation, element count, multi-WORD span and CDAB conversion.
Reversed character pairsString byte reversal; also check encoding and byte length for garbled text.