1 structure of the canopen-master, Structure of the canopen-master – Lenze PLC Designer PLC Designer (R2-x) CANopen for Runtime Systems User Manual
Page 12

L-force | PLC Designer - CANopen for Runtime Systems
CANopen-Master library
DMS 2.0 EN 05/2009 TD29
11
2.4 Working with the CANopen-Master part in the application
There are various cases in which the IEC application must cooperate with the CANopen library.
Among those is the detection of and reaction on an error.
Regard thereby the call sequence, which cannot be influenced by the application programmer. (The
calls and in which tasks they are generated is also described in chapter 2.5‚ Implicit Calls’.)
Here an example for a CAN controller and a Rx/Tx-PDO each:
• CanRead(0); (* Implicitly created call *)
• pCanOpenMaster[0](); (* Implicitly created call *)
• pCanOpenPDO_Rx[0](); (* Implicitly created call *)
•
• pCanOpenPDO_Tx[0](); (* Implicitly created call *)
• MgrClearRxBuffer(wCurTask:= 1,wDrvNr := 0, dwFlags := 0, dwPara := 0); (*Implicitly created call
for clearing the receive buffer.*)
2.4.1 Structure of the CANopen-Master
If the libraries 3S_CanOpenMaster/3S_CanOpenManager and 3S_CanDrv.lib are included in a
project, »PLC Designer« implicitly (automatically) will create a Global Variables List and before/after
the application code in certain tasks will add calls of library modules. The Global Variables List is
named „CanOpen implicit Variables“ and will be filled by »PLC Designer« with the appropriate data
from the PLC configuration.
Note: To view the initialization code in ST without going online, »PLC Designer« can be started by the
command line option “/debug”. In this case (besides other useful information) the files
CanOpenInitcode.exp and CanOpenBeforeTask/AfterTask_
directory.
The variables list „CanOpen implicit Variables“ in details:
The constants always indicate the bounds of the array which are declared in this variables list.
VAR_GLOBAL CONSTANT
MAX_CTRLINDEX : INT := configuration; 0, if there is one controller; 1 if there are two END_VAR VAR_GLOBAL CONSTANT USE_CANOPEN_NODES : BOOL := a master>; MAX_MASTERINDEX : INT := MAX_NODEINDEX : INT := MAX_SDOINDEX : INT := MAX_PDOINDEX_RX : INT := MAX_PDOINDEX_TX : INT := MAX_MASTER_ODENTRY_IDX : INT := CANopen-Masters>; END_VAR
controllers etc.>;
assigned to a master and not to a CanDevice. (for
CanDevice see chapter 3) >;