1 start-up of the canopen-master, Boot-up of the canopen-slaves – Lenze PLC Designer PLC Designer (R2-x) CANopen for Runtime Systems User Manual

Page 18

Advertising
background image

L-force | PLC Designer - CANopen for Runtime Systems

CANopen-Master library

DMS 2.0 EN 05/2009 TD29

17

2.4.3.1 Start-up of the CANopen-Master
During start-up of the CAN network the master runs through various states which primarily can be
read from variable nStatus.

States 0, 1 and 2 are run through by the master automatically within the first cycles after a PLC start.
Status 3 of the master is kept for some time. In status 3 the master configures its slaves. For this
purpose the slaves get sent one after the other all SDOs which have been created by the configurator.
After having transmitted all configuration-SDOs to the slaves, the master changes to status 5 and
remains in this status. Status 5 is the normal operation status for the master. After once having
reached this status, the master remains in status 5. All other states are managed by function blocks
representing the slaves.

If a slave does not respond on a SDO request (upload or download), the request will be repeated by
the respective function block. The master leaves status 3, as mentioned above, but not until all SDOs
have been transmitted successfully. Thus it can be detected whether a slave is missing or cannot
correctly receive all SDOs. (Thereby it is irrelevant for the master whether a slave answers with a
confirmation or with an abort, for the master it is only of concern whether any answer has come from
the slave. An example for the detection of aborts during start-up see below.)

An exception is a slave which is marked ‘optional’. Optional slaves are only requested once for object
0x1000. If they do not respond within 0,5 seconds, the slave at this time will be ignored by the master
and the master will change into status 5 without any reaction of the slave. If thenceforwards the slave
is wanted to get re-configured by the master or to be checked for presence, the application must do
that. (See add-on in 2.4.4.2, Boot-up of the network without automatic start.)

Boot-up of the CANopen-Slaves
A slave is represented by a function block instance in array pCanOpenNodes in the global variables
list „Can open implicit Variables“. During boot-up of the CAN network the slave automatically runs
through states -1, 1 and 2. These states mean the following: (Regard: they partially are internal states,
which might be not detected by the application because they are only valid for the length of one cycle.)

-1 Node is reset by NMT-message „Reset Node“ and autonomously changes to status 1.

1 Node changes to status 2 after a maximum time of 2 sec. or immediately after having received its

boot-up message.

2 Node automatically changes to status 3 after a delay time of 0,5 sec. This delay matches the

experience that many CANopen devices not immediately after having sent their boot-up message
are ready for receiving their configuration-SDOs. In status 3 the slave gets configured.

The slave remains in status 3 until having received all SDOs created by the configurator. Thereby it
does not matter, whether the slave has responded to SDO transfers with an abort (error) or error-free.
Decisive is just the fact of having got any response from the slave. The application can guard the
responses on the SDO requests and itself can react on the responses of the slaves.

If option „Reset nodes“ is activated in the configurator, a reset of the node will be done after the
transmission of object 0x1011 subindex 1, which after that gets value „load“. Thereby the library
enters „0“ to this object in order to get the reset executed only once after the initialization of the
application. Thereupon the slave will be requested by an upload of object 0x1000.

Advertising