Operation

Functional Block Diagram

Core functions

The Control Unit (CU) serves as the primary processing module of the system:

  • I/O Module Polling
  • Communication Services (Modbus TCP / MQTT)
  • PLC Logic Execution
  • Local Interface Management
  • USB communication (Download / Live Debug)

I/O Module Polling

  • Polling method: sequential, deterministic
  • Poll time per module: ~5 ms
  • Function: reads module status, updates outputs, and maintains synchronized I/O data structures
💡 Total update time

The total update time depends on the model size (5 modules / 10 modules / 15 modules).
The I/O update is asynchronous from PLC logic execution.

Communication Services

The CU maintains network communication tasks in parallel with I/O polling and logic processing. Supported modes:

  • Modbus TCP Server
  • MQTT Client

Functions:

  • Processes incoming and outgoing frames
  • Updates communication registers/buffers
  • Ensures protocol availability during each scan cycle

PLC Logic Execution

  • Executes the user program based on Task scheduling
  • Deterministic runtime behavior
  • Operates independently of communication and USB activity

Local Interface Management

  • Monitors built-in user button for OLED menu interactions
  • Drives the integrated OLED display for status and diagnostics
  • The OLED Display refresh does not have an impact on PLC execution timing

USB Communication

  • Used for downloading the PLC program or debugging the currently loaded program
  • USB tasks are event-driven and handled without affecting core control functions
  • USB FS is limited to 12 Mbps, resulting in a refresh rate ~500 variables/second
  • Automatically disabled when not connected
⚠️ Too many variables

A large number of variables can result in a very low refresh rate, making debugging difficult.

Future improvement

In the next model, we plan to switch to USB HS, which should increase the speed up to 40x faster, eliminating this limitation.