This file defines variables that used by modbus protocol.
History: Date Author Comment 08-01-2005 AceLan Kao. Create it.
Definition in file modbus_defs.h.
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | MAX_485_NUM 256 |
#define | MAX_BUFFER_SIZE 256 |
#define | MB_ASCII_ADU_MAX_LENGTH 512 |
#define | MB_ASCII_PROTOCOL 1 |
#define | MB_ERROR_BAD_FD -11 |
#define | MB_ERROR_BUFFER_TOO_SHORT -7 |
#define | MB_ERROR_EXECPTION -10 |
#define | MB_ERROR_FORMAT -1 |
#define | MB_ERROR_FREE 0 |
following error define it is OK | |
#define | MB_ERROR_FUNCTION -15 |
#define | MB_ERROR_LENGTH -2 |
too short, too long or boudary error | |
#define | MB_ERROR_MODE -16 |
#define | MB_ERROR_NET -12 |
#define | MB_ERROR_NO_FILE_HANDLE -13 |
#define | MB_ERROR_NO_FRAME -8 |
#define | MB_ERROR_NOT_OPENED -6 |
port has not opened | |
#define | MB_ERROR_OPEN -4 |
open port error | |
#define | MB_ERROR_PARAMETER -3 |
parameter error | |
#define | MB_ERROR_PROTOCOL -14 |
Protocol not define. | |
#define | MB_ERROR_TCP_NOT_CONNECTED -5 |
TCP port doesn't connect. | |
#define | MB_ERROR_TIMEOUT -9 |
#define | MB_OK 0 |
operating is OK | |
#define | MB_RTU_ADU_MAX_LENGTH 256 |
#define | MB_RTU_PROTOCOL 0 |
#define | MB_TCP_PORT 502 |
#define | MB_TCP_PROTOCOL 2 |
#define | MBF_DIAGNOSTIC 0x08 |
just for over serial line | |
#define | MBF_GET_COMM_EVENT_COUNTER 0x0B |
just for over serial line | |
#define | MBF_GET_COMM_EVENT_LOG 0x0C |
just for over serial line | |
#define | MBF_HAS_EXCEPTION 0x80 |
#define | MBF_MASK 0x7F |
mask function code | |
#define | MBF_MASK_WRITE_REGISTER 0x16 |
#define | MBF_READ_COILS 0x01 |
#define | MBF_READ_DECRETE_INPUTS 0x02 |
Modbus application function code define. | |
#define | MBF_READ_DEVICE_IDENTIFICATION 0x2B |
#define | MBF_READ_EXCEPTION_STATUS 0x07 |
just for over serial line | |
#define | MBF_READ_FIFO_QUEUE 0x18 |
#define | MBF_READ_FILE_RECORD 0x14 |
#define | MBF_READ_HOLDING_REGISTERS 0x03 |
#define | MBF_READ_INPUT_REGISTERS 0x04 |
#define | MBF_READ_WRITE_MULTIPLE_REGISTERS 0x17 |
#define | MBF_REPORT_SLAVE_ID 0x11 |
just for over serial line | |
#define | MBF_WRITE_FILE_RECORD 0x15 |
#define | MBF_WRITE_MULTIPLE_COILS 0x0F |
#define | MBF_WRITE_MULTIPLE_REGISTERS 0x10 |
#define | MBF_WRITE_SINGLE_COIL 0x05 |
#define | MBF_WRITE_SINGLE_REGISTER 0x06 |
#define | NBSF_FILE_RECORD 0x06 |
#define | U32_MAX_VALUE 0xFFFFFFFF |
Typedefs | |
typedef unsigned short | u16 |
typedef unsigned long | u32 |
typedef unsigned char | u8 |
|
Definition at line 35 of file modbus_defs.h. |
|
|
|
Definition at line 31 of file modbus_defs.h. Referenced by MBMakeADU(), MBSerialBlockRead(), MBSerialOpen(), and MBSerialSendAndWaitResponse(). |
|
Definition at line 74 of file modbus_defs.h. |
|
Definition at line 70 of file modbus_defs.h. |
|
|
Definition at line 64 of file modbus_defs.h. Referenced by MBASCIIToData(), MBSerialReadASCII(), and MBSerialReadRTU(). |
|
following error define it is OK
Definition at line 62 of file modbus_defs.h. |
|
|
too short, too long or boudary error
Definition at line 65 of file modbus_defs.h. Referenced by MBASCIIToData(). |
|
Definition at line 79 of file modbus_defs.h. Referenced by MBSerialSetMode(). |
|
Definition at line 75 of file modbus_defs.h. |
|
Definition at line 76 of file modbus_defs.h. |
|
Definition at line 71 of file modbus_defs.h. |
|
port has not opened
Definition at line 69 of file modbus_defs.h. |
|
open port error
Definition at line 67 of file modbus_defs.h. Referenced by MBSerialOpen(). |
|
parameter error
Definition at line 66 of file modbus_defs.h. |
|
Protocol not define.
Definition at line 77 of file modbus_defs.h. Referenced by MBMakeADU(), MBSerialBlockRead(), MBSerialOpen(), and MBSerialSendAndWaitResponse(). |
|
TCP port doesn't connect.
Definition at line 68 of file modbus_defs.h. Referenced by MBTCPServerWaitConnection(). |
|
Definition at line 72 of file modbus_defs.h. |
|
|
Definition at line 27 of file modbus_defs.h. Referenced by MBSerialSendAndWaitResponse(), MBTCPSendAndWaitResponse(), and MBTCPWrite(). |
|
Definition at line 30 of file modbus_defs.h. Referenced by MBMakeADU(), MBSerialBlockRead(), MBSerialOpen(), MBSerialSendAndWaitResponse(), serial_master(), and serial_slave(). |
|
Definition at line 26 of file modbus_defs.h. |
|
Definition at line 32 of file modbus_defs.h. Referenced by MBMakeADU(), and MBSerialOpen(). |
|
just for over serial line
Definition at line 53 of file modbus_defs.h. Referenced by MBDiagnostic(), MBGetDiagnostic(), MBGetResponseDiagnostic(), and MBResponseDiagnostic(). |
|
just for over serial line
Definition at line 54 of file modbus_defs.h. Referenced by MBGetCommEventCounter(), MBGetResponseGetCommEventCounter(), and MBResponseGetCommEventCounter(). |
|
just for over serial line
Definition at line 55 of file modbus_defs.h. Referenced by MBGetCommEventLog(), MBGetResponseGetCommEventLog(), and MBResponseGetCommEventLog(). |
|
Definition at line 58 of file modbus_defs.h. |
|
mask function code
Definition at line 59 of file modbus_defs.h. |
|
Definition at line 47 of file modbus_defs.h. Referenced by MBGetMaskWriteRegister(), MBGetResponseMaskWriteRegister(), and MBMaskWriteRegister(). |
|
Definition at line 39 of file modbus_defs.h. Referenced by MBGetReadCoils(), MBGetResponseReadCoils(), MBReadCoils(), and MBResponseReadCoils(). |
|
Modbus application function code define.
Definition at line 38 of file modbus_defs.h. Referenced by MBGetReadDecreteInputs(), MBGetResponseReadDecreteInputs(), MBReadDecreteInputs(), and MBResponseReadDecreteInputs(). |
|
Definition at line 57 of file modbus_defs.h. |
|
just for over serial line
Definition at line 52 of file modbus_defs.h. Referenced by MBGetResponseReadExceptionStatus(), MBReadExceptionStatus(), and MBResponseReadExceptionStatus(). |
|
Definition at line 48 of file modbus_defs.h. Referenced by MBGetReadFIFOQueue(), MBGetResponseReadFIFOQueue(), MBReadFIFOQueue(), and MBResponseReadFIFOQueue(). |
|
Definition at line 49 of file modbus_defs.h. |
|
Definition at line 43 of file modbus_defs.h. Referenced by MBGetReadHoldingRegisters(), MBGetResponseReadHoldingRegisters(), MBReadHoldingRegisters(), and MBResponseReadHoldingRegisters(). |
|
Definition at line 42 of file modbus_defs.h. Referenced by MBGetReadInputRegisters(), MBGetResponseReadInputRegisters(), MBReadInputRegisters(), and MBResponseReadInputRegisters(). |
|
Definition at line 46 of file modbus_defs.h. Referenced by MBGetReadWriteMultipleRegisters(), MBGetResponseReadWriteMultipleRegisters(), and MBReadWriteMultipleRegisters(). |
|
just for over serial line
Definition at line 56 of file modbus_defs.h. Referenced by MBGetResponseReportSlaveID(), and MBReportSlaveID(). |
|
Definition at line 50 of file modbus_defs.h. |
|
Definition at line 41 of file modbus_defs.h. Referenced by MBGetResponseWriteMultipleCoils(), MBGetWriteMultipleCoils(), and MBWriteMultipleCoils(). |
|
Definition at line 45 of file modbus_defs.h. Referenced by MBGetResponseWriteMultipleRegisters(), MBGetWriteMultipleRegisters(), MBResponseWriteMultipleRegisters(), and MBWriteMultipleRegisters(). |
|
Definition at line 40 of file modbus_defs.h. Referenced by MBGetResponseWriteSingleCoil(), MBGetWriteSingleCoil(), MBResponseWriteSingleCoil(), and MBWriteSingleCoil(). |
|
Definition at line 44 of file modbus_defs.h. Referenced by MBGetResponseWriteSingleRegister(), MBGetWriteSingleRegister(), MBResponseWriteSingleRegister(), and MBWriteSingleRegister(). |
|
Definition at line 51 of file modbus_defs.h. |
|
Definition at line 24 of file modbus_defs.h. Referenced by MBSerialReadRTU(). |
|
Definition at line 21 of file modbus_defs.h. |
|
Definition at line 22 of file modbus_defs.h. |
|
Definition at line 20 of file modbus_defs.h. |