feat add modbus tcp protocol for control framework
This commit is contained in:
@@ -37,6 +37,10 @@ extern int FinsProtocolInit(struct ControlRecipe *p_recipe);
|
||||
extern int MelsecProtocolInit(struct ControlRecipe *p_recipe);
|
||||
#endif
|
||||
|
||||
#ifdef CONTROL_PROTOCOL_MODBUS_TCP
|
||||
extern int ModbusTcpProtocolInit(struct ControlRecipe *p_recipe);
|
||||
#endif
|
||||
|
||||
/*
|
||||
CONTROL FRAMEWORK READ DATA FORMAT:
|
||||
| HEAD |device_id|read data length|read item count| data |
|
||||
@@ -66,6 +70,9 @@ static struct ControlProtocolInitParam protocol_init[] =
|
||||
{ PROTOCOL_MELSEC_1C, MelsecProtocolInit },
|
||||
{ PROTOCOL_MELSEC_3C, MelsecProtocolInit },
|
||||
#endif
|
||||
#ifdef CONTROL_PROTOCOL_MODBUS_TCP
|
||||
{ PROTOCOL_MODBUS_TCP, ModbusTcpProtocolInit },
|
||||
#endif
|
||||
|
||||
{ PROTOCOL_END, NULL },
|
||||
};
|
||||
|
||||
@@ -69,6 +69,7 @@ typedef struct
|
||||
{
|
||||
uint16_t command_length;
|
||||
uint16_t data_size;
|
||||
uint8_t command_ready;
|
||||
uint8_t *p_command;
|
||||
uint8_t *p_data;
|
||||
}BasicPlcDataInfo;
|
||||
|
||||
Reference in New Issue
Block a user