3 stopping a node, 4 resetting a node, 5 starting the network by busestartallnodes – Lenze PLC Designer PLC Designer (R2-x) CANopen for Runtime Systems User Manual

Page 26

Advertising
background image

L-force | PLC Designer - CANopen for Runtime Systems

CANopen-Master library

DMS 2.0 EN 05/2009 TD29

25

2.4.4.3 Stopping a node
By calling method NodeStop, analogue to NodeStart, a NMT-command for stopping the slave will be
created. Thereupon the slave normally will change to status „Stopped“.

2.4.4.4 Resetting a node
By calling method ResetNode the respective slave will be reset and re-configured.

2.4.4.5 Starting the network by bUseStartAllNodes
In a CAN network with many participants (mostly more than 8) it often happens, that NMT-messages
which quickly follow each other are not detected by all (mostly slow) IO-nodes (slaves). This happens
due to the reason that all those nodes must listen to all messages with ID 0. NMT-messages which
are sent in a too quick succession overstress the receive logic of such nodes. A symptom for this fact
is that these nodes sometimes are not started. Relief can only be produced by reducing the number of
quickly succeeding NMT-messages. Additionally the application can cause the CANopenMaster
library to use command “Start All Nodes” instead of starting all nodes singly per „Start Node“.

For this purpose the application must set the flag bUseStartAllNodes of the master uniquely, always
at start of the controller, e.g. like shown in the following (bInit is defined by the application):

IF NOT bInit THEN

pCanOpenMaster[0].bUseStartAllNodes := TRUE;

bInit := TRUE;

END_IF

Attention: This flag may not be set cyclically, because then single nodes after a failure would not be
re-started correctly.

Always when the application uses this command for starting the network, also nodes which – e.g.
because they had responded with a wrong device type – are in status 98, will be started. However,
then PDOs for these nodes remain deactivated. To unlock them the application must act like
described in 2.4.4.2, Boot-up of the network without automatic start. If it is not sure whether all slaves
have been parameterized with the correct device type, member „dwMerker“ of the particular nodes
can be regarded. Here the device type appears, which has been read by the slave via request of
object 0x1000. (In member dwNodeIdent the configured type is stored.) dwMerker is always valid, if it
is unequal 0.

2.4.4.6 Initialization of the network via bUseResetAllNodes
For the same reasons as described for bUseStartAllNodes there are cases in which it is better to use
NMT-command „Reset All Nodes” instead of “Reset Node” for each single node.

For this the application uniquely must set flag bUseResetAllNodes of the master:

IF NOT bInit THEN

pCanOpenMaster[0]. bUseResetAllNodes := TRUE;

bInit := TRUE;

END_IF

Attention: This flag may not be set cyclically because then single nodes would not be re-started
correctly after a failure.

Advertising