|
MC Protocol Serial C++ 0.2.3
MC protocol serial library for MCU-oriented environments
|
Audience: users who want to move from the host-side examples to actual MCU firmware.
This page points to the real-UART read-only samples for RP2040, ESP32-C3, and Arduino Mega 2560.
The sample:
MelsecSerialClient with the sample's own default UART / protocol settingspending_tx_frame()notify_tx_complete() after flush()on_rx_bytes()D100-D103Those settings are intentionally simple sample defaults. They are not the authority for the current validated settings of every target. Before wiring real hardware, check HARDWARE_VALIDATION.md.
Sample source:
19200 / 8E14C ASCII Format4CR/LFoff0D100-D103Use this section only to understand what the sample code does by default.
For exact validated target settings, use ../validation/reports/HARDWARE_VALIDATION.md.
The board environments also define default UART pins:
rpipico-arduino-uart-exampleTX=0RX=1esp32-c3-devkitm-1-uart-exampleTX=7RX=6mega2560-arduino-uart-exampleTX1=18RX1=19Treat these as starting values. Change them to match your actual board wiring.
The sample is intentionally simple.
Serial for debug output and Serial1 for the PLC line.Serial for debug output and Serial1 for the PLC line.flush() as the TX completion point.In a production firmware port you may replace flush() with:
HARDWARE_VALIDATION.md.TTL <-> RS-232C level shifter.D range works from the MCU.