Part XXIX. MODBUS

James Smith

eCosCentric Limited
[Important]Important

This eCosPro-MODBUS package is STRICTLY LICENSED FOR INTERNAL EVALUATION AND TESTING PURPOSES ONLY for a maximum period of THREE months from the initial delivery of your eCosPro release. It may not be used for production purposes nor redistributed in full or in part in any format, including source code, binary code and object code format. Shipment of prototypes, hardware or products containing the package in any format is STRICTLY PROHIBITED.

A separate COMMERCIAL LICENSE for this package from eCosCentric is required to receive technical support for the package as well as permit distribution of binary forms of this package.

Some releases of eCosPro may not include evaluation copies of this package. In this case, please contact eCosCentric for licensing and availability. You must obtain written permission from eCosCentric to exceed the evaluation period.

Table of Contents

102. MODBUS overview
102.1. Introduction
103. Configuration
103.1. Configuration Overview
103.1.1. Quick Start
103.1.2. Configuring the MODBUS server
103.1.3. Configuring the ModbusTCP Server
104. API Overview
104.1. Application API
cyg_modbus_server_start — Start MODBUS server
cyg_modbus_server_stop — Stop MODBUS server
104.2. Backend API
cyg_modbus_response — Provide MODBUS response
cyg_modbus_raw_pdu — Access raw PDU buffer
cyg_modbus_response_nocopy — Provide MODBUS response (no copy)
cyg_modbus_response_exception — Provide MODBUS exception response
cyg_modbus_get_uid — Read “Unit ID” of request
104.3. ModbusTCP specific API
cyg_modbus_acm_add — Add client address to Access Control Mechanism pool
cyg_modbus_acm_remove — Remove ACM registered client address
104.4. MODBUS Exceptions
104.5. Backend Interface
cyg_mbop_read_discrete_inputs — Read discrete inputs
cyg_mbop_read_coils — Read coils
cyg_mbop_write_single_coil — Write single coil
cyg_mbop_write_multiple_coils — Write multiple coils
cyg_mbop_read_input_regs — Read input registers
cyg_mbop_read_holding_regs — Read holding registers
cyg_mbop_write_single_reg — Write single holding register
cyg_mbop_write_multiple_regs — Write multiple holding registers
cyg_mbop_rw_multiple_regs — Read and/or write multiple holding registers
cyg_mbop_mask_reg — Mask holding register
cyg_mbop_read_fifo_queue — Read FIFO contents
cyg_mbop_read_file_record — Read file records
cyg_mbop_write_file_record — Write file records
cyg_mbop_read_id — Return specific extended device ID
cyg_mbop_canopen — Perform CANOPEN operation
104.6. Example backend
105. Internals
106. Debug and Test
106.1. Debugging
106.1.1. Asserts
106.1.2. Diagnostic Output
106.2. Testing
106.2.1. modbus_ut
106.2.2. modbus_server