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
languagec
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

Parameter                                                            

Description

GOAL_CCLIEFB_HANDLE_T **

ppCfb               

ppCfb

GOAL CCLIEFB instance reference

uint32_t

id                                                            

id

instance id

GOAL_CCLIEFB_FUNC_CB_

TpFunc                 

T pFunc

GOAL CCLIEFB

callbackfunction

 

1   r e s = goal_ ccl Ie Fb New

callback function

Code Block
languagec
res = goal_cclIeFbNew(&pCfbHdl,
 GOAL
 GOAL_CCLIEFB_INSTANCE_DEFAULT,
 a p p l _ c c l f b C b
 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

Parameter                                                        

Description

GOAL_CCLIEFB_HANDLE_T *

pCfb                GOAL CCLIEFBhandle

pCfb

GOAL CCLIEFB handle

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

T stop

application stop flag

Code Block
languagec
res = goal_cclIeFbAppStopSet(&pCfbHdl,
 BOOL
 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

Parameter                                                        

Parameter

Description

GOAL_CCLIEFB_HANDLE_T *

pCfb               

pCfb

GOAL CCLIEFB handle

uint16_t

errCode                                                            

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

t errDetails

additional information

Table: goal_cclIeFbAppErrorCodeSet parameters

Code Block
languagec
res = goal_cclIeFbAppErrorCodeSet(&pCfbHdl,
 1
 1,
 17
 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                                                        

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 ) ;                                                                                                                              

 

pCfb

GOAL CCLIEFB handle

Table: goal_cclIeFbIoAccessStart parameters

Code Block
languagec
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 *

pCfb                GOAL CCLIEFBhandle

 

1   res=

pCfb

GOAL CCLIEFB handle

Code Block
languagec
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                          

pCfb

GOAL CCLIEFB handle

GOAL_CCLIEFB_LINK_DEV_ID_T

devId                 

devId

link device Id

uint8_t *

pBuf                                                             

pBuf

write buffer

uint16_t

bufLen                                                        

bufLen

write buffer length

uint16_

toffset                                                           

t offset

offset within

linkdeviceText fehlt 

link device

Code Block
languagec
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                          

pCfb

GOAL CCLIEFB handle

GOAL_CCLIEFB_LINK_DEV_ID_T

devId                 

devId

link device Id

uint8_t *

pBuf                                                             

pBuf

new data

uint16_t

bufLen                                                        

bufLen

data length

uint16_

toffset                                                           

t offset

offset within

linkdevice

 

Text fehlt

link device

Code Block
languagec
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

Parameter                                                        

Description

GOAL_CCLIEFB_HANDLE_T *

pCfb                GOAL CCLIEFBhandle constchar*pVersion                                                 versionstring

 

Text fehlt

pCfb

GOAL CCLIEFB handle

const char *pVersion

version string

Code Block
languagec
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