Re: CANopen transitions from PRE_OP to OP state.

Heikki Saha <[email protected]> Thu, 7 Sep 2017 10:24:50 +0300
Newsgroups gmane.comp.hardware.bus.can
Message-ID <CAGCYbHTx5N9k73Xu7FXNa22=mgFfaLsft4bFvaqJgzkONfGTgg@mail.gmail.com>
Hello John,

There is no set of options for waiting for heartbeat of another device and
perform autostart based on it through object dictionary in general.
Autostart is an independent feature, which issues internal NMT start
without a need for external NMT-master.

Error behavior is another interesting optional feature. By corresponding
object (at 0x1029) you can take control over, into which NMT state the
device shall enter when it detects an error in listed category (See object
0x1029 specification for more details). Typical scenario is, that in a case
of serious communication failure, the device is set to change to
NMT-stopped state. It differs from start-up, where the devices sends a
boot-message and heartbeat with pre-op status.

If you have a PLC supporting CiA-314 API, then you can implement in your
application the behavior you were looking for:
- poll NMT-state of the master node by CIA314_GET_STATE()
- when the required node has entered NMT state operational, use
CIA314_NMT() for the local CANopen device start
- for the rest you can just use error behavior to control
  * poll NMT-state of the master
  * in a case of any deviation, force local NMT state to stopped

However, I'd recommend to use the standard start-up and error management
procedures in order to keep things simple.

Best regards,

-H

Heikki Saha, CTO
  M.Sc. Automation
  Dr.Tech. Electronics
TK Engineering Oy
Mail address:  P.O. box 810, FIN-65101 VAASA
Visit address: Yrittäjänkatu 17, FIN-65380 VAASA
+358 (0)50 588 6894
email: [email protected]
skype: heikki.saha_tke

On Wed, Sep 6, 2017 at 10:48 PM, John Dammeyer <[email protected]>
wrote:

> Thanks.
>
> I don’t have any problem with the node autostarting or going operational
> if it sees the system master 0x701 heartbeat as operational.  But for
> some reason I thought it had to be the autostart slave or a NMT command.
>
> So many possibilities.
>
> John
>
>
>
>
>
>
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Simon Byholm
> *Sent:* September-06-17 10:51 AM
> *To:* [email protected]
> *Subject:* Re: [CANLIST] CANopen transitions from PRE_OP to OP state.
>
>
>
> Hello John
>
>
>
> There is a spec for autostarting slaves.
>
>
>
> If bit 4 in object 0x1F80 is 1 and all other bits are zero in a
>
> slave it is autostart and should go operational automatically.
>
>
>
> CiA 302-2 has more info on the NMT startup and heartbeat
>
> processes.
>
>
>
> Simon
>
>
> Simon Byholm - Software Manager / Quality Manager
>
> Phone: +358 6 357 6306 <+358%206%203576306>
> Fax: +358 6 357 6320 <+358%206%203576320>
> email: [email protected]
> web: www.tke.fi
>
> TK Engineering solves your CAN, CANopen, J1939 and NMEA2000 problems by
> providing the hardware, software and know-how you need to design,
> manufacture and troubleshoot your industrial and heavy machine CAN
> networks. Call +358 6 357 6300 <+358%206%203576300> or email [email protected]
> to learn how we can help you solve your CAN related problems.
>
>
>
> On Wed, Sep 6, 2017 at 6:54 PM, John Dammeyer <[email protected]>
> wrote:
>
> Hi everyone,
>
>
>
> I have a question for CANopen conformance experts.
>
>
>
> Is a node allowed to go NMT_OPERATIONAL on receipt of the system master’s
> heartbeat that shows the master is  NMT_OPERATIONAL or does it require a
> specific NMT command, either global or to its specific ID, to make that
> transition.
>
>
>
> The Flow Diagram of the NMT states suggest the change to OPERATIONAL only
> happens with the ID=0x000 message from the NMT Master and a GO_OPERATIONAL
> (0x01) command.  That can be to a specific node (0x01..0x7F) or to all
> nodes (0x00)
>
>
>
> To pass conformance if the node times out on a missing heartbeat should it
> drop back to PRE_OPERATIONAL and suspend PDO messages or just perform
> whatever operation it requires and remain OPERATIONAL?
>
>
>
> Thanks
>
> John Dammeyer
>
>
>
>
>
> "ELS! Nothing else works as well for your Lathe"
>
> Automation Artisans Inc.
>
> http://www.autoartisans.com/ELS/
>
> Ph. 1 250 544 4950 <%28250%29%20544-4950>
>
>
>
>
>
>
>