Lenze PLC Designer PLC Designer (R2-x) CANopen for Runtime Systems User Manual

Page 14

Advertising
background image

L-force | PLC Designer - CANopen for Runtime Systems

CANopen-Master library

DMS 2.0 EN 05/2009 TD29

13

bSendHeartbeat : BOOL; (* Internally set and reset by the master whenever a heartbeat

message should be sent and as soon as it has been sent.*)

byHeartbeatState : BYTE; (* According to the state of the master here the CANopen-

conforming states 0, 4, 5 or 127 are entered, which are sent with the
heartbeat-message.*)

wODMFirstIdx : WORD; (* Index of the first MasterOD-entry in array ODMEntries.*)
wODMCount : WORD; (* Number of ODMEntries belonging to this master.*)

END_VAR
VAR

bReentry: BOOL;

(* Historically, not used.*)

bGefunden : BOOL;

(* Historically, not used.*)

dwCOBID_NMT : DWORD := 16#0000; (* Exclusively used for starting the slaves. Never should

be changed by the application.*)

nIndex : INT;

(* internal auxiliary variable of the master.*)

dwMerker : DWORD;

(* historically, not used. *)

dwSem : DWORD := 16#FFFFFFFF; (*

Intended for locking operations in multi-tasking

operation. Not used because the implicit calls always are executed
by one task only.*)

a: INT;

(* Lifecounter, only counted up in order to make the implicit calls
visible in monitoring mode. Herewith you can check whether the
master is called.*)

bSynchSend : BOOL; (* Always will get TRUE for the duration of one IEC-cycle, when

the master sends a sync message. The same also happens when
the master receives an externally generated sync message. If the
master itself generates the sync message, the flag will not be set
when receiving an external sync.*)

bErrCodeNot0 : BOOL; (* Used to delete the error code of the CAN driver for BusOFF

(Errorcode = 1) with an offset of 1 cycle.*)

MsgBuffer: CAN_Message (* Receive buffer of the master. Only used for the SDO server

functionality and for receiving an external sync message.*);

bSDOMsgUsed : BOOL; (* Always set in case of an access on the object dictionary of the

master.*);

bSDOReadrqActive : BOOL; (* The following variables are used in order to manage the

accesses on the object dictionary of the master.*)

bSDOWriterqActive : BOOL;
bSub0NotFound, bSDOReadrspAbort, bInitiateRspSend, bSDOWriterspAbort,

bInitiateWrReqSend : BOOL;

i, iActiveSegSDORead : INT;
ucModus : BYTE;
dwIdx : DWORD;
wSegSDOReadSendOffs,wSegSDOReadSendLen : WORD;
pActiveSegSDORead:POINTER TO BYTE;
iActiveSegSDOWrite:INT := -1;
pActiveSegSDOWrite:POINTER TO BYTE;
wSegSDOWriteRecvOffs : WORD;
wSegSDOWriteRecvLen : WORD;
dwODEValue : DWORD;
iSDOReadLen, iSDOWriteLen : INT;
byAbortCode : ARRAY[0..3] OF BYTE;
bSwap : BOOL;

(* Here the master indicates whether it is running on an INTEL or a
Motorola-byteorder machine.*)

END_VAR

Thus, in order to set e.g. variable bUseStartAllNodes of the first master, you have to use

pCanOpenMaster[0]. bUseStartAllNodes := TRUE;

Advertising