Serial Port

Serial Port

ID: uniflow.plugin.serialport Category: Network & Communication Protocols Version: v1.3.0 Min Uniflow Version: Uniflow ≥ v1.4.0

Serial Port Plugin Reference Manual

1. Overview

Plugin Name: Serial Port

Type: Generic Protocol

Identifier: uniflow.plugin.serialport

Description

Receive data from external hardware via serial COM ports.


2. Technical Architecture

The Serial Port plugin provides asynchronous serial communication interface over RS-232, RS-422, and RS-485 physical hardware or USB virtual COM ports. It handles configurable framing settings (Baud Rate, Data Bits, Parity, Stop Bits, Flow Control/Handshaking), manages RTS/DTR pin signals, provides buffer delimiter framing (CRLF, STX/ETX, Fixed Length), and executes non-blocking background thread read/write loops.

System Interaction & Exposed Catalog Routes

The Serial Port plugin manages RS-232, RS-422, and RS-485 serial communication using System.IO.Ports. It configures baud rates, parity, and stop bits, buffers incoming byte streams, applies delimiter/regex framing, and transmits serial command strings.

Catalog Routes & Node Integration

Input Event Triggers (Input Nodes):

  • serial.data_received - Emitted when a framed serial packet is received.
  • serial.line_read - Emitted on delimiter-terminated line arrival.
  • serial.port_status_changed - COM port connection state event.
  • Executable Actions (Action Nodes):

  • serial.write_string - Writes an ASCII string to serial port.
  • serial.write_hex_bytes - Transmits a raw hexadecimal byte array.
  • serial.flush_buffers - Clears RX/TX buffers.
  • Architecture Diagram

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...

    3. Configuration Parameters

    The following configuration fields are available in the User Interface for this plugin:

    Configuration SettingDescription
    COM PortNumeric value specifying the com port.
    Baud RateSpecifies the baud rate.
    Data BitsSpecifies the data bits.
    ParitySpecifies the parity.
    Stop BitsSpecifies the stop bits.
    Handshake / Flow ControlSpecifies the handshake / flow control.
    Enable RTSToggle to enable or disable enable rts.
    Enable DTRToggle to enable or disable enable dtr.

    4. Exposed Routes & Data Types

    This plugin exposes catalog fields across the following rule graph nodes:

    Input Source

    The Input Source node reads serial port state and cached incoming byte stream data.

    Human-Readable Field NameData TypeDescription
    Last Received  String
    Raw string or character representation of the most recent message received on the COM port.
    Connection Status  Bool
    Boolean flag indicating whether the serial hardware connection is established (True) or disconnected (False).

    Event Input

    The Event Input node listens for real-time serial buffer data arrival events.

    Human-Readable Field NameData TypeExposed Event Fields & Data TypesDescription
    Data Received  Event Object
    Data (String)
    Payload (String)
    Length (Int32)
    Hex (String)
    Timestamp (DateTime)
    Asynchronous event triggered immediately whenever raw bytes or delimiter-framed text arrive on the COM port.

    Output Target

    The Output Target node acts as an action sink node to write data out to the physical serial port interface.

    Target NameData TypeAssociated ParametersParameter Data TypeRequiredDescription
    Send Data  Variant
    Message (message)StringTrueCharacter string or byte payload to transmit over the serial COM line.
    Write Type (WriteTypeParam)StringTrueEncoding type for transmit data (String or Byte).

    5. Usage Examples

    Scenario A: Serial RS-485 Weighing Scale Telegram Updates Modbus Holding Register & Dispatches Webhook

    Workflow Overview:

    A industrial weigh scale sends RS-485 line-delimited ASCII text ("ST,GS,+01250.5kg\r\n" via serial.data_received). Uniflow parses the weight value (1250.5 kg) and executes two actions:

    1. Writes the weight float value into a Modbus TCP holding register (HoldingRegister 300 = 1250.5).

    2. Sends an HTTP POST notification to the warehouse inventory ERP.

    Rule Node Configuration:

    1. Event Input Node: Serial Port Listener

  • Filter Event: serial.data_received
  • Exposed Fields: Data (String), Length (Int32), Timestamp (DateTime)
  • 2. Logic Filter Node: Regex Match

  • Pattern: \+([0-9\.]+)kg
  • Extracted Signal: Weight (Double)
  • 3. Output Target Node A: Modbus Client Writer

  • Action Target: Direct Access
  • Type: Holding Register
  • Address: 300
  • Value: Weight
  • 4. Output Target Node B: HTTP Client Action

  • Action Target: POST Request
  • URL: https://erp.warehouse.local/api/scale-log
  • Logic Flow Diagram:

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...

    Scenario B: Milestone Motion Alarm Event Transmits Serial Hex Command to Physical Strobe Relay Board

    Workflow Overview:

    When Milestone XProtect triggers a motion alarm event, Uniflow converts the event into a raw 4-byte hexadecimal command (0xA5 0x01 0x01 0x55) and transmits it (serial.write_hex_bytes) over RS-232 to activate a physical strobe light relay board connected to COM1.

    Rule Node Configuration:

    1. Event Input Node: Milestone XProtect Listener

  • Event Code: MOTION_DETECTED
  • Exposed Fields: CameraGuid (String)
  • 2. Logic Pass-Through Node: Constant Hex String

  • Payload Value: "A5010155"
  • 3. Output Target Node: Serial Port Writer

  • Action Target: Send Data (serial.write_hex_bytes)
  • Message: "A5010155"
  • WriteTypeParam: Byte
  • Logic Flow Diagram:

    VISUAL ARCHITECTURE FLOW DIAGRAM
    Rendering Flow Architecture Diagram...
    Architecture Flow Diagram — Full Preview