weAutSys' system calls, services and types for the Modbus server
This file contains the definitions for weAutSys' system calls, services and types for the build in Modbus server. It implies an uIP used as TCP/IP stack.
This is system software and must not be modified for user or application programs.
This file is part of weAutSys <weinert-automation.de>
Copyright © 2012 Albrecht Weinert, Bochum
Defines | |
#define | COIL_SINGLE |
Modbus data model: Single coil bit addressed 'C'. | |
#define | COILS_BYMAPD |
Modbus data model: Coils byte mapped 'c'. | |
#define | DISC_INP_BYMAPD |
Modbus data model: Discrete inputs byte mapped 'i'. | |
#define | HLD_MASK |
Modbus data model: Single Holding register for mask 'H'. | |
#define | HLD_REGISTERS |
Modbus data model: Holding registers 'h'. | |
#define | INP_REGISTERS |
Modbus data model: Input registers 'r'. | |
#define | MODB_FCIND 7 |
Modbus: index of function code in the TCP/IP telegram. | |
#define | MODB_MBAB_LEN 7 |
Modbus: length of the TCP/IP telegram start (MBAB header) | |
Defines for Modbus function codes and the like | |
This is a subset of the function codes defined for the Modbus protocol. The others not put here are not implemented by this server. | |
#define | WRITE_COIL 0x05 |
Modbus function code: write one bit output. | |
#define | READ_COILS 0x01 |
Modbus function code: read back bitwise output. | |
#define | WRITE_COILS 0x0F |
Modbus function code: write bitwise output. | |
#define | READ_DISCRETE_INPUTS 0x02 |
Modbus function code: read bitwise inputs. | |
#define | READ_INPUT_REGISTERS 0x04 |
Modbus function code: read word (16 bit) inputs. | |
#define | READ_HOLDING_REGISTERS 0x03 |
Modbus function code: read back word (16 bit) outputs. | |
#define | WRITE_HOLDING_REGISTERS 0x10 |
Modbus function code: write word (16 bit) outputs. | |
#define | WRITE_HOLDING_REGISTER 0x06 |
Modbus function code: write (one) word (16 bit) output. | |
#define | MASK_WRITE_REGISTER 0x16 |
Modbus function code: and and or (one) word (16 bit) output. | |
#define | WRITE_READ_REGISTERS 0x17 |
Modbus function code: write than read word (16 bit) outputs. | |
#define | MODB_EXC_FUNC 1 |
Modbus exception: unimplemented function code. | |
#define | MODB_EXC_ADDR 2 |
Modbus exception: illegal address. | |
#define | MODB_EXC_DATA 3 |
Modbus exception: invalid data (or length) | |
#define | MODB_EXC_OPER 4 |
Modbus exception: the (partly) performed operation failed. | |
Functions | |
ptfnct_t | appModFun (struct modThr_data_t *m) |
Handle Modbus server events. | |
ptfnct_t | modbusAppcall (void) |
Handle Modbus server events. | |
void | modbusInit (void) |
Initialise the Modbus (server) | |
void | registerAppModFun (p2ptFunM appModFun) |
Register the application Modbus handler function. |