Download CANopen Slave Protocol API
Transcript
Table of Contents 2/191 Table of Contents 1 Introduction.............................................................................................................................................4 1.1 Abstract ..........................................................................................................................................4 1.2 List of Revisions .............................................................................................................................4 1.3 System Requirements....................................................................................................................5 1.4 Intended Audience .........................................................................................................................5 1.5 Specifications .................................................................................................................................6 1.5.1 Technical Data .................................................................................................................................. 6 1.6 1.7 1.8 Terms, Abbreviations and Definitions ..........................................................................................10 References to Documents............................................................................................................10 Legal Notes ..................................................................................................................................11 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 2 Copyright ......................................................................................................................................... 11 Important Notes............................................................................................................................... 11 Exclusion of Liability ........................................................................................................................ 12 Export .............................................................................................................................................. 12 Registered Trademarks ................................................................................................................... 12 Fundamentals .......................................................................................................................................13 2.1 General Access Mechanisms on netX Systems ..........................................................................13 2.2 Accessing the Protocol Stack by Programming the AP Task’s Queue........................................13 2.2.1 Getting the Receiver Task Handle of the Process Queue ............................................................... 14 2.2.2 Meaning of Source- and Destination-related Parameters................................................................ 14 2.3 Accessing the Protocol Stack via the Dual Port Memory Interface..............................................15 2.3.1 Communication via Mailboxes......................................................................................................... 15 2.3.2 Using Source and Destination Variables correctly........................................................................... 16 2.3.3 Obtaining useful Information about the Communication Channel.................................................... 20 2.4 Client/Server Mechanism .............................................................................................................22 2.4.1 Application as Client ........................................................................................................................ 22 2.4.2 Application as Server ...................................................................................................................... 23 3 Dual-Port-Memory ................................................................................................................................24 3.1 Cyclic Data (Input/Output Data) ...................................................................................................24 3.1.1 Input Data Image............................................................................................................................. 24 3.1.2 Process Data Output ....................................................................................................................... 26 3.2 Acyclic Data (Mailboxes)..............................................................................................................27 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3 General Structure of Messages or Packets for Non-Cyclic Data Exchange .................................... 28 Status & Error Codes ...................................................................................................................... 30 Differences between System and Channel Mailboxes .................................................................... 30 Send Mailbox................................................................................................................................... 30 Receive Mailbox .............................................................................................................................. 30 Channel Mailboxes (Details of Send and Receive Mailboxes) ........................................................ 31 Status ...........................................................................................................................................32 3.3.1 Common Status............................................................................................................................... 32 3.3.2 Extended Status .............................................................................................................................. 37 3.4 4 Control Block................................................................................................................................41 Getting Started......................................................................................................................................42 4.1 Overview about Essential Functionality .......................................................................................42 4.2 Configuration Parameters and Procedures..................................................................................42 4.2.1 Using a Packet (CANOPEN_APS_SET_CONFIGURATION_REQ/CNF)............................................ 43 4.2.2 Behavior when receiving a Set Configuration Command ................................................................ 45 4.3 4.4 Task Structure of the CANopen Slave V3 Stack..........................................................................45 CANopen – Basic Topics .............................................................................................................47 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.5 NMT Slave State Machine............................................................................................................... 47 Communication Objects, COB-IDs and Priority of Processing ........................................................ 50 Relation between Communication Objects and NMT States ........................................................... 52 Events ............................................................................................................................................. 52 Process Data Objects (PDO)........................................................................................................... 61 Standard Mode vs. Extended Mode.............................................................................................68 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 How to decide between Operation in Standard Mode and Extended Mode .................................... 68 Where can I switch between Standard Mode and Extended Mode? ............................................... 68 Standard Mode................................................................................................................................ 69 Extended Mode ............................................................................................................................... 71 Object Dictionary with Firmware Functionality................................................................................. 72 CANopen Slave | Protocol API DOC111001API05EN | Revision 5 | English | 2013-10 | Released | Public © Hilscher, 2011-2013