Supported platforms: CODESYS 2.3

 

CanApiInitSrv (PRG)

Description

This function call must be added to the PLCopen application if the programmer wants to use CAN-API services in the PLCopen application.

This function only sets the pointer CanApi_SharedMemory in CanApiinternal.lib globals correctly.

Limitations

Before shared memory is visible/accessible in the IEC application, there must be the function call CanApiSrvInit in application. This function must always be executed succesfully before other CAN-API functions can be used. It is only necessary to call this function once.

Inputs

No input variables

 

Outputs

Output variable name

Data type

Range

Description

CanApiSrvinit

DINT

 

Status of the execution.

Error codes

Function uses also external functions it is possible that function returns error codes from firmware side.

 

Example code

Definitions:

 

error:DINT;

Code:

 

error := CanApiInitSrv();

EXP - file:

No exp files.

 

See also

 

Source file Topic000050.htm

Last updated 24-Apr-2025