RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

    • Extension Components Overview
    • filter

    • transform

    • external

    • ai

    • ci

    • IoT

      • OPC_UA Subscribe
      • OPC_UA Read
      • OPC_UA Write
      • Modbus Node
        • Configuration
        • Command Description
        • Relation Type
        • Execution Result
  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

目录

Modbus Node

x/modbus component: v0.29.0+ A Modbus read/write component used to perform Modbus protocol read or write operations. Supports two communication protocols: TCP and RTU.

Additional extension library required: rulego-components-iot (opens new window)

# Configuration

Field Type Description Default Value
server string Modbus server address (Format: <mode>://<host:port> or <mode>://<serial device>) tcp://127.0.0.1:502
cmd string Modbus command name, supported commands include:
ReadCoils, ReadDiscreteInputs, ReadRegisters, WriteCoil, WriteRegisters, etc.
ReadCoils
unitId uint8 Unit ID (Slave ID).Format: uint8, Example: 1 1
address string Register address, placeholder variables ${} are allowed. Format: uint16, Example: 16 None
quantity string Number of registers, placeholder variables ${} are allowed None
value string Register value, placeholder variables ${} are allowed. No need to provide for reading. If writing multiple values, separate them with commas. For example: 0x01,0x01, true, 51,52. None
regType uint Register type, options:
0 - Holding Register(0x03)
1 - Input Register(0x04)
None
TcpConfig TCP Configuration Parameters
timeout int64 Request timeout in seconds 5
certPath string Path to the certificate (required for TLS/SSL connections) None
keyPath string Path to the private key (required for TLS/SSL connections) None
caPath string Path to the CA certificate (required for TLS/SSL connections) None
RtuConfig RTU Configuration Parameters
speed uint Serial baud rate (RTU mode only) 19200
dataBits uint Number of data bits (RTU mode only) 8
parity uint Parity mode (RTU mode only), options:
0 - None
1 - Even
2 - Odd
0
stopBits uint Number of stop bits (RTU mode only) 2
EncodingConfig Encoding Configuration Parameters
endianness uint Byte order of registers, options:
1 - Big Endian
2 - Little Endian
1
wordOrder uint Word order for 32-bit registers, options:
1 - High Word First
2 - Low Word First
1

# Command Description

Command Name Command Description Parameter Description
ReadCoils Read coil statuses address: Starting address of coils
quantity: Number of coils to read
ReadCoil Read a single coil status address: Address of the coil
ReadDiscreteInputs Read discrete input statuses address: Starting address of discrete inputs
quantity: Number of inputs to read
ReadDiscreteInput Read a single discrete input status address: Address of the discrete input
ReadRegisters Read registers address: Starting address of registers
quantity: Number of registers to read
regType: Register type (e.g., Holding Register or Input Register)
ReadRegister Read a single register address: Address of the register
regType: Register type
ReadUint32s Read unsigned 32-bit integers address: Starting address of registers
quantity: Number of registers to read
regType: Register type
ReadUint32 Read a single unsigned 32-bit integer address: Address of the register
regType: Register type
ReadFloat32s Read 32-bit floating-point numbers address: Starting address of registers
quantity: Number of registers to read
regType: Register type
ReadFloat32 Read a single 32-bit floating-point number address: Address of the register
regType: Register type
ReadUint64s Read unsigned 64-bit integers address: Starting address of registers
quantity: Number of registers to read
regType: Register type
ReadUint64 Read a single unsigned 64-bit integer address: Address of the register
regType: Register type
ReadFloat64s Read 64-bit floating-point numbers address: Starting address of registers
quantity: Number of registers to read
regType: Register type
ReadFloat64 Read a single 64-bit floating-point number address: Address of the register
regType: Register type
ReadBytes Read byte data address: Starting address of registers
quantity: Number of registers to read
regType: Register type
ReadRawBytes Read raw byte data address: Starting address of registers
quantity: Number of registers to read
regType: Register type
WriteCoil Write a single coil status address: Address of the coil
value: Value to write (boolean)
WriteCoils Write multiple coil statuses address: Starting address of coils
value: Values to write (boolean array)
WriteRegister Write a single register address: Address of the register
value: Value to write (16-bit integer)
WriteRegisters Write multiple registers address: Starting address of registers
value: Values to write (16-bit integer array)
WriteUint32 Write a single unsigned 32-bit integer address: Address of the register
value: Value to write (32-bit integer)
WriteUint32s Write multiple unsigned 32-bit integers address: Starting address of registers
value: Values to write (32-bit integer array)
WriteFloat32 Write a single 32-bit floating-point number address: Address of the register
value: Value to write (floating-point number)
WriteFloat32s Write multiple 32-bit floating-point numbers address: Starting address of registers
value: Values to write (floating-point number array)
WriteUint64 Write a single unsigned 64-bit integer address: Address of the register
value: Value to write (64-bit integer)
WriteUint64s Write multiple unsigned 64-bit integers address: Starting address of registers
value: Values to write (64-bit integer array)
WriteFloat64 Write a single 64-bit floating-point number address: Address of the register
value: Value to write (floating-point number)
WriteFloat64s Write multiple 64-bit floating-point numbers address: Starting address of registers
value: Values to write (floating-point number array)
WriteBytes Write byte data address: Starting address of registers
value: Values to write (byte array)
WriteRawBytes Write raw byte data address: Starting address of registers
value: Values to write (byte array)

# Relation Type

  • Success: On successful execution, the message is sent to the Success chain.
  • Failure: On failed execution, the message is sent to the Failure chain.

# Execution Result

Write: Do not change the message payload value.

Read: Returns an array, where each element is an object containing the following fields:

  • Field List
Field Name Data Type Description
unitId int Unit ID (Slave ID)
type string Data type, e.g., "uint16"
address int Address, indicating the storage location of the data
value int float bool []byte Current value, representing the data content
  • Example Data(reading Modbus data format):
[
  {
    "unitId": 1,
    "type": "uint16",
    "address": 4,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 5,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 6,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 7,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 8,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 9,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 10,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 11,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 12,
    "value": 0
  },
  {
    "unitId": 1,
    "type": "uint16",
    "address": 13,
    "value": 0
  }
]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Edit this page on GitHub (opens new window)
Last Updated: 2025/04/02, 01:29:50
OPC_UA Write
Custom Components Overview

← OPC_UA Write Custom Components Overview→

Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式