Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
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.
Code Block | ||
---|---|---|
| ||
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 |
1 r e s = goal_ ccl Ie Fb New
callback function |
Code Block | ||
---|---|---|
| ||
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 5: goal_cclIeFbAppStopSet parameters
Parameter |
---|
Description |
---|
GOAL_CCLIEFB_HANDLE_T * |
pCfb | GOAL CCLIEFB handle |
GOAL_BOOL_ |
1 r e s = g o a l_ c c l I e F b App St o p Se t
T stop | application stop flag |
Code Block | ||
---|---|---|
| ||
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 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
ParameterParameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T * |
pCfb | GOAL CCLIEFB handle |
uint16_t |
errCode | application error code |
uint32_ |
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
t errDetails | additional information |
Table: goal_cclIeFbAppErrorCodeSet parameters
Code Block | ||
---|---|---|
| ||
res = goal_cclIeFbAppErrorCodeSet(&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
ParameterParameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T * |
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 ) ;
pCfb | GOAL CCLIEFB handle |
Table: goal_cclIeFbIoAccessStart parameters
Code Block | ||
---|---|---|
| ||
res = goal_cclIeFbIoAccessStart(pCfbHdl); |
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 parametersParameter
Parameter | Description |
---|---|
GOAL_CCLIEFB_HANDLE_T * |
1 res=
pCfb | GOAL CCLIEFB handle |
Code Block | ||
---|---|---|
| ||
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 parametersParameter
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 |
Code Block | ||
---|---|---|
| ||
uint8_t ry0; /* first byte from RY Link device */
res = goal_cclIeFbOutputGet(pCfbHdl,
GOAL_CCLIEFB_LINK_DEV_RY,
&ry0,
sizeof(uint8_t),
0); |
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 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 parametersParameter
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 |
Text fehlt
link device |
Code Block | ||
---|---|---|
| ||
uint8_t rx0 = 0; /* first byte from RX Link device */
res = goal_cclIeFbInputSet(pCfbHdl,
GOAL_CCLIEFB_LINK_DEV_RX,
&rx0,
sizeof(uint8_t),
0); |
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 * |
Text fehlt
pCfb | GOAL CCLIEFB handle |
const char *pVersion | version string |
Code Block | ||
---|---|---|
| ||
const char *pVersion; /* GOAL CCLIEFB version string */
res = goal_cclIeFbVersionGet(pCfbHdl, &pVersion);
if (GOAL_RES_OK(res)) {
goal_logInfo("started CC-Link IE Field Basic stack, version %s", pVersion);
} |
Table of Contents |
---|