Application Programming Interface
This chapter lists the API functions that are provided by GOAL CCLIEFB. See the applications provides in appl/goal_ccliefb for a demonstration. For further details please refer to the Reference Manual.
The function goal_cclIeFbNew creates a handle that represents the stack instance. All functions with the exception of goal_cclIeFbInit and the configuration functions require this handle as a parameter.
In order to use these functions the header goal_ccl_ie_fb.h must be included.
goal_cclIeFbInit
Register the GOAL CC-Link IE Field Basic stack in GOAL. Returns a GOAL_STATUS_T value as result. This function must be called within the function appl_init().
No parameters required.
res = goal_cclIeFbInit();
goal_cclIeFbNew
Create a new GOAL CC-Link IE Field Basic stack slave instance with the given id and register an application callback handler. Returns a GOAL_STATUS_T value as result. This function must be called within the function appl_setup().
Returns a GOAL_STATUS_T value as result.
Table: goal_cclIeFbNew parameters
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T **ppCfb | GOAL CCLIEFB instance reference |
uint32_t id | instance id |
GOAL_CCLIEFB_FUNC_CB_T pFunc | GOAL CCLIEFB callback function |
res = goal_cclIeFbNew(&pCfbHdl, GOAL_CCLIEFB_INSTANCE_DEFAULT, appl_cclfbCb);
goal_cclIeFbAppStopSet
This function is used to indicate the stop status to the Master station. If the application is stopped process data is neither sent nor received until the application is started again. Here a GOAL_BOOL_T flag is passed, GOAL_TRUE means the application is stopping, GOAL_FALSE means, that the application is starting (again). This flag is sent in the cyclicData response messages of the slave.
Returns a GOAL_STATUS_T value as result.
Table: goal_cclIeFbAppStopSet parameters
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
GOAL_BOOL_T stop | application stop flag |
res = goal_cclIeFbAppStopSet(&pCfbHdl, BOOL_TRUE);
goal_cclIeFbAppErrorCodeSet
This function is used to indicate the stop status to the Master station. This can be used to indicate the reason of an stopped application. These error bytes are sent in the cyclicData response messages of the slave.
Returns a GOAL_STATUS_T value as result.
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
uint16_t errCode | application error code |
uint32_t errDetails | additional information |
Table: goal_cclIeFbAppErrorCodeSet parameters
goal_cclIeFbIoAccessStart
This function is used to get access to the I/O data. This function must be used before any goal_cclIeFbOutputGet and goal_cclIeFbInputSet call corresponding to one process data image to lock internal resources to ensure consistency of I/O data across multiple read and write operations.
Returns a GOAL_STATUS_T value as result.
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
Table: goal_cclIeFbIoAccessStart parameters
goal_cclIeFbIoAccessEnd
This function is used to return access to the I/O data. This function must be used after all goal_cclIeFbOutputGet and goal_cclIeFbInputSet calls corresponding to one process data image to unlock internal resources to ensure the correct update of I/O data.
Returns a GOAL_STATUS_T value as result.
Table: goal_cclIeFbIoAccessEnd parameters
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
goal_cclIeFbOutputGet
This function is used to get the output data from the master belonging to one of the link devices RY or RWw. It is possible to read more than one station at once. Further it is possible to get a part of the cyclic data only by addressing using an offset. Between two different read commands it may be possible, that the stack updated the cyclic data.
Returns a GOAL_STATUS_T value as result.
Table: goal_cclIeFbOutputGet parameters
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
GOAL_CCLIEFB_LINK_DEV_ID_T devId | link device Id |
uint8_t *pBuf | write buffer |
uint16_t bufLen | write buffer length |
uint16_t offset | offset within link device |
goal_cclIeFbInputSet
This function is used to get the output data from the master belonging to one of the link devices RX or RWr. It is possible to write more than one station at once. Further it is possible to write a part of the cyclic data only by addressing using an offset. Between two different write commands it may be possible, that the stack sent the new data already.
Returns a GOAL_STATUS_T value as result.
Table: goal_cclIeFbInputSet parameters
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
GOAL_CCLIEFB_LINK_DEV_ID_T devId | link device Id |
uint8_t *pBuf | new data |
uint16_t bufLen | data length |
uint16_t offset | offset within link device |
goal_cclIeFbVersionGet
Get the version of the GOAL CCLIEFB stack.
Returns a GOAL_STATUS_T value as result.
Table: goal_cclIeFbVersionGet parameters
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T *pCfb | GOAL CCLIEFB handle |
const char *pVersion | version string |
Â
Â