modbus

Translate PLC register maps into EPICS Modbus IOC configurations.

1|1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/BCDA-APS/opencode-skills --skill modbus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modbus
Source: https://github.com/BCDA-APS/opencode-skills/tree/main/modbus
Command: npx skills add https://github.com/BCDA-APS/opencode-skills --skill modbus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modbus register maps often take significant effort to convert into working EPICS IOCs, because you must correctly wire communication ports, protocol interposing, Modbus port drivers, and matching database records.

Core Features & Use Cases

  • End-to-end Modbus IOC configuration: translate device register maps into asyn IP/serial port setup, modbus interpose configuration, and Modbus port driver creation.
  • Accurate function-code and datatype mapping: select the correct Modbus function code (FC1/2/3/4/5/6/15/16/23) and match it to EPICS record templates and data types.
  • Database templates and substitution generation: choose the right record templates (bit/word/analog/string/arrays) and produce substitution entries with correct PORT and OFFSET semantics.
  • Use Case: You have a PLC with mixed discrete inputs, holding registers, and float sensor values; use this Skill to produce the required st.cmd logic plus templates-driven substitution files that correctly poll and write those registers over TCP, UDP, RTU, or ASCII.

Quick Start

Configure an EPICS Modbus IOC by choosing the correct connection type (TCP/UDP/RTU/ASCII), creating modbus ports for each contiguous address range and function code, and then generating a substitution file that instantiates the appropriate database templates using the provided register offsets and data types.

Frequently Asked Questions about modbus

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure an EPICS Modbus IOC from a PLC register map?

Configuring an EPICS Modbus IOC involves translating PLC register maps into asyn port setup, modbus interpose framing, port drivers, and matching database templates. This process generates the required st.cmd logic and substitution files for PLC communication over TCP, UDP, RTU, or ASCII.

How do I map Modbus function codes to EPICS database templates?

Mapping Modbus function codes to EPICS database templates requires selecting the correct function code (FC1/2/3/4/5/6/15/16/23) for your discrete I/O or holding/input registers. You then choose matching record templates like bit, word, analog, string, or arrays to handle the data types.

Can I write multiple registers atomically in an EPICS Modbus IOC?

Writing multiple registers atomically in an EPICS Modbus IOC is supported using specific Modbus function codes. The configuration handles multi-register atomic writes by ensuring consistent data type byte and word order alongside precise OFFSET semantics for accurate record linking.

Why are my EPICS Modbus reads returning incorrect float values?

Incorrect float values during EPICS Modbus reads usually stem from inconsistent data type byte or word order configurations. Ensuring precise OFFSET semantics and consistent byte order matching between the PLC register map and the EPICS database templates corrects the read and write behavior.

Does the EPICS Modbus driver support both TCP and RTU connections?

The EPICS Modbus driver supports TCP, UDP, RTU, and ASCII connection types. You configure the appropriate asyn IP or serial port setup and modbus interpose framing to establish communication with your specific PLC and device communication scenario.

What is the correct OFFSET semantic when configuring EPICS Modbus port drivers?

The correct OFFSET semantic for configuring EPICS Modbus port drivers can be either relative or absolute. Precise OFFSET configuration is required alongside accurate function-code selection to ensure that database template substitution entries read and write registers correctly.