add three PLC test demo and readme

This commit is contained in:
Wien.b
2023-11-23 23:23:08 -08:00
parent b82bdaea6b
commit d3c7d7ce9f
42 changed files with 522 additions and 158 deletions

View File

@@ -57,6 +57,7 @@ typedef enum
PROTOCOL_MELSEC_3C,
PROTOCOL_FREEMODBUS_TCP_SERVER,
PROTOCOL_CIP,
PROTOCOL_ETHERCAT,
PROTOCOL_END
}ProtocolType;
@@ -116,6 +117,7 @@ int ControlProtocolIoctl(struct ControlProtocol *control_protocol, int cmd, void
/*Control Framework new certain Protocol*/
ControlProtocolType control_protocol;
#ifdef __cplusplus
}
#endif

View File

@@ -57,6 +57,10 @@ extern int FreeModbusTcpServerInit(struct ControlRecipe *p_recipe);
extern int CipProtocolInit(struct ControlRecipe *p_recipe);
#endif
#ifdef CONTROL_PROTOCOL_ETHERCAT
extern int EthercatProtocolInit(struct ControlRecipe *p_recipe);
#endif
/*
CONTROL FRAMEWORK READ DATA FORMAT:
| HEAD |device_id|read data length|read item count| data |
@@ -103,6 +107,11 @@ static struct ControlProtocolInitParam protocol_init[] =
#ifdef CONTROL_PROTOCOL_CIP
{ PROTOCOL_CIP, CipProtocolInit },
#endif
#ifdef CONTROL_PROTOCOL_ETHERCAT
{ PROTOCOL_ETHERCAT, EthercatProtocolInit },
#endif
{ PROTOCOL_END, NULL },
};