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.
1 r e s = g o a l _ c c l I e F b I n i t ( ) ;
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().
Table 4: goal_cclIeFbNew parameters
Parameter Description
GOAL_CCLIEFB_HANDLE_T **ppCfb GOAL CCLIEFB instance reference uint32_t id instance id
GOAL_CCLIEFB_FUNC_CB_TpFunc GOAL CCLIEFB callbackfunction
1 r e s = goal_ ccl Ie Fb New (& pCfbHdl , GOAL_CCLIEFB_INSTANCE_DEFAULT , a p p l _ c c l f b C b ) ;
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 5: goal_cclIeFbAppStopSet parameters
Parameter Description
GOAL_CCLIEFB_HANDLE_T*pCfb GOAL CCLIEFBhandle GOAL_BOOL_Tstop application stopflag
1 r e s = g o a l_ c c l I e F b App St o p Se t (& 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.
Table 6: goal_cclIeFbAppErrorCodeSet parameters
Parameter Description
GOAL_CCLIEFB_HANDLE_T *pCfb GOAL CCLIEFB handle uint16_t errCode application error code
uint32_terrDetails additionalinformation
1 r e s = g o a l _ c c l I e F b A p p E r r o r C o d e S e t (& pCfbHdl , 1 , 17 ) ;
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.
Table 7: goal_cclIeFbIoAccessStart parameters
Parameter Description
GOAL_CCLIEFB_HANDLE_T*pCfb GOAL CCLIEFBhandle
1 r e s = g o a l _ c c l I e F b I o A c c e s s S t a r t ( p Cfb Hdl ) ;
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 8: goal_cclIeFbIoAccessEnd parameters
Parameter Description
GOAL_CCLIEFB_HANDLE_T*pCfb GOAL CCLIEFBhandle
1 res=goal_cclIeFbIoAccessEnd(pCfbHdl);
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 9: 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_toffset offset within linkdevice
Text fehlt
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 10: 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_toffset offset within linkdevice
Text fehlt
goal_cclIeFbVersionGet
Get the version of the GOAL CCLIEFB stack. Returns a GOAL_STATUS_T value as result.
Table 11: goal_cclIeFbVersionGet parameters
Parameter Description
GOAL_CCLIEFB_HANDLE_T*pCfb GOAL CCLIEFBhandle constchar*pVersion versionstring
Text fehlt