|
Modbus 0.3
Библиотека Modbus для STM
|
Определения протокола модбас More...
Classes | |
| struct | MB_DevIdMsgTypeDef |
| Structure for device identifications message type. More... | |
| struct | RS_MsgTypeDef |
| Structure for modbus messsage. More... | |
Macros | |
| #define | TransactionID_size 2 |
| size of (Transaction ID) | |
| #define | ProtocolID_size 2 |
| size of (Protocol ID) | |
| #define | PDULength_size 2 |
| size of (PDU Length) | |
| #define | MbAddr_SIZE 1 |
| size of (Slave Addr) | |
| #define | Func_Code_SIZE 1 |
| size of (Function Code) | |
| #define | Addr_SIZE 2 |
| size of (Address) | |
| #define | Qnt_SIZE 2 |
| size of (Quantity) | |
| #define | ByteCnt_SIZE 1 |
| size of (Byte Count) | |
| #define | DATA_SIZE 125 |
| maximum number of data: DWORD (NOT MESSAGE SIZE) | |
| #define | CRC_SIZE 2 |
| size of (MbCRC) in bytes | |
| #define | INFO_SIZE_MAX (MbAddr_SIZE+Func_Code_SIZE+Addr_SIZE+Qnt_SIZE+ByteCnt_SIZE) |
| Size of whole RTU message. | |
| #define | RX_FIRST_PART_SIZE INFO_SIZE_MAX |
| Size of first part of message that will be received first receive info part of message, than defines size of rest message. | |
| #define | MSG_SIZE_MAX (INFO_SIZE_MAX + DATA_SIZE*2 + CRC_SIZE) |
| Size of buffer: max size of whole message. | |
| #define | FC_ERR_VALUES_START 0x80U |
| from this value starts error func codes | |
| #define | MB_Set_Arr16_Ptr(_arr_) |
| Macros to set pointer to 16-bit array. | |
| #define | MB_Set_Register_Ptr(_parr_, _addr_) |
| Macros to set pointer to register. | |
| #define | MB_Set_Coil_Reg_Ptr(_parr_, _coil_) |
| Макрос для установки указателя на регистр, содержащий запрашиваемый коил | |
| #define | MB_Set_Coil_Mask(_coil_) |
| Макрос для установки маски, чтобы выделить запрашиваемый коил из регистра | |
Enumerations | |
| enum | MB_ExceptionTypeDef { ET_NO_ERRORS = 0x00 , ET_ILLEGAL_FUNCTION = 0x01 , ET_ILLEGAL_DATA_ADDRESS = 0x02 , ET_ILLEGAL_DATA_VALUE = 0x03 , ET_SLAVE_DEVICE_FAILURE = 0x04 } |
| Enum for modbus exception codes. More... | |
| enum | MB_FunctonTypeDef { FC_R_COILS = 0x01 , FC_R_DISC_IN = 0x02 , FC_R_HOLD_REGS = 0x03 , FC_R_IN_REGS = 0x04 , FC_W_COIL = 0x05 , FC_W_HOLD_REG = 0x06 , FC_W_COILS = 0x0F , FC_W_HOLD_REGS = 0x10 , FC_R_DIAGNOSTICS = 0x08 , FC_R_DEVICE_ID = 0x2B , FC_ERR_R_COILS = FC_R_COILS + FC_ERR_VALUES_START , FC_ERR_R_DISC_IN = FC_R_DISC_IN + FC_ERR_VALUES_START , FC_ERR_R_IN_REGS = FC_R_IN_REGS + FC_ERR_VALUES_START , FC_ERR_R_HOLD_REGS = FC_R_HOLD_REGS + FC_ERR_VALUES_START , FC_ERR_W_COIL = FC_W_COIL + FC_ERR_VALUES_START , FC_ERR_W_HOLD_REG = FC_W_HOLD_REG + FC_ERR_VALUES_START , FC_ERR_W_COILS = FC_W_COILS + FC_ERR_VALUES_START , FC_ERR_W_HOLD_REGS = FC_W_HOLD_REGS + FC_ERR_VALUES_START , FC_ERR_R_DIAGNOSTIC = FC_R_DIAGNOSTICS + FC_ERR_VALUES_START , FC_ERR_R_DEVICE_INFO = FC_R_DEVICE_ID + FC_ERR_VALUES_START } |
| Enum for modbus func codes. More... | |
| enum | MB_MEITypeDef { MEI_DEVICE_IDENTIFICATIONS = 0x0E } |
| Enum for MEI func codes. More... | |
| enum | ReadDevId { RID_BASIC_IDENTIFICATIONS = 0x01 , RID_REGULAR_IDENTIFICATIONS = 0x02 , RID_EXTENDED_IDENTIFICATIONS = 0x03 , RID_SPEDIFIC_IDENTIFICATIONS = 0x04 } |
| Enum for Read Device Id codes. More... | |
Variables | |
| RS_MsgTypeDef | MODBUS_MSG |
| Default Message Struct for Modbus. | |
Определения протокола модбас
| #define TransactionID_size 2 |
size of (Transaction ID)
Definition at line 45 of file modbus_core.h.
| #define ProtocolID_size 2 |
size of (Protocol ID)
Definition at line 46 of file modbus_core.h.
| #define PDULength_size 2 |
size of (PDU Length)
Definition at line 47 of file modbus_core.h.
| #define MbAddr_SIZE 1 |
size of (Slave Addr)
Definition at line 48 of file modbus_core.h.
| #define Func_Code_SIZE 1 |
size of (Function Code)
Definition at line 49 of file modbus_core.h.
| #define Addr_SIZE 2 |
size of (Address)
Definition at line 50 of file modbus_core.h.
| #define Qnt_SIZE 2 |
size of (Quantity)
Definition at line 51 of file modbus_core.h.
| #define ByteCnt_SIZE 1 |
size of (Byte Count)
Definition at line 52 of file modbus_core.h.
| #define DATA_SIZE 125 |
maximum number of data: DWORD (NOT MESSAGE SIZE)
Definition at line 53 of file modbus_core.h.
| #define CRC_SIZE 2 |
size of (MbCRC) in bytes
Definition at line 54 of file modbus_core.h.
| #define INFO_SIZE_MAX (MbAddr_SIZE+Func_Code_SIZE+Addr_SIZE+Qnt_SIZE+ByteCnt_SIZE) |
Size of whole RTU message.
Definition at line 58 of file modbus_core.h.
| #define RX_FIRST_PART_SIZE INFO_SIZE_MAX |
Size of first part of message that will be received first receive info part of message, than defines size of rest message.
Definition at line 66 of file modbus_core.h.
| #define MSG_SIZE_MAX (INFO_SIZE_MAX + DATA_SIZE*2 + CRC_SIZE) |
Size of buffer: max size of whole message.
Definition at line 69 of file modbus_core.h.
| #define FC_ERR_VALUES_START 0x80U |
from this value starts error func codes
Definition at line 88 of file modbus_core.h.
| #define MB_Set_Arr16_Ptr | ( | _arr_ | ) |
Macros to set pointer to 16-bit array.
| _arr_ | - массив регистров (16-бит). |
Definition at line 209 of file modbus_core.h.
| #define MB_Set_Register_Ptr | ( | _parr_, | |
| _addr_ ) |
Macros to set pointer to register.
| _parr_ | - массив регистров. |
| _addr_ | - Номер регистра (его индекс) от начала массива arr. |
Definition at line 215 of file modbus_core.h.
| #define MB_Set_Coil_Reg_Ptr | ( | _parr_, | |
| _coil_ ) |
Макрос для установки указателя на регистр, содержащий запрашиваемый коил
| _parr_ | - массив коилов. |
| _coil_ | - Номер коила от начала массива arr. |
Definition at line 232 of file modbus_core.h.
| #define MB_Set_Coil_Mask | ( | _coil_ | ) |
Макрос для установки маски, чтобы выделить запрашиваемый коил из регистра
| _coil_ | - Номер коила от начала массива arr. |
Definition at line 251 of file modbus_core.h.
| enum MB_ExceptionTypeDef |
Enum for modbus exception codes.
Prefix ET for Error Type
Definition at line 75 of file modbus_core.h.
| enum MB_FunctonTypeDef |
Enum for modbus func codes.
Prefix FC for Function Code
Definition at line 93 of file modbus_core.h.
| enum MB_MEITypeDef |
Enum for MEI func codes.
Definition at line 134 of file modbus_core.h.
| enum ReadDevId |
Enum for Read Device Id codes.
Prefix RID for Read ID
Definition at line 143 of file modbus_core.h.
|
extern |