The function library LenzeCanDSxDrv.lib can be used for the following Lenze PLCs:
Typefrom hardware versionfrom software version
9300 Servo PLCEVS93XX−xI6A6.0
9300 Servo PLCEVS93XX−xT6A6.0
Drive PLCEPL102001A6.0
ECSxAECSxAxxx1C7.0
Important note:
The software is supplied to the user as described in this document. Any risks resulting from its quality or use remain the responsibility
of the user. The user must provide all safety measures protecting against possible maloperation.
We do not take any liability for direct or indirect damage, e.g. profit loss, order loss or any loss regarding business.
ã 2006 Lenze Drive Systems GmbH
No part of this documentation may be copied or made available to third parties without the explicit written approval of Lenze Drive
Systems GmbH.
All information given in this documentation has been carefully selected and tested for compliance with the hardware and software
described. Nevertheless, discrepancies cannot be ruled out. We do not accept any responsibility or liability for any damage that may
occur. Required corrections will be included in updates of this documentation.
All product names mentioned in this documentation are trademarks of the corresponding owners.
This Manual contains information about function library LenzeCanDSxDrv.lib for the Drive PLC
Developer Studio.
· With the functions of function library LenzeCanDSxDrv.lib it is possible to "map" CAN indices
received via the system bus interface within the PLC on codes other than the automatically
assigned codes.
· The function library also provides functions/FBs for the implementation of the "Heartbeat" and
"Node Guarding" monitoring mechanisms to ensure the functionality of the system bus
devices.
1.1.1Conventions in this Manual
This Manual uses the following conventions to distinguish between different types of information:
Variable identifiers
are written in italics in the explanation:
· "Use bEnable..."
Tip!
Information about the conventions used for the variables of Lenze system blocks, function blocks
and functions can be obtained from the appendix of the DDS online documentation "Introduction
into IEC 61131−3 programming". The conventions ensure universal and uniform labelling and make
reading the PLC program easier.
Lenze functions/function blocks
can be recognized by their names. They always begin with an "L_":
· "Use the FB L_XYZ..."
Program listings
are written in "Courier", keywords are printed in bold:
· "IF (nValue1 < 0) THEN..."
L
LenzeCanDSxDrv.lib EN 1.2
1−1
Function library LenzeCanDSxDrv.lib
Preface and general information
1.1About this Manual
1.1.2Description layout
All function/function block and system block descriptions contained in this Manual have the same
structure:
FunctionFunction block (FB)/
Heading stating function and function identifier
Declaration of the function:
· Data type of the return value
· Function identifier
· List of transfer parameters
Short description of the most important properties
Function chart including all
associated variables
· Transfer parameters
· Return value
Table giving information about the
transfer parameters:
· Identifiers
· Data type
· Possible settings
· Info
Table giving information about the
return value:
· Data type of the return value
· Possible return values and their
meaning
Additional information
(Notes, tips, application examples, etc.)
system block (SB)
−
FB/SB chart including all
associated variables
· Input variables
· Output variables
Table giving information about the
input and output variables:
· Identifiers
· Data type
· Variable type
· Possible settings
· Info
−
1.1.3Pictographs used in this Manual
Pictographs usedSignal words
Warning of material
damage
Other notesTip!
Stop!Warns of potential damage to material.
Note!
1.1.4Terminology used
TermIn the following text used for
DDSDrive PLC Developer Studio
FBFunction block
GDCGlobal Drive Control (parameterization program from Lenze)
Parameter codesCodes for setting the functionality of a function block
PLC· 9300 Servo PLC
SBSystem block
· Drive PLC
· Axis module ECSxA "Application"
Possible consequences if disregarded:
Damage to the controller/drive system or its environment
Indicates a tip or note.
.
1−2
LenzeCanDSxDrv.lib EN 1.2
L
Function library LenzeCanDSxDrv.lib
Preface and general information
1.2Version identifiers of the function library
1.2Version identifiers of the function library
The version of the function library can be found under the global constant
C_w[Function library name]Version .
Version identifiers as of PLC software version 7.x:
· In the example, "01050000" stands for version "1.05".
Example
value
Version: 01050000
L
LenzeCanDSxDrv.lib EN 1.2
1−3
Function library LenzeCanDSxDrv.lib
Preface and general information
1−4
LenzeCanDSxDrv.lib EN 1.2
L
Function library LenzeCanDSxDrv.lib
Introduction
2.1General information
2Introduction
2.1General information
The communication behaviour of the CAN bus devices is defined in a variety of communication
profiles for CAN communication, e. g.:
· DS301 − Standard communication between bus devices
· DS402 − Communication and control of positioning systems
The above communication profiles deal with the following subjects:
· Object directory (connection between index numbers and device functions)
· Network management (start, reset, states of bus devices)
· Bus boot−up messages
· Bus monitoring ("Node Guarding" and "Heartbeat")
· Service data communication (writing/reading of indeces/parameters)
· Process data communication (event−controlled/cyclic data transfer)
· Block data transfer
Tip!
With the functions of function libraries LenzeCanDrv.lib and LenzeCanDSxDrv.lib it is possible to
program communication mechanisms according to the IEC 61131 standard which meet the most
important requirements of the above communication profiles.
2.2CanDSx driver
The operating system (as of V6.0) of Lenze PLCs includes a specific CanDSx driver which can be
activated by means of the functions of function library LenzeCanDSxDrv.lib.
With the driver it is possible to assign indeces within the PLC to codes other than the automatically
assigned codes.
Note!
· Every Lenze code is assigned to a fixed index using the following formula:
Index = 5FFF
Index = 24575
· The function of the CanDSx driver is limited to the system bus (CAN).
It cannot be used for the second FIF CAN channel of the Drive PLC!
hex
dec
− code
− code
L
LenzeCanDSxDrv.lib EN 1.2
2−1
Function library LenzeCanDSxDrv.lib
Introduction
2.2CanDSx driver
2.2.1Operating principle − example
Task
A user has implemented a functionality in his PLC which can be parameterised under user code
C3200/5. Code C3200 is automatically assigned to the index
Index = 24575
The communication profile requires, however, that the functionality is parameterised under the index
4101
/subindex 2.
dec
Solution
− code = 24575
dec
− 3200 = 21375
dec
dec
:
dec
Use the functions of function library LenzeCanDSxDrv.lib to redirect index 4101
/subindex 2
dec
within the PLC to code C3200/5 so that the communication profile need not be changed.
Operating principle
The operating system (as of V6.0) of Lenze PLCs includes a "mapping table" which allows to map
up to 256 codes on codes other than the automatically assigned codes within the PLC.
If a CAN telegram is received and the index is within the valid range, the system checks whether the
index is listed in the mapping table.
· If the index is listed in the mapping table, the PLC accesses the new code assigned to the
index in the mapping table.
If the index is not listed in the mapping table, the PLC accesses the automatically assigned
The CANopen communication profile (CiA DS301, version 4.01) specifies two optional monitoring
mechanisms to ensure the functionality of the system bus devices: "Heartbeat" and "Node
Guarding".
2.3.1"Heartbeat"
The "Heartbeat" monitoring mechanism is a producer−consumer orientated method. Every bus
device can monitor the state of the other bus devices. A polling message is not required.
Heartbeat ProducerHeartbeat Consumer(s)
s
s
Stopped
Operational
Pre-Operational
Boot-Up Event
Heartbeat
Producer
Time
Request
Request
r
r
r:
reserved
s: State of the heartbeat producer:
4
5
127
0
18
Indication(s)
Heartbeat
Consumer
Time
18
Indication(s)
Heartbeat
Event
· A bus device (producer) indicates its communication status by the cyclic transmission of a
"Heartbeat" message.
· The "Heartbeat" message can be received by one, more than one or all bus devices
(consumer) to monitor the corresponding bus device.
· Unless the monitoring bus device (consumer) receives the "Heartbeat" message from the bus
device to be monitored (producer) within the selected monitoring time
(HeartBeatConsumerTime), a "Heartbeat" event will be indicated.
L
LenzeCanDSxDrv.lib EN 1.2
2−3
Function library LenzeCanDSxDrv.lib
Introduction
2.3Monitoring mechanisms
2.3.2"Node Guarding"
Unlike the "Heartbeat" monitoring mechanism, "Node Guarding" requires a polling message from the
monitoring bus device (NMT master).
NMT MasterNMT Slave
RTR
Node
Life
Time
Node
Guard
Time
Request
Confirmation
Request
Confirmation
Node
Guarding
Event
t
RTR
t
t:
Toggle bit
s: NMT Slave state:
Stopped
4
Operational
5
Pre-Operational
127
Boot-Up Event
0
18
s
18
s
Indication
Response
Node
Life
Time
Indication
Response
Life
Guarding
Event
· The monitoring bus device (NMT master) cyclically polls every bus device to be monitored
(NMT slave) using a node−specific remote transmission request telegram.
· As response, the bus device to be monitored (NMT slave) returns its communication status.
· Unless the monitoring bus device (NMT master) receives the message from the bus device to
be monitored (NMT slave) within the selected monitoring time ( NodeLifeTime), a "Node
Guarding" event will be indicated.
· If the status of the monitoring bus device (NMT master) is not polled within its "Node Lifetime",
a "Life Guarding" event will be indicated at the bus device to be monitored (NMT slave).
2−4
LenzeCanDSxDrv.lib EN 1.2
L
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.1Overview
3Functions/function blocks
3.1Overview
Function/FBInfo
Index mapping on codes
· The functions only refer to parameter access via the system bus interface of the PLC.
L_CanDSxInitIndexCodeConfiguration of index mapping^ 3−2
L_CanDSxOpenActivation of index mapping^ 3−4
L_CanDSxCloseDeactivation of index mapping^ 3−5
"Hearbeat" monitoring mechanism
L_CanDSxOpenHeartBeatInitialisation of "Heartbeat"^ 3−6
L_CanDSxHeartBeatExecution of "Heartbeat"^ 3−7
L_CanDSxCloseHeartBeatDeactivation of "Heartbeat"^ 3−9
"Node Guarding"monitoring mechanism
L_CanDSxOpenNodeGuardingInitialisation of "Node Guarding"^ 3−10
L_CanDSxNodeGuardingExecution of "Node Guarding"^ 3−11
L_CanDSxCloseNodeGuardingDeactivation of "Node Guarding"^ 3−14
Tip!
For the mapping of codes accessed via the AIF interface, use the functions provided by function
library LenzeAifParMapDrv.lib.
L
LenzeCanDSxDrv.lib EN 1.2
3−1
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.2L_CanDSxInitIndexCode − Configuration of index mapping
3.2L_CanDSxInitIndexCode − Configuration of index mapping
Function
This function is used to configure the mapping table and the redirection of indeces to codes other
than the automatically assigned codes.
· With every function call one index and the corresponding Lenze code can be entered in the
mapping table.
Declaration
INT L_CanDSxInitIndexCode (byTabIndex,
wCANIndex, byCANSubIndex,
wLenzeCodeNumber, byLenzeSubCodeNumber);
Transfer parametersData typeInformation/possible settings
byTabIndexByte0 ... 255Number of the configuration entry in the mapping table.
Index to be redirected:
wCANIndexWord1000
byCANSubIndexByte0 ... 255CAN subindex
wLenzeCodeNumberWord1 ... 7999Code number
byLenzeSubCode
Number
Byte0 ... 255Subcode number
...
hex
8FFF
hex
(4096
dec
36863
dec
Redirection target (Lenze code):
CAN index
...
)
Return valueData typeValue/meaning
IntegerStatus
0 Entry in the mapping table has been successful.
−20 Error: Transfer parameter wCANIndex is invalid.
−30 Error: Transfer parameter wLenzeCodeNumber is invalid.
· A maximum of 256 entries can be entered in the mapping table:
3.3L_CanDSxOpen − Initialisation of the CanDSx driver
3.3L_CanDSxOpen − Initialisation of the CanDSx driver
Function
This function is used to initialise the CanDSx driver in the operating system of the PLC.
· For initialisation, the transfer parameter bOpen must be TRUE.
· After the driver has been initialised, the indeces accessed via the system bus interface will not
be directed to the automatically assigned codes, but redirected to the codes of the mapping
table configured by the function L_CanDSxIndexInitCode.
Declaration
DWORD L_CanDSxOpen (bOpen);
Transfer parametersData typeInformation/possible settings
bOpenBoolInitialisation of the CanDSx drive in the operating system.
TRUE The CanDSx driver is initialised in the operating system.
Return valueData typeValue/meaning
Double word Status
Bit Value
00 Driver initialised.
1 Driver is not initialised.
· Remedy: Call the function with transfer parameter bOpen = TRUE.
1−15Reserved for future extensions (bits are set to 0).
16−31Version of function library LenzeCanDSxDrv.lib
· Invalid if bit 0 = 1
· Format: Main version/subversion (e. g. 0103hex = version 1.03)
· Invalid if bit 0 = 1
Note!
If the function L_CanDSxOpen is called while code read or write requests are active an error may
occur!
This is why all actions with code access should be completed before this function is called.
Example
Calling the function in ST:
IF bOpenCanDSxDriver AND NOT bOpen THEN
bOpen := TRUE;
dwReturnOpen := L_CanDSxOpen(bOpen:= TRUE);
END_IF
3−4
LenzeCanDSxDrv.lib EN 1.2
L
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.4L_CanDSxClose − Deactivation of index mapping
3.4L_CanDSxClose − Deactivation of index mapping
Function
This function is used to deactivate the mapping table and the redirection of indeces.
· For deactivation, the transfer parameter bClose must be set to TRUE.
· After this function has been executed, the indeces accessed via the system bus interface will
no longer be redirected to the corresponding codes of the mapping table.
Declaration
BOOL L_CanDSxClose (bClose);
Transfer parametersData typeInformation/possible settings
bCloseBoolDeactivation of index redirections according to the mapping table.
TRUE The CanDSx driver is deactivated in the operating system.
Return valueData typeValue/meaning
BoolStatus
TRUE The CanDSx driver has been deactivated in the operating system.
FALSE The CanDSx driver has not been deactivated in the operating system.
· Remedy: Call the function with transfer parameter bClose = TRUE.
Note!
If the function L_CanDSxClose is called while code read or write requests are active an error may
occur!
This is why all actions with code access should be completed before this function is called.
Example
Calling the function in ST:
IF bCloseCanDSxDriver AND NOT bClose THEN
bClose := TRUE;
dwReturnClose := L_CanDSxClose(bClose:= TRUE);
END_IF
L
LenzeCanDSxDrv.lib EN 1.2
3−5
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.5L_CanDSxOpenHeartBeat − Initialisation of "Heartbeat"
3.5L_CanDSxOpenHeartBeat − Initialisation of "Heartbeat"
Function
The CANopen communication profile (CiA DS301, version 4.01) specifies two optional monitoring
mechanisms to ensure the functionality of the system bus devices: "Heartbeat" and "Node
Guarding".
This function is used to initialise the "Heartbeat" monitoring mechanism of the CanDSx driver.
· For initialisation, the transfer parameter bOpen must be TRUE.
· The actual monitoring is implemented by means of the FB L_CanDSxHeartBeat. (^ 3−7)
· Use the function L_CanDSxCloseHeartBeat to deactivate the "Heartbeat" monitoring
mechanism.
Note!
It is not permitted to use the two monitoring mechanisms simultaneously!
If the transmission cycle time selected for the "Heartbeat" message of the bus device to be
monitored is unequal zero, the "Heartbeat" mechanism will have priority over the "Node Guarding"
mechanism.
(^ 3−9)
Declaration
BOOL L_CanDSxOpenHeartBeat (bOpen);
Transfer parametersData typeInformation/possible settings
bOpenBoolInitialisation of "Heartbeat".
TRUE The "Heartbeat" monitoring mechanism of the CanDSx driver is initialised.
Return valueData typeValue/meaning
BoolStatus
TRUE The "Heartbeat" monitoring mechanism has been initialised.
FALSE A The "Heartbeat" monitoring mechanism has not been initialised.
– Remedy: Call the function with transfer parameter bOpen = TRUE.
or
B The function L_CanDSxOpenNodeGuarding was activated before ("Node
Guarding" is activated).
– Remedy: Call the function L_CanDSxCloseNodeGuarding with transfer
This FB is used for the cyclic monitoring of the CAN connection between the PLC and other system
bus devices by means of the "Heartbeat" mechanism.
· The FB acts as "Heartbeat consumer". For this, it must be activated in the monitoring PLC.
· Before the function is executed, the "Heartbeat" monitoring mechanism must be initialised in
the CanDSx driver by means of the function L_CanDSxOpenHeartBeat.
L_CanDSxHeartBeat
wDrvNr
byNodeAddr
bRun
tHeartBeatConsumerTime
System bus
CTRL
(CAN)
nState
(^ 3−6)
Heartbeat producer
(Node address =)byNodeAddr
FB call in:o Cyclic task
(PLC_PRG)
InputsData typeInformation/possible settings
wDrvWordDriver number for the CAN interface of the PLC
byNodeAddrByteNode address of the bus device to be monitored.
bRunBoolActivation of "Heartbeat" monitoring.
þ Time−controlled task
(INTERVAL)
10 On board system bus (CAN)
1 ... 128 Node address
TRUE Monitoring is activated.
o Event−controlled task
· The FB continuously monitors if the bus device with node address byNodeAddr
sends its "Heartbeat" message within the selected monitoring time
tHeartBeatConsumerTime via the system bus and outputs the corresponding
status at nState.
tHeartBeat
ConsumerTime
TimeMonitoring time within which the "Heartbeat" message is to be received from the bus device to be
monitored. Otherwise, a "Heartbeat" event ( nState = −10) will be activated.
· Adapt the consumer time to the "Heartbeat producer time" in which the bus device to be
monitored sends the "Hearbeat" message.
· Recommended setting: 200 ... 2000 ms
· Maximum setting: 65535 ms
(EVENT)
o Interrupt task
L
LenzeCanDSxDrv.lib EN 1.2
3−7
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.6L_CanDSxHeartBeat − Execution of "Heartbeat"
OutputsData typeInformation/possible settings
nStateIntegerStatus
300 FB is deactivated ( bRun = FALSE).
127 Bus device to be monitored is in CAN state Pre−operational.
5 Bus device to be monitored is in CAN state Operational.
4 Bus device to be monitored is in CAN state Stopped.
0 Bus device to be monitored is in CAN state Boot−up
or FB is not activated.
−5 Monitoring time tHeartBeatConsumerTime is set to "0".
−10 "Heartbeat" event:
The "Heartbeat" message from the bus device to be monitored was not received
within the selected monitoring timetHeartBeatConsumerTime.
−12 The selected node address ( byNodeAddr) is invalid.
−120 The monitoring mechanism has not been initialised in the CanDSx driver.
· Use the function L_CanDSxOpenHeartBeat to initialise the monitoring
mechanism.
−121 The selected driver number ( wDrvNr) is invalid.
Settings required for the PLC to be monitored
(Valid for 9300 Servo PLC/Drive PLC as from V6.2)
Select the following settings for the PLCto be monitored
to ensure that the PLC will act as "Heartbeat
producer":
1. Set code C0352 of the PLC to be monitored
to "3" to configure the PLC as "slave and
Heartbeat producer":
CodeLCD
C0352 CAN mst0System bus:
Possible settings
LenzeSelection
0 Slave (boot−up not active)
1 Master (boot−up active)
2 Master with Node Guarding
3Slave and Heartbeat producer
4 Slave with Node Guarding
Info
Master/slave configuration of the PLC
(SyncReceived no longer possible)
2. Use C0381 to select the time interval for sending the "Heartbeat" message in the PLC to be
monitored. Depending on the bus load, it is recommended to select a setting between 200 ...
2000 ms:
CodeLCD
C0381 HeartProTime0System bus: Heartbeat (slave):
Possible settings
LenzeSelection
0 {1 msec} 65535
Info
HeartbeatProducerTime
3−8
3. Set code C0003 of the PLC to be monitored to "1" to save the new settings fail−safe.
4. Set code C0358 of the PLC to be monitored
to "1" to carry out a CAN Reset Node.
– As an alternative, the CAN Reset Node can also be carried out by means of a fresh
power−on.
After the CAN Reset Node, the PLC to be monitored
("Hearbeat" producer) will continuously send
the "Heartbeat" telegram within the time interval selected under C0381 via the system bus. The
"Heartbeat" monitoring can now be activated in the monitoring PLC.
LenzeCanDSxDrv.lib EN 1.2
L
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.7L_CanDSxCloseHeartBeat − Deactivation of "Heartbeat"
3.7L_CanDSxCloseHeartBeat − Deactivation of "Heartbeat"
Function
This function is used to deactivate the "Heartbeat" monitoring mechanism of the CanDSx driver.
· For deactivation, the transfer parameter bClose must be set to TRUE.
Declaration
BOOL L_CanDSxCloseHeartBeat (bClose);
Transfer parametersData typeInformation/possible settings
bCloseBoolDeactivation of the "Heartbeat" monitoring mechanism.
TRUE The "Heartbeat" monitoring mechanism of the CanDSx driver is deactivated.
Return valueData typeValue/meaning
BoolStatus
TRUE The "Heartbeat" monitoring mechanism of the CanDSx driver has been
deactivated.
FALSE The "Heartbeat" monitoring mechanism of the CanDSx driver has not been
deactivated.
· Remedy: Call the function with transfer parameter bClose = TRUE.
3.8L_CanDSxOpenNodeGuarding − Initialisation of "Node Guarding"
3.8L_CanDSxOpenNodeGuarding − Initialisation of "Node Guarding"
Function
The CANopen communication profile (CiA DS301, version 4.01) specifies two optional monitoring
mechanisms to ensure the functionality of the system bus devices: "Heartbeat" and "Node
Guarding".
This function is used to initialise the "Node Guarding" monitoring mechanism of the CanDSx driver.
· For initialisation, the transfer parameter bOpen must be TRUE.
· The actual monitoring is implemented by means of the FB L_CanDSxNodeGuarding. (^ 3−11)
· Use the function L_CanDSxCloseNodeGuarding to deactivate the "Node Guarding"
monitoring mechanism.
Note!
It is not permitted to use the two monitoring mechanisms simultaneously!
If the transmission cycle time selected for the "Heartbeat" message of the bus device to be
monitored is unequal zero, the "Heartbeat" mechanism will have priority over the "Node Guarding"
mechanism.
(^ 3−14)
Declaration
BOOL L_CanDSxOpenNodeGuarding (bOpen);
Transfer parametersData typeInformation/possible settings
bOpenBoolInitialisation of the "Node Guarding" monitoring mechanism.
TRUE The "Node Guarding" monitoring mechanism of the CanDSx driver is initialised.
Return valueData typeValue/meaning
BoolStatus
TRUE The "Node Guarding" monitoring mechanism has been initialised.
FALSE A The "Node Guarding" monitoring mechanism has not been initialised.
– Remedy: Call the function with transfer parameter bOpen = TRUE.
or
B The PLC has not been configured as "master with Node Guarding".
– Remedy: Set code C0352 to "2" to configure the PLC as "master with Node
3.9L_CanDSxNodeGuarding − Execution of "Node Guarding"
3.9L_CanDSxNodeGuarding − Execution of "Node Guarding"
Function block
This FB is used for the cyclic monitoring of the CAN connection between the PLC and other system
bus devices by means of the "Node Guarding" mechanism.
· Before the function is executed, the "Node Guarding" monitoring mechanism must be
initialised in the CanDSx driver by means of the function L_CanDSxOpenNodeGuarding.
(^ 3−10)
L_CanDSxNodeGuarding
wDrvNr
byNodeAddr
bRun
tNodeGuardTime
byNodeLifeTimeFactor
System bus
(CAN)
CTRL
1.
2.
nState
(Node address =)byNodeAddr
FB call in:o Cyclic task
(PLC_PRG)
InputsData typeInformation/possible settings
wDrvWordDrive number for the CAN interface of the PLC
byNodeAddrByteNode address of the bus device to be monitored.
bRunBoolActivation of "Node Guarding".
Þ Time−controlled task
(INTERVAL)
10 On board system bus (CAN)
1 ... 128 Node address
TRUE Monitoring is activated.
NMT Slave
o Event−controlled task
(EVENT)
· The FB uses the transmission cycle selected under tNodeGuardTime, sends a
remote transmission request telegram to the bus device with the node address
byNodeAddr and expects a corresponding response. If the response is not
received within the monitoring time ("NodeLifeTime"), the FB will output the
corresponding status at nState.
tNodeGuardTimeTimeTransmission cycle of the remote transmission request telegram.
· Time interval in which the PLC sends a status enquiry to the bus device to be monitored (cyclic
polling).
· The setting must correspond to the "GuardTime" (C0382) selected in the PLC to be monitored.
byNodeLifeTimeFactorByteFactor for the "NodeLifeTime".
· Unless the bus device to be monitored responds to the status enquiry within the
"NodeLifeTime", a "Node Guarding" event will be activated (nState = −10).
· The setting must correspond to the "NodeLifeTimeFactor" (C0383) selected in the PLC to be
monitored.
o Interrupt task
L
LenzeCanDSxDrv.lib EN 1.2
3−11
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.9L_CanDSxNodeGuarding − Execution of "Node Guarding"
OutputsData typeInformation/possible settings
nStateIntegerStatus
300 FB is deactivated (bRun= FALSE).
127 Bus device to be monitored is in CAN state Pre−operational.
5 Bus device to be monitored is in CAN state Operational.
4 Bus device to be monitored is in CAN state Stopped.
0 Bus device to be monitored is in CAN state Boot−up
or FB is not activated.
−5 Monitoring time tNodeGuardTime or factor byNodeLifeTimeFactor is set to "0".
−9 Response received from bus device to be monitored is invalid.
−10 "Node Guarding" event:
No status response received from bus device to be monitored within the
"NodeLifeTime".
−12 The selected node address (byNodeAddr) is invalid.
−120 The monitoring mechanism has not been initialised in the CanDSx driver.
· Use the function L_CanDSxOpenNodeGuarding to initialise the monitoring
mechanism.
−121 The selected driver number (wDrvNr) is invalid.
Settings required for the PLC to be monitored
(Valid for 9300 Servo PLC/Drive PLC as from V6.2 and ECSxA as from V7.0)
Select the following settings for the PLC to be monitored
to ensure that the PLC will act as "Node
Guarding slave":
1. Set code C0352 of the PLC to be monitored
to "4" to configure the PLC as "slave with Node
Guarding":
CodeLCD
C0352 CAN mst0System bus:
Possible settings
LenzeSelection
0Slave (boot−up not active)
1Master (boot−up active)
2Master with Node Guarding
3Slave and Heartbeat producer
4Slave with Node Guarding
Info
Master/slave configuration of the PLC
(SyncReceived no longer possible)
2. Use C0382 to select the time interval for the status enquiry of the master in the PLC to be
monitored. The value must correspond to the setting at the FB input tNodeGuardTime in the
PLC to be monitored:
3. Set the Node Guarding master C0352/0 = 2 in the monitoring PLC.
LenzeCanDSxDrv.lib EN 1.2
L
Function library LenzeCanDSxDrv.lib
Functions/function blocks
3.9L_CanDSxNodeGuarding − Execution of "Node Guarding"
4. Use C0383 to select the factor for the monitoring time ("NodeLifeTime") in the PLC to be
monitored. The value must correspond to the setting at the FB input byNodeLifeTimeFactor: