Home
CANopen Slave Protocol API
Contents
1. x 189 191 Emergency Error Codes Variable usErrorCode uussessesnessnnnnneennnnnnnnnnnnennnnnn ernennen nnnnennnnnnnn nenn nnnn nn 106 Error Reglster eec D EREEVETE P P O ER DOE Sn 107 CANOPEN SLAVE PACKET SEND EMCY REO T Send Emergency Message Request 108 CANOPEN SLAVE PACKET SEND EMCY CNF T Send Emergency Message Confirmation 109 Emergency Error Codes Variable usErrorClode lt lt lt enne nennen enne 110 Error Register P ELE 111 CANOPEN SLAVE PACKET SEND EMCY IND T Send Emergency Message Indication 112 CANOPEN SLAVE PACK SEND CY RES T Response to Send Emergency Message Indication 113 NMIT St tes 2 2 28 TEE ERU DOTEM 114 CANOPEN SLAVE PACK SET N STA REQ_T Set NMT State Reguest nen 115 CANOPEN SLAVE PACK SET N STATE CNF Set NMT State Confirmation 116 CANOPEN SLAVE PACKET SET BUSPARAM REO T Set Bus Parameters Request ne 120 CANOPEN SLAVE PACKET SET
2. typedef struct CANOPEN SLAVE EXTENDED STATE Ttag CANOPEN SLAVE EXTENDED STATE T define CANOPEN SLAVE EXT STATE FLAG CAN INIT 0x00000001L define CANOPEN SLAVE EXT STATE FLAG CAN ACTIVE 0x00000002L define CANOPEN SLAVE EXT STATE FLAG PASSIVE 0x00000004L define CANOPEN SLAVE EXT STATE FLAG BUS OFF 0x00000008L define CANOPEN SLAVE EXT STATE FLAG RX OVERFLOW 0x00000010L define CANOPEN SLAVE EXT STATE FLAG TX OVERFLOW 0x00000020L define CANOPEN SLAVE EXT STATE FLAG WDG 0x00000100L define CANOPEN SLAVE EXT STATE CTRL 0x00001000L define CANOPEN SLAVE EXT STATE NRDY 0x00002000L define CANOPEN SLAVE EXT STATE TIMEOUT 0x00004000L define CANOPEN SLAVE EXT STATE UNKNOW 0x00000000L define CANOPE SLAVE EXT STATE OPERATIONAL 0x00000001L define CANOPEN SLAVE EXT STATE STOP 0x00000002L define CANOPEN SLAVE EXT STATE PRE OPERATIONAL 0x00000080L define CANOPE SLAVE EXT STATE INITIALISING 0x000000FFL define CANOPEN SLAVE ADD DETAIL SIZE 0x00000003L struct CANOPEN SLAVE EXTENDED STATE Ttag LR UINT32 ulFlags LR UINT32 ulNodeState LR UINT32 ulBusOffEveCnt LR UINT32 ulErrorPassiveEveCnt LR UINT32 ulRxOverflowCnt LR UINT32
3. typedef struct CANOPEN_SLAVE_SLAVE_STATE_Ttag CANOPEN_SLAVE_SLAVE_STATE_T define CANOPEN SLAVE CAN STATE UNKNOWN 0x0 define CANOPEN SLAVE CAN STATE NOT CONFIGURED 0x0 define CANOPEN SLAVE CAN STATE STOPPED 0x0 define CANOPEN SLAVE CAN STATE STARTED 0x0 define CANOPEN SLAVE CAN STATE RUNNING 0x0 define CANOPEN SLAVE STATE FLAG RDY 0x0 define CANOPEN SLAVE STATE FLAG RU 0x0 define CANOPEN SLAVE STATE FLAG CO 0x0 define CANOPEN SLAVE STATE FLAG BUS ON 0x0 define CANOPEN SLAVE STATE FLAG COMM ERROR 0x0 define CANOPEN SLAVE STATE FLAG CAN STARTED 0x0 St ruee EANOPENZSTAVEZSTAVEZSTATEFTEAG TLR_UINT32 ulCanState TLR_UINT32 aulUnused 2 TLR_UINT32 ulFlags RUN ZO RC OUT PTT U INN S23 COMN EAA O7 LR UINT32 ulRunLedState TLR UINT32 ulErrLedState TLR UINT32 ulRecvDataCnt TLR UINT32 ulSendDataCnt TLR UINT32 ulReserved ulCanState 001 OTE 02L 03L 04L cop ey ex STS onim 02L 04L 08L 10L 00L er e C en a STS This variable is organized as a bit field as described in the table below 102 191 Bit Name Description D4 CANOPEN SLAVE CAN STATE RUNNING CAN State is Running D3 CANOPEN SLAVE CAN STATE STARTED CAN State is Started D2 CANOPEN SLAVE CAN STATE STOPPED CAN State
4. define CANOPEN_SLAVE_CFG_BAUD_250 0x00000003L 250kBaud oA define CANOPEN SLAVE CFG BAUD 125 0x00000004L 125kBaud Sm define CANOPEN SLAVE CFG BAUD 100 0x00000005L 100kBaud EN define CANOPEN_SLAVE_CFG_BAUD_50 0x00000006L 50kBaud N define CANOPEN_SLAVE_CFG_BAUD_20 0x00000007L 20kBaud 7 define CANOPEN SLAVE CFG BAUD 10 0x00000008L 10kBaud or define CANOPEN SLAVE CFG BAUD AUTO DETECTION 0x000000FFL Auto Baud detection z define CANOPEN_SLAVE_STD_CFG_DEF_OBJECT_SIZE 128 Default object size in std mode define CANOPEN_SLAVE_CFG_MAX_RXPDO 256 Maximum number of RxPDO N define CANOPEN_SLAVE_CFG_MAX_TXPDO 256 Maximum number of TxPDO wif PACKED PRE struct CANOPEN SLAVE STD BUSPARAM DATA Ttag TLR UINT32 ulVendorId Vendor ID TLR UINT32 ulProductCode Product code ef TLR_UINT32 ulSerialNumber Serial number TLR UINT32 ulRevisionNumber Revision number TLR UINT32 ulDeviceType Device Type i TUR GINIE bObsecr 2 0 0 08592 7 m J Size EIC 2000 E TLR UINT8 bObject2001Size Ps Siza Cue Close 2001 A TLR UINT8 bObject2002Size fe Siza E qgiejeew 2002 A TER WINE effe ecc 20Ssumer J Size gi Gloyecie 2003 zf TUR UNTE lil jeace2ZO0Sawee J Size oi To i99 2200 2 TLR UINT8 bObject2201Size Size oe lor 220 TLR UINT8 bObject2202Size fe Siza x O CC 2202
5. struct CANOPEN SLAVE PACKET NMT STATE CHANGE IND Ttag TLR PACKET HEADER T tHead packet header CANOPEN SLAVE NMT STATE CHANGE IND DATA T tData packet data KKK KK kk kk kk kk kk kk I kk Ck Ck kk kk 2 Ck k kk kk kk kk kk kk kk ck Ck kk ck ck k k k k ck k ck k k ck ck ck ck ck ck ck ck ok ck ok ke e k CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 148 191 Packet Description structure CANOPEN_SLAVE_PACKET_NMT_STATE_CHANGE_IND_T Type Indication Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet VOId inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Code
6. struct CANOPEN SLAVE STATE CHANGE IND DATA Ttag CANOPEN_SLAVE_SLAVE_STATE_T tSlaveState Blave state CANOPEN_SLAVE_EXTENDED_STATE_T tExtendedState Extended state RK KK HK ok k kk kk kok k ok kok kk I kk kk kk kk kk kk k kok 2 k kok kk kk kk kk kk kok 2 2 22 2 2 2 2 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE PACKET STATE CHANGE IND Ttag lt code gt typedef struct CANOPEN SLAVE PACKET STATE CHANGE IND Ttag CANOPEN SLAVE PACKET STATE CHANGE IND T struct CANOPEN SLAVE PACKET STATE CHANGE IND Ttag TLR_PACKET_HEADER_T tHead packet header CANOPEN SLAVE STATE CHANGE IND DATA T tData packet request data RK KK kk kk kk kk kk kk I kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k I I ck ck ck ck ck ck A 22 22 2 2 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 101 191 Packet Description Structure Information CANOPEN SLAVE PACKET STATE CHANGE IND T Type Indication Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T
7. cues CANNOMNTIN STL VACHE IE IBICO IDN SAME ILINJD ESC TLR PACKET HEADER T tHead packet header CANOPEN_SLAVE_RECV_TIME_STAMP_IND_DATA_T tData packet request data Ea l P e kk k kok ok ok kok ok kok kok kok kok kok kok kok kok kok kok kok kok kok kok k k kok k kk kk kk kk kk kk kk k ck k k k k k k ok sk ok ke CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 126 191 Packet Description structure CANOPEN SLAVE PACKET RECV TIME STAMP IND T Type Indication Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet vold inside the Source Process ulLen UINT32 6 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task
8. Situation Errorcode The packet length is invalid TLR_E_INVALID_PACKET_LEN The field ulParameterlD contains an unknown value R E INVALID PARAMETER The field ulParameterLength contains an invalid value ROE INCONSISTENT DATA SET The content of abParameter is invalid JR E PARAMETER ERROR The firmware is not configured at all no database found TLR E NOT CONFIGURED Table 116 Common error scenarios and error codes to use CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference typedef struct RCX_S LR_UIN 32 LR_UIN 52 RCX SET FW PARAMET typedef struct TLR_PACKET_HE LR UINT8 next ulParameterID ulParameter abParameter parameter Len 177 191 ulParameterLen REIS ADER RUX SE OE SIBI I tHead ER REQ DATA T FW PARAME FW PARAME Packet Description ER REO DATA ER CREDI tData ET FW PARAMETER REQ DATA Ttag padded to DWORD boundary ET FW PARAMETER REQ Ttag packet header structure RCX SET FW PARAMETER REO T Type Request
9. struct CANOPEN SLAVE PACKET SET API PARAM REO Ttag TLR PACKET HEADER T tHead packet header CANOPEN_SLAVE_SET_API_PARAM REO_DATA_T tData packet request data 2 DE RK KK HK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kok k kk kk kk kk kk 2 2 kk kok kk ck ck kk ke ke 2 2 2073 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 145 191 Packet Description structure CANOPEN SLAVE PACKET SET API PARAM REO T Type Reguest Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle OUE CANOPEN SLV ulSrc UINT32 0 2 1 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See sect
10. Value Symbolic Name Meaning Action to take 1 CANOPEN_SLAVE STATE_OPERATIONAL Set state to Operational 2 CANOPEN_SLAVE STATE_STOP Set state to Stopped 128 CANOPEN_SLAVE STATE_PRE_OPERATIONAL Set state to Pre operational 129 CANOPEN_SLAVE STATE_RESE ODE Reset node 130 CANOPEN_SLAVE STATE_RESET_COM Reset communication Table 101 NMT States Reset communication should set the state to Initialization sub state Reset Communication This means first restoring the communication profile area of the Object Dictionary with the power on values and then run the initialization process like after power on Reset node should set the state to nitialization sub state Reset Application This means first restoring the manufacturer specific area and the device profile area of the slave s Object Dictionary with the default values then restoring the communication profile area of the Object Dictionary with the power on values and finally run the initialization process like after power on The NMT Protocol associated with the NUT Command Event is illustrated in Figure 19 NMT Protocol NMT Protocol Node Start Stop State Transition NMT Master NMT Slave s Byte 0 Byte 1 Request y yt Indication s COB ID 0 Figure 19 NMT Protocol In this figure CS Command Specifier means the value of variable ulNmt Command
11. ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet voId inside the Source Process ulLen UINT32 60 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2935 CANOPEN_SLAVE_GET_BUSPARAM_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE GET BUSPARAM CNF DATA T tBusParam CANOP Structure Bus parameter structure see EN_SLA Table 45 Bus parameter structure VE_BUS CANOPEN_SLAVE_BUSPARAM_DATA_T PARAM _DATA_ T Table 105 CANOPEN SLAVE PACKET GET BUSPARAM CNF T Confirmation to Get Bus Parameters Reguest CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 162 191 5 2 22 CANOPEN SLAVE SET WATCHDOG FAIL REQ CNF Set Watchdog Fail This packet is used by the AP Task
12. Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination gueue handle of application task process gueue ulSrc UINT32 Source Queue Handle of PNSIF task process queue ulDestId UINT32 O Destination End Point Identifier ulSrcId UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 8 Packet data length in bytes N depends on the number of used ulParameterLen switch values ulld UINT32 0 2 4 Packet identification as unique number generated by the source process of the packet ulSta UINT32 Status not used for request ulCmd UINT32 0x00002F86 RCX SET FW PARAMETER REO Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure RCX SET FW PARAMETER REO DATA T ulParameterID UINT32 0 OxFFFFFFFF The number of used hardware switches ulParameterLen UINT32 See below Length of the parameter in bytes abParameter UINT8 Parameter Value as a byte array Next parameter may follow Table 117 RCX SET FW PARAMETER REO T Set Value of the Firmware Parameter Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 178 191 Packet Structure Reference typedef struct RCX_SET_FW_PARAMETER_CNF_DATA_Tt
13. ccccccceceecceceeeeeeeeeecaeceeeeeeeceeaaeaeeeeeceseeaaeaeeeeeeesecaeaeeeeseseeqaeaeeeeeeeseeseeaeees 66 Table 36 Standard bus parameter structure CANOPEN SLAVE STD BUSPARAM DATA T 69 Table 37 Mapping of Input Data in case of unchanged object lengths and no netX 10 applied nee 70 Table 38 Mapping of Output Data in case of unchanged object lengths and no netX 10 applied 70 Table 39 Extended bus parameter structure CANOPEN SLAVE EXT BUSPARAM DATA T eee 71 Table 40 Supported Object Dictionary Entries Communication Profile present in the EDS file 72 Table 41 Supported Object Dictionary Entries Manufacturer specific Profile present in the EDS file 73 Table 42 APM Task Process QUU O a e a a a a a a aaae a e E E 74 Table 43 CANOPEN_APS_PCK_GET_STATE_REQ_T Get State of AP Task Reguest eee eee 75 Table 44 CANOPEN_APS_PCK_GET_STATE_CNF_T Get State of AP Task Confirmation ee ernennen ennen ern n 76 Table 45 Bus parameter structure CANOPEN SLAVE BUSPARAM DATA T eene 78 Table 46 Codes and Corresponding Baud Rates of CANopen Network essen 79 Table 47 Explanation of Parameter ulCanOpenFlags 22snnesnnsnsnsnnnnnnnannnnnnnnnnnnnnannnnnnnnnnnnnnnnnnnnnnnnnnnnnnannnnnnnnnn mann 80 Table 48 CANOPEN APS PCK SET CONFIGURATION REO Set Warmstart Parameter Reque
14. struct CANOPEN_APS_SET_CONFIGURATION_RE TLR_PACK ANOPEN_APS_SET_CO hi OP EN APS SI EN APS SET CONFI FIGURATION REO T ET CONFIGURATION RI Ep EAD ER T FIGURATION REQ DAT header GURATION REO Ttag lt code gt EQ Ttag O Ttag BSA AMOSE HC ODABA I7 packar data ty KKK kk kk k k k k k k k k k k k k k k k k KR CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Description 83 191 Structure Information CANOPEN_APS_PCK_SET_CONFIGURATION_REQ_T Type Request Area Variable Type Value Description Range tHead Structure TLR_PACKET_HEADER ulDest UINT32 0x20 Destination Aueue Handle of CANopen slave task Process QUE CANOPE Queue NAPS ulSrc UINT32 0251 Source Queue Handle of AP task Process Queue ulDestId UINT32 ulCANOPESL Destination End Point Identifier specifying the final receiver of VTOId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 68 Packet Data Length In Bytes ulld UINT32 0 2 1 Packe
15. type of lt code gt CANOPEN SLAVE STARTSTOP REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE STARTSTOP REO DATA Ttag CANOPEN SLAVE STARTSTOP REO DATA T define CANOPEN SLAVE STOP CANOPE 0x00000000L Stop CANopen define CANOPEN SLAVE START CANOPEN 0x00000001L Start CANopen Structure of task command start stop CANopen request data struct CANOPEN SLAVE STARTSTOP REO DATA Ttag HRAN HO ZAM O CE AS CAMO Sires CAWWOjxem hi RK IK IK IK kok kok kok kok kok kok kok kok kok kok kok kok k kk kk kok kk kk kk kk kk kk ck k ck k ck k ck k ck k ck ck ck 2 2 2 2 2 2 2 2 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE PACKET STARTSTOP REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET STARTSTOP REO Ttag CANOPEN SLAVE PACKET STARTSTOP REO T Structure of task command start stop CANopen reguest struct CANOPEN SLAVE PACKET STARTSTOP REO Ttag u TLR_PACKET_HEADER_T tHead packet header CANOPEN SLAVE STARTSTOP REO DATA T tData OAC KC BBE UCS elzuEeio 97 kk k kok kok ok kok kok kok kok kok kok kok kok kok kok kok kok kok kok k kok kk kk kk kk k ck k ck k ck k ck k ck k ck k ck k k k k k ok ckok ke CANopen Slave Protocol API DOC111001API05EN Revision 5 Engl
16. Figure 13 Modes of Communication Event driven Polling Synchronized Event driven communication A PDO can be transmitted when a specific event that has been previously defined occurs locally at the producer This communication mode is called event driven PDO communication The driving event may be any local event such as a change of an input or elapsing of a specific timer This case is equivalent to the push model described above CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 64 191 Polling by CAN remote frames A consumer can also stimulate the PDO transmission This case is equivalent to the pull model described above This is internally accomplished by sending a RTR Frame to the producer The producer will then automatically answer by transmission of the PDO in a CAN Data Frame Synchronized communication Transmission of a PDO can be triggered periodically i e a repeated and precise time synchronization signal is received For this purpose CANopen provides the SYNC object The PDO can be coupled to the SYNC object This forces the CANopen Slave to process the PDOs TxPDOs and RxPDOs Let us now clarify the terms synchronous asynchronous cyclic and acyclic in context with data transmission 4 4 5 4 Synchronous vs asynchronous Data Transmission CAN distinguishes between synchronous and asynchronous data transmission
17. eee 144 5 2 18 CANOPEN SLAVE N STATE CHANGE IND RES NMT State Change Indication 147 5 2 19 CANOPEN SLAVE ERR CTRL EVENT IND RES Error Control Event Indication 150 5 2 20 CANOPEN SLAVE NMT COMMAND IND RES NMT Command Indication 5 2 21 CANOPEN SLAVE GET BUSPARAM REQ CNF Get Bus Parameters eee 5 2 22 CANOPEN SLAVE SET WATCHDOG FAIL REQ CNF Set Watchdog Fail 5 2 23 CANOPEN SLAVE SETUP PDO INDICATION REQ CNF Setup PDO Indication 164 5 2 24 CANOPEN SLAVE RECEIVE PDO IND RES Receive PDO Indication 167 5 3 Hardware Switches for the Adjustment of Slave Address and Baudrate 170 5 3 1 RCX SET HW SWITCH VALUES REQ CNF Set the Values of the Hardware Switch 172 5 3 2 RCX SET FW PARAMETER REQ CNF Set the Value of the Firmware Parameter 175 5 3 3 RCX GET FW PARAMETER REQ CNF Get the Value of the Firmware Parameter 179 5 4 GAN DE Task 2a kod ooo ette erc toe la nu cue aea een aed tie 181 5 5 ODV3 Taser ebore et aan e epe Mte ba aude ee 181 6 Status Error Codes OVE V AW n ievcer ta veau va sa een in Pa vasa en ann ann an en anna nn Ka a nn ante nn aS du snvenantacazaciensactate 183 6 1 1 Codes of the CANopen APS Task 2 2 4 eee enne nne nere nnne nennen nennen nennen 183 6 12 Error Messages ueri rr RH EP E MEE PEE NESS REDE ERE
18. CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 167 191 5 2 24 CANOPEN_SLAVE_RECEIVE_PDO_IND RES Receive PDO Indication The following indication is sent from the CANopen slave to the application each time a PDO is received The indication includes the PDO number the identifier COB ID the length and the data Note No PDO indications are sent to the application until this functionality is explicitly enabled Enabling PDO indications is described in this manual in section CANOPEN_SLAVE_SETUP_PDO_INDICATION_REQ CNF Setup PDO Indication Enabling can be done for single or multiple PDO transfer with one packet Packet Structure Reference KKK IK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k k I ck ck A ck ck 2 22 22 ok sk type of lt code gt CANOPEN SLAVE RECEIVE PDO IND DATA Ttag lt code gt typedef struct CANOPEN SLAVE RECEIVE PDO IND DATA Ttag CANOPEN SLAVE RECEIVE PDO IND DATA T type of lt code gt CANOPEN SLAVE PDO DATA Ttag lt code gt typedef struct CANOPEN SLAVE PDO DATA Ttag CANOPEN SLAVE PDO DATA T define CANOPEN SLAVE RECEIVE PDO IND MAX 16 define CANOPEN SLAVE RECEIVE PDO IND MAX DATA 8
19. hilscher COMPETENCE IN COMMUNICATION Protocol API CANopen Slave V3 6 x x Hilscher Gesellschaft f r Systemautomation mbH www hilscher com DOC111001API05EN Revision 5 English 2013 10 Released Public Table of Contents 2 191 Table of Contents 1 ATTRACTION rm 4 111 ZAbStraetn Ee 4 1 2 LISHOT REVISIONS cocer teo ts ene ete ret c ioc n a R aaa Raka tate A AT A End as Eee 4 Ta SYSTEM Requirements x ec coacto ee da o ee Ra cots Ao av o as 5 14 Intended Audience does os ern Alo aaa atak val 5 1 5 Specications c Mm 6 1 5 Technical Data eR eiie gelidi tee oo dies ente 6 1 6 Terms Abbreviations and Definitions eeessssssssseseeeneeeeneen nemen nennen nni 10 Ast JReterences to Documenis orm HR Re ael tte DH ADIRE 10 1 83 LEJANO GS 54e dete tepet eiit amando tiit asi n saagcean EDEL c KENA ed 1 8 1 Copyright 2 eese rte etie orte RE REPRE p ERU SRO MERE RR TS 1 8 2 Important Notes 1 8 3 Excl sion of Liability 5533x365 sib Hasena tco de dde ete dee Eros toad 12 18 4 EXDOFT nenne tero Rees et uev ie utes eue es ce oa ko Sa na o oo ge nee nennen 12 1 8 5 Registered Trademarks deleted seh ended e deka HShe 12 2 herum 13 2 1 General Access Mechanisms on netX Systems eee nenene 13 2 2 Accessing the Protocol Stack by Programming the AP Task s Aueue 13 2 2 1 Getting the Receiver Task Handle of th
20. struct CANOPEN SLAVE PDO DATA Ttag TLR UINT32 ulPdoNumber PDO number TEE UNE SD Larse ai ie deseo CAN identifier TLR UINT32 ulLength Data length DA TLR UINT8 abPdoData CANOPEN SLAVE RECEIVE PDO IND MAX DATA PDO data 7 struct CANOPEN_SLAVE_RECEIVE_PDO_IND_DATA_Ttag CANOPEN SLAVE PDO DATA T atPdoData CANOPEN SLAVE RECEIVE PDO IND MAX KKK KK KK k k k IK 2 kk kk kk I 2 kk I I I ZZ I I I I I ck ckck ck ck ck kckck ck A 22 22 2 2 22 2 2 ok type of lt code gt CANOPEN_SLAVE_PACKET_RECEIVE_PDO_IND_Ttag lt code gt typedef struct CANOPEN_SLAVE_PACKET_RECEIVE_PDO_IND_Ttag CANOPEN SLAVE PACKET RECEIVE PDO IND T struct CANOPEN SLAVE PACKET RECEIVE PDO IND Ttag TLR PACKET HEADER T tHead packet header CANOPEN SLAVE RECEIVE PDO IND DATA T tData packet data RK ok ok kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk 2 kk kk kk kk Sk ke kc 2 2 2 kc 2 2 k kc 2 2 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2073 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 168 191 Packet Description Structure Information CANOPEN SLAVE PACKET RECEIVE PDO IND T
21. RK KK IK kk IK I kok kok kok kok kok kok kok kok kok kok I k k k k k I 22 2 2 2 2 22 2073 type of lt code gt CANOPEN SLAVE PACKET REGISTER CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET REGISTER CNF Ttag CANOPEN SLAVE PACKET REGISTER CNF T 5 SExWWCTENUEe Ol task Commence soe cei om esse Cwimitslicmeneiiom 7 struct CANOPEN SLAVE PACKET REGISTER CNF Ttag TLR PACKET HEADER T tHead packet header A CANOPEN SLAVE REGISTER CNF DATA T tData packet confirmation data RK IK IK kk kk kk kk Ck Ck kk kk kk Ck kok Ck I kk Ck Ck kk kk kk kk kk k ck kk k k ck k ck k k ck ck ck ck ck ck ck ck ok sk ke ek Packet Description Structure Information CANOPEN SLAVE PACKET APP REGISTER CNF Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Oueue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSS0Id Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched vOld ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the P
22. 1 2 List of Revisions Rev Date Name Revisions 1 2012 03 09 RG ES Firmware stack version V3 1 2 x Reference to netX Dual Port Memory Interface Manual Revision 12 Reference to Object Dictionary V3 2 8 0 First final version 2 2012 07 04 RG ES Firmware stack version V3 2 x x Added description of packetRCX SET FW PARAMETER REQ CNF Set the Value of the Firmware Parameter 3 2013 04 11 RG ES Firmware stack version V3 4 3 x Reference to Object Dictionary V3 3 1 x Reference to CAN DL V2 0 22 0 Added description of packet RCX GET FW PARAMETER REQ CNF Get the Value of the Firmware Parameter Added description of packet CANOPEN SLAVE SEND EMCY IND RES Emergency Message Indication Adapted description of packet CANOPEN SLAVE SET EVENTS INDICATED REQ CNF Set Events Indicated Reguest to new Send EMCY Event Adapted Table 51 Packets of CANopen Slave Protocol Stack V3 and Restrictions of Usage for new Send EMCY Event 4 2013 05 22 RG ES Firmware stack version V3 5 1 x Reference to Object Dictionary V3 3 1 x Reference to CAN DL V2 0 23 0 netX52 now supported 5 2013 10 29 RG ES Firmware stack version V3 6 2 x Reference to Object Dictionary V3 3 2 x Reference to CAN DL V2 0 27 0 Technical data updated number of consumers for netX51 52 Small corrections Table 1 List of Revisions CANopen S
23. 143 CANOPEN SLAVE PACK S API PARAM REQ Set API Parameter Request ne 145 CANOPEN_SLAVE_PACK S API PARAM CNF T Confirmation to Set API Parameter Request 146 ST E ee OR r O LE Een o MER 147 CANOPEN SLAVE PACK STA CHANGE IND T NMT State Change Indication 148 CANOPEN SLAVE PACK STA CHANGE RES T Response to NMT State Change Indication 149 Array Elements of at ErzrCctrlEvent 16 Luxe itn ether oO ese do tcr dte qose s iod ise eit Possible Values of ulEvent and their Meanings CANOPEN SLAVE PACKET ERR CTRL EVENT IND T Error Control Event Indication 152 CANOPEN SLAVE PACKET ERR CTRL EVENT RES T Response to Error Control Event Indication 153 NMT States i IM MEUM RH z RH Ra ocn et A O AEE NONE CANOPEN SLAVE PACKE COMMAND IND T NMT Command Indication CANOPEN SLAVE PACKET COMMAND RES T Response to NMT Command Indication 157 CANOPEN SLAVE PACKET GET BUSPARAM REO T Get Bus Parameters Request ssss 158 CANOPEN SLAVE PACK G BUSPARAM CNF T Confirmation to Get Bus Parameters Request 161 CANOPEN SLAVE PACK S WATCHDOG FAIL REO T Set Watchdog Fail Request 162 CANOPEN SLAVE PACK S WATCHDOG FAIL CNF T Set Watchdog Fail Confirmation 163 CANOPEN SLAVE PACKET SETUP PDO INDICATION REO T Setup PDO Indication Request 165 CANOPEN
24. CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 155 191 When the application receives the CANOPEN SLAVE NMT COMMAND IND indication it should try to do everything required to set the slave into the state having been requested However this may not be possible in all situations So there is the possibility to leave the slave in another state than the requested one In any case the application needs to send a response packet The current state after processing the CANOPEN SLAVE NMT COMMAND IND indication needs to be supplied in the response packets ulNmt State variable As NMT is an unconfirmed service the response is not sent to the CANopen Master but required for internal use at the CANopen Slave Packet Structure Reference 8 AR RIK IIR II IK II HH IIR II IIR III IIR I IK I IO I IO IIR A IK A AK NMT states for CANOPEN SLAVE SET NMT STATE REQ CANOPEN SLAVE NMT STATE CHANGE IND and CANOPEN SLAVE NMT COMMAND IND KKK IK kk I kk kk kok 2 kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k kk k k k k ck k ck ck ck ck 2 22 22 2 2 2 2 define CANOPEN SLAVE NMT STATE OPERATIONAL 0x01 define CANOPEN SLAVE NMT STATE STOP 0x02 define CANOPEN SLAVE NMT STATE PRE OPERATIONAL 0x80 define CANOPE
25. Length of Data Field The ulLen field holds the size of the data field in bytes It defines the total size of the packet s payload that follows the packet s header The size of the header is not included in u Len So the total size of a packet is the size from ulLen plus the size of packet s header Depending on the command a data field may or may not be present in a packet If no data field is included the length field is set to zero Identifier The ulld field is used to identify a specific packet among others of the same kind That way the application or driver can match a specific reply or confirmation packet to a previous request packet The receiving task does not change this field and passes it back to the originator of the packet Its use is optional in most of the cases But it is mandatory for sequenced packets Example Downloading big amounts of data that does not fit into a single packet For a sequence of packets the identifier field is incremented by one for every new packet Status Error Code The ulState field is used in response or confirmation packets It informs the originator of the packet about success or failure of the execution of the command The field may be also used to hold status information in a request packet Command Response The ulCmd field holds the command code or the response code respectively The command response is specific to the receiving task If a task is not able to execute certain com
26. Reserved for further use set to zero Ax kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kk kk kk kkkkkkkkkkkkkkx type of lt code gt CANOPEN SLAVE PACKET REGISTER REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET REGISTER REO Ttag CANOPEN SLAVE PACKET REGISTER REO T Structure of task command application register reguest struct CANOPEN SLAVE PACKET REGISTER REO Ttag TLR_PACKET_HEADER_T tHead packet header a CANOPEN SLAVE REGISTER REQ DATA T tData S joacket tregues r obra l KKK HK kok kk kk kk kk kk kk k DZ 2 kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k ck ck ck ck ck ck ck ckckckckck ck sk CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 88 191 Packet Description Structure Information CANOPEN SLAVE PACKET REGISTER REO T Type Reguest Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 OUE CANOPEN Destination Queue Handle of CANopen slave Task Process SLV Oueue ulSrc UINT32 0 2 1 Source Queue Handle of AP Task Process Queue u
27. SET typedef struct CANOPEN SLAVE MSE NES ATARI OF CANOPEN_SLAVE_SET_NMT_STA EL CNE DATA_T struct CANOP EN SLAVE SE T NM STATE CNF DATA Ttag TLR_UINT32 ulNmts J KCECKCKCKCkCk kk kk kk kk kk KK KK e e cacep NME State d CKCKCKCKCKCKCkCkCkCKCkCkCkCkCk kCkCkCkCkCk kk kk k ck kk kok ok sk ke ko ke ke e eoe ee kx x type of code CANOPEN SLAVE PACKET SET NMT STATE CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET NMT STATE CNF Ttag CANOPEN SLAVE PACKET SET NMT STATE CNF struct CANOPEN SLAVE PACKET SET NMT STATE CNF Ttag TLR_PACKET_HEADER_T tHead packet header 27 CANOPEN_SLAVE_SET_NMT_STATE_CNF_DATA tData packet data 3 hi RK IK IK kk kok kok kok kok kok kok kok k k kok k kk Kk kok kk kk kk kk kk kk kk kk kk kk kk k ck k k k k k ck ck ok ck ck ck ok ke Packet Description Structure Information CANOPEN SLAVE PACKET SET NMT STATE CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untou
28. Synchronous data transmission means in this context coupled to a synchronization signal such as the one supplied by the SYNC object Synchronous data transmission takes place within a well defined time window following the SYNC signal PDOs offer the only mechanism for synchronous data transmission It is strongly recommended that the priority of synchronous PDOs should be higher than that of the asynchronous PDOs Asynchronous data transmission means in this context event driven Asynchronous data transmission can generally take place at any time without restriction CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 65 191 4 4 5 5 Cyclic and acyclic Data Transmission CAN also distinguishes between two forms of synchronous data transmission namely cyclic data transmission and acyclic data transmission Cyclic data transmission means periodic data transmission coupled to the SYNC signal However this does not necessary mean one transmission at every SYNC event You can define the transmission type i e a number of SYNC events to occur between to synchronous data transmissions This number may be chosen from the range from 1 to 240 Thus transmission type 1 means one transmission at every SYNC event transmission type 2 means one transmission at every second SYNC event and so on Acyclic data transmission means data transmission triggered by an appl
29. English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 13 191 2 Fundamentals 2 1 General Access Mechanisms on netX Systems This chapter explains the possible ways to access a Protocol Stack running on a netX system 1 By accessing the Dual Port Memory Interface directly or via a driver 2 By accessing the Dual Port Memory Interface via a shared memory 3 By interfacing with the Stack Task of the Protocol Stack The picture below visualizes these three ways v Send Mailbox Extended Status Block Reveive Mailbox Output Data Image Input Data Image AP Task Network Abstraction Layer Network Figure 1 The 3 different Ways to access a Protocol Stack running on a netX System This chapter explains how to program the stack alternative 3 correctly while the next chapter describes accessing the protocol stack via the dual port memory interface according to alternative 1 and 2 if the user application is executed on the netX chip in the context of the rcX operating system and uses the virtual DPM Finally chapter 5 titled The Application Interface describes the entire interface to the protocol stack in detail Depending on you choose the stack oriented approach or the Dual Port Memory based approach you will need either the information given in this chapter or those of the next chapter to be able to work with the set of functions described in chapter 5 All of
30. Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 92 191 Packet Structure Reference RK KK IK kk kok kok kok kok kok kok kok kok k kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k I 22 22 2 2 2 2 22 2073 type of lt code gt CANOPEN SLAVE STARTSTOP CNF DATA Ttag lt code gt typedef struct CANOPEN SLAVE STARTSTOP CNF DATA Ttag CANOPEN SLAVE STARTSTOP CNF DATA ty 0x00000000L Stop CANopen EN 0x00000001L Start CANopen define CANOPEN_SLAVE define CANOPEN_SLAVE OP_CANOP ART_CANO U HA S ES Structure of task command start stop CANopen confirmation data struct CANOPEN SLAVE STARTSTOP CNF DATA Ttag TLR_UINT32 ulMode Start or stop CANopen RK IK IK kk kk kk I I I I I 22 22 2 2 2 2 2 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2073 type of lt code gt CANOPEN_SLAVE_PACKET_STARTSTOP_CNF_Ttag lt code gt typedef struct CANOPEN SLAVE PACKET STARTSTOP CNF Ttag CANOPEN SLAVE PACKET STARTSTOP CNF T Structure of task command start stop CANopen confirmation struct CANOPEN SLAVE PACKET STARTSTOP CNF Ttag TLR_PACKET_HEADER_T tHead packet header CANOPEN_SLAVE_STARTSTOP_CNF_DATA_T tData packet confirmation data
31. Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 31 191 3 2 6 Channel Mailboxes Details of Send and Receive Mailboxes Master Status Offset Type Name Description 0x0200 UINT16 usPackagesAccepted Packages Accepted Number of Packages that can be Accepted 0x0202 UINT16 usReserved Reserved Set to 0 0x0204 UINTS abSendMbx 1596 Send Mailbox Non Cyclic Data To The Network or to the Protocol Stack usWaitingPackages Packages waiting 0x0840 UINT16 Counter of packages that are waiting to be processed 0x0842 UINT16 usReserved Reserved Set to 0 0x0844 UINT8 abRecvMbx 1596 Receive Mailbox Non Cyclic Data from the network or from the protocol stack Table 20 Channel Mailboxes Channel Mailboxes Structure typedef struct tagNETX SEND MAILBOX BLOCK UINT16 usPackagesAccepted UINT16 usReserved UINT8 abSendMbx 1596 NETX_SEND_MAILBOX_BLOCK typedef struct tagNETX RECV MAILBOX BLOCK UINT16 usWaitingPackages UINT16 usReserved UINT8 abRecvMbx 1596 NETX_RECV_MATLBOX_BLOCK CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 32 191 3 3 Status A status block is present within the communication channel It contains information about ne
32. QUE CANOPENAPS Name of the APS Task process queue CAN DL QUE Name of CAN DL Task process queue Table 11 ASCII Queue Name The returned handle has to be used as value ulDest in all initiator packets the AP Task intends to send to the CANopen slave This handle is the same handle that has to be used in conjunction with the macros like TLR QUE SENDPACKET FIFO LIFO for sending a packet to the respective task 2 2 2 Meaning of Source and Destination related Parameters The meaning of the source and destination related parameters is explained in the following table Variable Meaning ulDest Application mailbox used for confirmation ulSrc Queue handle returned by TLR_OUE_IDENTIFY as described above ulSrcld Used for addressing at a lower level Table 12 Meaning of Source and Destination related Parameters For more information about programming the AP task s stack queue please refer to the Hilscher Task Layer Reference Model Manual Especially the following sections might be of interest in this context 1 Section 7 Queue Packets 2 Section 10 1 9 Queuing Mechanism CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 15 191 2 3 Accessing the Protocol Stack via the Dual Port Memory Interface This chapter defines the application interface of the CANopen Slave stack V3
33. define CANOPEN SLAVE COMMON FLAG CFG HOLD LAST STATE 0x01000000L define CANOPEN SLAVE COMMON FLAG CFG DISABLE SEND COS SYNC ACYC 0x00010000L define CANOPEN SLAVE COMMON FLAG CFG DISABLE SEND COS MAN SPEC 0x00020000L define CANOPEN SLAVE COMMON FLAG CFG DISABLE SEND COS PROF SPEC 0x00040000L os yt a Configuration flags and for standard mode only a define CANOPEN SLAVE STD FLAG CFG VENDOR ID 0x00000010L define CANOPEN_SLAVE_STD_FLAG_CFG_PRODUCT_CODE 0x00000020L define CANOPEN SLAVE STD FLAG CFG SERIAL NUMBER 0x00000040L define CANOPEN SLAVE STD FLAG CFG REVISION NUMBER 0x00000080L define CANOPEN SLAVE STD FLAG CFG DEVICE TYPE 0x00000100L define CANOPEN SLAVE STD FLAG CFG OBJECT SIZE 0x00000200L define CANOPEN SLAVE STD FLAG CFG PDO CNT 0x00000400L Ps B Reno Configuration flags for extended mode only a Js x define CANOPEN_SLAVE_MIN_SLAVE_NODE_ID ili Minimum node ID s define CANOPEN SLAVE MAX SLAVE NODE ID 127 Maximum node ID define CANOPEN_SLAVE_CFG_BAUD_1000 0x00000000L 1MBaud s define CANOPEN SLAVE CFG BAUD 800 0x00000001L 800kBaud s define CANOPEN SLAVE CFG BAUD 500 0x00000002L 500kBaud i CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 118 191
34. essen nenn 68 4 5 2 Where can switch between Standard Mode and Extended Mode eee 68 4 5 3 Standard Mode eiit een dt ees Pet evt qud embers e pex evt voe PR ETE SE peace peu 69 4 5 4 Extended Mod Ra ee eb ing 71 4 5 5 Object Dictionary with Firmware Functionality 242444444400Rsnnnnnnnnnnnannnnnnnnnnnnnnennnnnnnnnnnnnn 72 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Table of Contents 3 191 5 The Application Interface ussnnssssnsnnnnnannnnnnnnnnnnnnnannnnnnnnnnnnnnnnnnnnnannnnnannnnnnnnnnnnnnnnnnnnnnnnnnn nennen 74 5 1 The GANopen APS Task untere en e o reto mean ger E Dore e OPER EA Re at 74 5 1 1 CANOPEN APS GET STATE REQ CNF Get State of AP Task ee eeeeee een 75 5 1 2 CANOPEN APS SET CONFIGURATION REQ CNF Set Configuration essen 77 5 2 The CANopen Slave Task ieee aaeain ea aaea a ara aa a aa aa Esaa ae aa a aa aasian 85 5
35. 130 CANOPEN SLAVE STATE RESET COM Initialization Reset Communication Table 94 NMT States This indication packet allows the application to react and perform all necessary application internal changes after the change of NMT state After having performed these the application should send the CANOPEN SLAVE NMT STATE CHANGE RES response packet to the CANopen Master For possible reasons of changes of NMT Slave states see section NMT State Change Events on page 52 I Packet Structure Reference RK IK IK kk kk kk kk kk kk Ck kk kk kk kk Ck Kk Ck Ck kok kok kok I kk Ck kok kok kok kok kok kok 2 2 Ck kok kok kok kok ck ck ck ck ck ck ck ck ck ok kk type of lt code gt CANOPEN SLAVE NMT STATE CHANGE IND DATA Ttag lt code gt typedef struct CANOPEN SLAVE NMT STATE CHANGE IND DATA Ttag CANOPEN SLAVE NMT STATE CHANGE IND DATA T struct CANOPEN SLAVE NMT STATE CHANGE IND DATA Ttag TLR_UINT32 ulNmtState he Oko kok kok kok kok kok kok kok kok k kk kk I I kk kk kk kk kk kk kk kk k k k k k k k k ck k ck ck ck ck ck 22 22 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE PACKET NMT STATE CHANGE IND Ttag lt code gt typedef struct CANOPEN SLAVE PACKET NMT STATE CHANGE IND Ttag CANOPEN SLAVE PACKET T STATE CHANGE IND T
36. For details on synchronous PDOs see section Process Data Objects PDO on page 61 The part of the CANopen Slave device that provides the SYNC signal is denominated as the SYNC Producer SYNC Consumers are all parts of the Slave which perform synchronized data processing Sync Protocol Sync Producer Sync Consumer s COB ID 128 Request Indication s L 0 no data The Synchronization Event does not transfer any data therefore the signal is transferred within one communication object with a data length of 0 Byte or 1 Byte on the CANopen network The recommended COB ID for the NMT communication object is 128 This is the same value as used in the predefined connection set The object dictionary contains three relevant values concerning the SYNC event The actual value of the COB ID of the SYNC object can be retrieved from object 0x1005 within the object dictionary Object 0x1006 contains the communication cycle time This value represents the time between two subsequent SYNC events this object is not supported by the CANopen Slave V3 protocol stack Object 0x1007 contains the synchronous window length The synchronous window length specifies the time within which the synchronous PDOs may be processed Its value must be CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 60 191 smaller than the applied communication cycle time this
37. Packet Description structure CANOPEN SLAVE PACKET NMT COMMAND IND T Type Indication Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet voId inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unigue number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2932 CANOPEN SLAVE NMT COMMAND IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE NMT COMMAND IND DATA T ulNmtCommand UINT32 Valid NMT Requested NMT command from NMT master command Table 102 CANOPEN SLAVE PACKET NMT COMMAND IND T NMT Command Indication CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 157 191 RK IK IK IK I
38. Reset Communication Sub state Service name Reset Communication See Table 94 NMT States on page 147 for more information concerning this topic The CANopen Slave protocol stack supports this with the following two packets Packet CANOPEN_SLAVE_SET_NMT_STATE_REQ CNF Set NMT State allows your application to set the NMT state and thus to perform these 5 services mentioned above Packet CANOPEN_SLAVE_NMT_STATE_CHANGE_IND RES NMT State Change Indication informs you whenever the NMT Master requests a state change and gives you the possibility to react appropriately CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 50 191 4 4 2 Communication Objects COB IDs and Priority of Processing The CAN standard defines 2048 Communication Objects COBs A COB can contain at maximum 8 bytes of data It represents a unit of data transportation in a CAN network All data transport is done exclusively via COBs Communication Objects provide specific functionalities defined in the CANopen specification such as Process Data Objects Service Data Objects Synchronization Object Emergency Object Time Stamp Object Boot up Object Network Management Objects such as Node Guarding Life Guarding or Heartbeat Objects which will be explained later on in this document In order to uniquely identify the COBs with
39. Send TxPDO Request It acts on the Transmit PDOs TxPDOs and the Read Service The Read Service is implemented by the packets CANOPEN_SLAVE_RECV_RXPDO_REQ CNF Receive RxPDO Request and CANOPEN_SLAVE_RECV_RXPDO_IND RES Receive RxPDO Indication It acts on the Receive PDOs RxPDOs un END_TXPDO_REO E Important note The perspective of view to be applied in this context is that of the CANopen device An IO device acting as CANopen Slave would send its input data via its TXPDOs and receive its output data via its RxPDOs The CANopen Slave protocol stack limits the number of available TXPDOs and RxPDOs to 8 each for Hilscher devices with the netX 10 processor and to 64 each for any other netX based Hilscher devices The numbers and the length of the PDOs are application specific and must be defined in the device s profile CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 63 191 4 4 5 3 Modes of Communication A PDO can be scheduled in three different ways It can be driven By an internal event or an event timer By a remote request Synchronously cyclic or acyclic Modes of Communication Event driven internal event or event timer Producer Consumer s Polling CAN Remote Frame en Consumer s Synchronized cyclic or acyclic SYNC Pronos Consumer s
40. Table 5 Technical Data Slot Number Configuration For configuration of standard mode with default settings by SYCON net configuration software Download or exported configuration file named config nxd by netX Configuration tool For configuration of standard mode with default settings and configured settings and extended mode by packet to transfer configuration parameters Diagnostic Firmware supports common and extended diagnostic in the dual port memory for loadable firmware CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 8 191 1 5 1 1 Technical Data Standard Mode In standard mode the following values and limitations apply Technical Data for default Settings Features Parameter Default number of input data 512 bytes netX 50 100 500 64 bytes netX 10 Default number of output data 512 bytes netX 50 100 500 64 bytes netX 10 Default number of receive PDOs 64 netX 50 100 500 8 netX 10 Default number of transmit PDOs 64 netX 50 100 500 8 netX 10 Table 6 Technical Data Protocol Stack Standard Mode Default Settings Note The EDS files for Hilscher standard products contain the functionality that matches the default settings SYCON net and the netX Configuration tool only configure the default settings Technical Data for configured Settings
41. for details on the Enable mechanism see section 2 3 2 of the netX DPM Interface Manual 7 31 Reserved set to 0 Table 23 Meaning of Communication Change of State Flags Other values are reserved CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 35 191 Communication State All Implementations The communication state field contains information regarding the current network status of the communication channel Depending on the implementation all or a subset of the definitions below is supported UNKNOWN define RCX COMM STATE UNKNOWN 0x00000000 NOT CONFIGURED define RCX COMM STATE NOT CONFIGURED 0x00000001 STOP define RCX COMM STATE STOP 0x00000002 IDLE define RCX COMM STATE IDLE 0x00000003 OPERATE define RCX COMM STATE OPERATE 0x00000004 If the CANopen Slave V3 Protocol Stack is in state PRE OPERATIONAL the communication state is set to IDLE If the CANopen Slave V3 Protocol Stack is in state STOPPED the communication state is set to STOP Communication Channel Error All Implementations This field holds the current error code of the communication channel If the cause of error is resolved the communication error field is set to zero RCX SYS SUCCESS again Not all of the error codes are supported in every implementation Protocol stacks may use a subset of the error codes below SUCCESS define RCX SYS SUCCESS 0x0
42. initialization The parameters of the communication profile are set to their power on values After this has been finished the slave switches to Initialization Sub state and proceeds with the basic initialization actions CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 49 191 The Reset Application sub state provides the possibility to perform the profile initialization The parameters of the manufacturer specific profile area and of the standardized device profile area are set to their power on or default values After this has been finished the slave switches to Reset Communication Sub state The following mapping between the state of the CANopen Slave V3 State Machine and the communication status 0x14 in Common Status is as follows If the CANopen Slave V3 Protocol Stack is in state Pre operational the communication state is set to IDLE If the CANopen Slave V3 Protocol Stack is in state Stopped the communication state is set to STOP If the CANopen Slave V3 Protocol Stack is in state Operational the communication state is set to OPERATIONAL NMT also defines 5 services which allow changing the state to the states Operational Service name Start Stopped Service name Stop Pre operational Service name Enter Pre operational and the following two sub states of state nitialization Reset Application Sub state Service name Reset Node
43. ulCmd UINT32 0x2920 CANOPEN SLAVE RECV TIME STAMP IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN_SLAVE_RECV_TIME_STAMP_IND_DATA_T ulMilliseconds UINT32 0 86 399 999 Milliseconds part of time stamp number of milliseconds that have occurred since last midnight usDays UINT16 0 65535 Days part of time stamp number of days that have occurred since January 1 1984 Table 79 CANOPEN_SLAVE_PACKET_RECV_TIME_STAMP_IND_T Receive Time Stamp Indication CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 127 191 kok kok kok kok kok kok kok kok kok kok kok kok I kk kk kk kk kk kk kk kk k k k k k k ok ck ck ck ck ck ck ck ok ke type of lt code gt CANOPE typedef struct CANOF CANOP struct CANOP TLR_PACKE N SLAVE_PACKE IARC WIE UMD STAMP_RES_Ttag lt code gt PF NS AVE PACKET RE CVS AV ESA EN SLAVE PAC KET RE CV IME_STA PERESA EN_SLAVE PACKE ID INE We Mis STAMP_R TS eeu VEE AD ER T tHead packet header V RK IK IK
44. 0 2774 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2904 CANOPEN_SLAVE_SLAVE_REQ Command ulExt UINT32 0 Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN SLAVE INITIALIZE REO DATA T ulReserved UINT32 0 Reserved for further use set to zero Table 56 CANOPEN SLAVE PACKET INITIALIZE REO T Initialization of CANopen Slave Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference RK IK IK IK KK kok kok kok kk EZ EZ kk kk kk kok kk kk kk kk kk kk kk kk kk kk kk k k k k k I 2 2 2 2 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE INITIALIZE CNF DATA Ttag lt code gt typedef struct CANOPEN SLAVE INITIALIZE CNF DATA Ttag CANOPEN SLAVE INITIALIZE CNF DATA T Structure of task command delete configuration
45. 2 1 CANOPEN_SLAVE_REGISTER_REQ CNF Register Application eee eee 87 5 2 2 CANOPEN_SLAVE_STARTSTOP_REQ CNF Start Stop CANopen Network 90 5 2 3 CANOPEN SLAVE INITIALIZE REQ CNF Initialization of CANopen Slave 93 5 2 4 CANOPEN SLAVE EXCHANGE DATA REQ CNF Exchange Data eee 96 5 2 5 CANOPEN SLAVE STATE CHANGE IND RES Change of Task State Indication 100 5 2 6 CANOPEN SLAVE SEND EMCY REQ CNF Send Emergency Message nennen 106 5 2 CANOPEN SLAVE SEND EMCY IND RES Emergency Message Indication 110 5 2 8 CANOPEN SLAVE SET NMT STATE REQ CNF Set NMT State eee 5 2 9 CANOPEN SLAVE SET BUSPARAM REQ CNF Set Bus Parameters sse 5 2 10 CANOPEN SLAVE SEND TIME STAMP REQ CNF Send Time Stamp 5 2 11 CANOPEN SLAVE RECV TIME STAMP IND RES Receive Time Stamp Indication 125 5 2 12 CANOPEN SLAVE SEND TXPDO REO Send TxPDO Request sse 128 5 2 13 CANOPEN SLAVE RECV RXPDO REQ CNF Receive RxPDO Request ee 131 5 2 14 CANOPEN SLAVE RECV RXPDO IND RES Receive RxPDO Indication 135 5 2 15 CANOPEN SLAVE SET EVENTS INDICATED REQ CNF Set Events Indicated Request 138 5 2 16 CANOPEN SLAVE GET IO INFO REQ CNF Get I O Info sess 142 5 2 17 CANOPEN SLAVE SET API PARAM REQ CNF Set API Parameter
46. 2 3 1 Communication via Mailboxes The mailbox of each communication channel has two areas that are used for non cyclic message transfer to and from the netX Send Mailbox Packet transfer from host system to firmware Receive Mailbox Packet transfer from firmware to host system For more details about acyclic data transfer via mailboxes see section 3 2 The concept of using messages called packets in this context is described in detail in section 3 2 1 General Structure of Messages or Packets for Non Cyclic Data Exchange while the possible codes that may appear are listed in section 3 2 2 Status amp Error Codes However this section concentrates on correct addressing the mailboxes CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 16 191 2 3 2 Using Source and Destination Variables correctly 2 3 2 1 How to use ulDest for Addressing rcX and the netX Protocol Stack by the System and Channel Mailbox The preferred way to address the netX operating system rcX is through the system mailbox the preferred way to address a protocol stack is through its channel mailbox All mailboxes however have a mechanism to route packets to a communication channel or the system channel respectively Therefore the destination identifier u Dest in a packet header has to be filled in according to the targeted receiver See the following example 0x20 0x
47. 2013 The Application Interface 169 191 Packet Structure Reference SLAVE_PACKET_RECEIVE_PDO_RES_Ttag RECEIVE PDO RES T typedef struct CANOPEN CANOPEN SLAVE PACKET struct CANOPEN SLAVE PACKET RECEIVE PDO RES Ttag TLR_PACKET_HEADER_T tHead packet header Sy Packet Description Structure Information CANOPEN_SLAVE_PACKET_RECEIVE_PDO_RES_T Type Response Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle of CANopen slave Task Process Queue ulSrc UINT32 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x000029BD CANOPEN SLAVE RECEIVE PDO RES Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Informat
48. As long as the PDO exists this is indicated by bit 31 of subindex 1 of the PDO s index being 0 this value must not be changed any more The Event Timer For asynchronous TxPDOs i e such event driven TxPDOs with transmission types 254 and 255 additionally an Event Timer can be set Values are specified in units of 1 ms If the specified time has elapsed this will be considered as an event and will therefore cause the PDO to be transmitted CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 66 191 The Inhibit Time may specify the earliest time transmission can take place and similarly the Event Timer may specify the latest time transmission can take place This allows to set up a virtual transmission window for the timely execution of the TxPDO s transmission in case of asynchronous This feature can be used for reducing bus load 4 4 5 8 Communication Parameters In the object dictionary there is a PDO communication parameter assigned to each PDO It describes the communication behaviour of the PDO The communication parameter can be found at 0x1400 0x15FF 0x1400 for the first RxPDO 0x1800 0x19FF 0x1800 for the first TxPDO The next PDO has an index which is increased by one and so forth The communication parameter has the following content Index Subindex Description Data Type 0x1400 0x00
49. CAN DL Task A receive filter for the COB IDs can be defined CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 81 191 ul29BitMask Here it is possible to define the bits the filter uses In other words All bits currently not set will not be filtered out ul29BitCode Those are the bits set to filter the IDs Those bits must have the value 1 in the acceptance code and the reaching COB ID to pass the filter If a bit is not set in the Acceptance Mask the filter will pass the message anyway Packet Structure Reference BKK KK kk kk kk kk kk kk kk kk kk kk kk kk 2 2 kk kk 2 2 2 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 22 22 22 22 22 22 22 22 2073 type of lt code gt CANOPE SLAVE STD BUSPARAM DATA Ttag lt code gt typedef struct CANOPEN SLAVE STD BUSPARAM DATA Ttag CANOPEN SLAVE STD BUSPARAM DATA T type of lt code gt CANOPEN SLAVE EXT BUSPARAM DATA Ttag lt code gt typedef struct CANOPEN SLAVE EXT BUSPARAM DATA Ttag CANOPEN SLAVE EXT BUSPARAM DATA T type of lt code gt CANOPE SLAVE BUSPARAM DATA Ttag lt code gt typedef struct CANOPEN SLAVE BUSPARAM DATA Ttag CANOPEN SLAVE BUSPARAM DATA T struct CANOPEN SLA
50. DATA T typedef RCX GET FW PARAMETER CNF Ttag abParameter ulParameterLen TLR PACKET HEADER T tHead packet header RCX_GET_FW_PARAMETER_CNF_DATA_T tData packet data RCX_GET_FW_PARAMETER_CNF_T Packet Description structure RCX_GET_FW_PARAMETER_CNF_T Type Confirmation Area Variable Type Value Range Description Head Structure TLR PACKET HEADER T ulDest UINT32 Destination gueue handle do not touch ulSrc UINT32 Source Queue Handle do not touch ulDestId UINT32 O Destination End Point Identifier Not in use set to zero for compatibility reasons ulSrcId UINT32 0 2 4 Source End Point Identifier do not touch ulLen UINT32 8 n Packet data length in bytes ulld UINT32 0 2 4 Packet identification untouched ulSta UINT32 Error code Either TLR S OK or TLR E FAIL ulCmd UINT32 Ox2F89 RCX GET FW PARAMETER CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 x Routing do not touch Data structure RCX GET FW PARAMETER REO DATA T ulParameterlD UINT32 0 OxFFFFFFFF The number of used hardware switches ulParameterLe UINT32 See below Length of the parameter in bytes n abParameter UINT8 Parameter Value as a byte array Table 120 RCX_GET_FW_PARAMETER_CNF Get Firmware Para
51. Number of entries Unsigned8 Ox1SFF 0x01 CANopen identifier COB ID Unsigned32 RxPDO or 0x1800 0x02 Transmission Type Unsigned8 Ox19FF 0x03 Inhibit Time Unsigned16 TxPDO 0x04 Reserved Unsigned8 0x05 Event Timer Unsigned16 Table 35 PDO Communication Parameter CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 67 191 4 4 5 9 PDO Mapping The PDOs provide the interface to the application objects They are assigned to the entries in the object dictionary The process of assignment is denominated as PDO mapping and is practically accomplished via a specific mapping structure in the object dictionary This mapping structure can be found at 0x1600 0x17FF 0x1600 for the first RxPDO Ox1A00 0x1BFF 0x1A00 for the first TxPDO a a ee Ls 58 Te EES EEE ug Figure 14 PDO Mapping Figure 14 PDO Mapping explains the relationship between object dictionary left upper part PDO mapping structure right upper part and the resulting PDO containing the application objects to be mapped lower part One entry in the PDO mapping table reguires 32 bit It consists of 16 bit containing the index of the object dictionary entry containing the application object to be mapped 8 bit containing the subindex of the object dictionary entry containing the application object to be mapped 8 bit containing the length information The PDO
52. PACKET SEND TIME STAMP REO Ttag TLR PACKET HEADER T tHead packet header S CANOPEN SLAVE SEND TIME STAMP REO DATA T tData packet request data s kk k kk ok kok kok kok kok kok kok kok kok kok kok kok kok 2 Ck k kok k 2 kok k kk kk kk kk kk k ck kckck ck k ck k ck k ck k k k k k ok sk ok ke CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 123 191 Packet Description structure CANOPEN SLAVE PACKET SEND TIME STAMP REQ T Type Reguest Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle QUE_CANOPEN SLV ulSrc UINT32 0 277 4 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 6 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ul
53. Public Hilscher 2011 2013 Getting Started 4 5 5 72 191 Object Dictionary with Firmware Functionality The following contains a list of object dictionary entries with Firmware Functionality These should be exactly the ones mentioned within the EDS file Only these object dictionary entries can be managed by the CANopen Slave V3 Protocol Stack However this is done in a quite different manner in Standard Mode and in Extended Mode In Standard Mode all these entries are created by the CANopen Slave by default and are available They may not be deleted In Extended Mode these entries will be supported by the firmware if you create them manually using the ODV3 capabilities object create write It does not make sense to create other entries of the communication profile unless you completely implement the functionality of such an entry on your own Now this is the list of object dictionary entries with firmware functionality Index of Object Name of Object Comment 0x1000 Device type This object is mandatory 0x1001 Error register This object is mandatory 0x1005 COB ID SYNC Consumer only 0x100C Guard Time 0x100D Life Time Factor 0x1012 COB ID Time Stamp Producer and consumer 0x1014 COB ID EMCY Producer 0x1015 Inhibit time Emergency 0x1016 Heartbeat Consumer Entries Contains up to 64 entries 0x1017 Producer Heartbeat Time 0x1018 Identity Object This object i
54. RECV RXPDO REO T Receive RxPDO Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 134 191 Packet Structure Reference RK IK IK kk kok kok kok kok kok kok kok kok kok kok kok k kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k ok ck ok ck ok ko ke type of lt code gt CANOPEN SLAVE RECV RXPDO CNF DATA Ttag lt code gt typedef struct CA CANOPEN SLAVE RE OPEN SLAVE RECV RXPDO CNF DATA Ttag EVER SED OREN KR IDE define CANOPEN_SI struct CANOPE AVE_RECV_RXPDO_REO_MAX 16 SLAVE_RECV_RXPDO_CNF_DATA_Ttag TLR_UINT32 aulRecvRxPdoResult CANOPEN_SLAVE_RECV_RXPDO_REQ_MAX kk kk kok kok kok kok kok kok kok kok kok k k Ck 2 kok k kk kk kk kk kk kk kk kk kk kk kk kk k ck k k k k k k k k ok ck ok ke e type of lt code gt CANOPEN SLAVE PACKET RECV RXPDO CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET RECV RXPDO CNF Ttag CANOPEN SLAVE PACKET RECV RXPDO CNF T SLEUCE LANOB TLR_PACKET_HEADE CANOPEN_SLAVE_RE he EN_SLAVE_PACKET_RECV_RXPDO_CNF_Ttag RAT tHead packet header CV_RXPDO_CNF_DATA_T tData packet d
55. SDO functionality of the ODV3 Task for accessing the object dictionary The packet interface of the Object Dictionary V3 is described within a separate manual the Object Dictionary V3 Protocol API Manual See reference 4 The following packets of Object Dictionary V3 can be used without any restrictions ODV3 READ OBJECT REO DV3 WRITE OBJECT REO DV3 GET OBJECT LIST REO DV3 GET OBJECT INFO REO DV3 GET SUBOBJECT INFO REO DV3 GET OBJECT ACCESS INFO REO DV3 GET OBJECT SIZE REO DV3 READ OBJECT NO IND REO DV3 GET OBJECT COUNT REO DV3 WRI DV3 READ ALL BY INDEX REO DV3 WRITE MULTIPLE PARAMETER BY INDEX REO DV3 READ MULTIPLE PARAMETER BY INDEX REO DV3 GET TIMEOUT REO H E ALL BY INDEX REO OO O OD veu QOO x ue CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 182 191 The following packets of Object Dictionary V3 will be denied as long as the Configuration Lock flag is set ODV3 CREATE OBJECT REO DV3 CREATE SUBOBJECT REO DV3 DELETE OBJECT REO DV3 DELE BOBJECT REO DV3 RE OBJECT NOTIFY REO DV3 UN R OBJECT NOTIFY REO DV
56. STATE CHANGE RES T Type Response Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x292F CANOPEN SLAVE NMT STATE CHANGE RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 96 CANOPEN SLAVE PACKET NMT STATE CHANGE RES T Response to NMT State Change Indication CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 150 191 5 2 19 CANOPEN SLAVE ERR CTRL EVENT IND RES Error Control Event Indication In a CANopen network the Master supervises the error control of the entire network and is aware of all changes of
57. Set Warmstart Parameter Confirmation CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 85 191 5 2 The CANopen Slave Task To get the handle of the process queue of the CANopen slave task the Macro TLR_QUE_IDENTIFY needs to be used ASCII queue name Description QUE_CANOPENSLV Name of the CANopen slave task process queue QUE_COS_ODV3 Name of the CANopen slave Task ODV3 process queue Table 50 CANopen Slave Task Process Queue The returned handle has to be used as value ulDest in all request packets to be sent to the CANopen slave Task This handle is the same handle that has to be used in conjunction with the macros like TLR QUE SENDPACKET FIFO LIFO for sending a packet to the CANopen slave Task Restrictions of Usage of Packets concerning LOM and LFW The CANopen Slave Protocol Stack V3 supports two different application situations Loadable Firmware LFW Linkable Object Modules LOM Not all packets can be applied without any restrictions in both models Some packets only make sense for one of these application situations or cannot be executed when the Configuration Lock flag is set This section informs about these restrictions of usage The following packet of the CANopen Slave Task is only available for working with Linkable Object
58. Stop for affected node with ID ulNodeId 4 CANOPEN SLAVE LIFE GUARD STARTED Lifeguard Start for affected node with ID 0 5 CANOPEN SLAVE LIFE GUARD ERROR Lifeguard Error for affected node with ID 0 6 CANOPEN SLAVE LIFE GUARD STOPPED Lifeguard Stop for affected node with ID 0 Table 98 Possible Values of ulEvent and their Meanings CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 151 191 Packet Structure Reference RK kk ok ok I kok kok kok kok kok kok kok kok kok kok kok kok k kk kk kk kk kk kk kk kk kk kk k ck k ck k ck k k k k I 2 2 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE ERR CTRL EVENT IND DATA Ttag lt code gt typedef struct CANOPEN SLAVE ERR CTRL EVENT IND DATA Ttag CANOPEN SLAVE ERR CTRL EVENT IND DATA T type of lt code gt CANOPEN SLAVE ERR CTRL EVENT Ttag lt code gt typedef struct CANOPEN SLAVE ERR CTRL EVENT Ttag CANOPEN SLAVE ERR CTRL EVEN 5 define CANOPEN_SLAVE_MAX_ERR_CTRL_EVENT 16 define CANOPEN SLAVE HEARTBEAT STARTED 0x00000001L define CANOPEN SLAVE HEARTBEAT ERROR 0x00000002L define CANOPEN SLAVE HEARTBEAT STOPPED 0x00000003L define CANO define CANO define CANO XJ
59. Type Indication Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSrc UINT32 Source Queue Handle of CANopen slave Task Process Oueue ulDestId UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet VOId inside the Source Process ulLen UINT32 12 20 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x000029BC CANOPEN SLAVE RECEIVE PDO IND Indication ulExt UINT32 O Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN_SLAVE_RECEIVE_PDO_IND_DATA_T ulPdoNumber UINT32 1 255 Number of received PDO ulIdentifier UINT32 0 2047 Identifier COB ID of received PDO ulLength UINT32 0 8 Length of received PDO abPdoData 8 UINT8 8 Data of received PDO Table 110 CANOPEN SLAVE PACKET RECEIVE PDO IND T Receive PDO Indication CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011
60. a kok kk kok kok kok kok kok kok kok kok kok k kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk ck ck k ck k ck k k ck ck ck ck ck ck ok ck ck ck ok ck ok ke e CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Description 97 191 Structure Information CANOPEN_SLAVE_PACKET EXCHANGE DATA REO T Type Reguest Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle of CANopen slave Task Process QUE CANOPEN Queue SLV ulSrc UINT32 0 2 1 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 24 279 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x290A CANOPEN_SLAVE_EXCHANGE_DATA_REQ Command ulExt UINT32 O Reserved ulRout UINT
61. for Send Data 0x90 unsigned long aulAddDetail 3 Additional detail for diagnostic entry Table 25 Additional Info Block CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory ulFlags 39 191 This variable is organized as a bit field as described in the table below Bit Name Description D31 Reserved Reserved for further use D17 D16 CANOPEN_SLAVE_EXT_STATE_ A warning has been issued FLAG_WARNING D15 Reserved Reserved for further use D14 CANOPEN_SLAVE_EXT_STATE_ The DEVICE has detected an overstepped timeout supervision time TIMEOUT of at least one CAN message to be sent The transmission of this message was aborted The data is lost Its an indication that no other CAN device was connected or responsive at this time to acknowledge the sent message requests The bit will be set when the first timeout was detected and will not be deleted any more D13 CANOPEN SLAVE EXT STATE Indicates if the HOST program has set its state to operative or not NRDY If the bit is set the HOST program is not ready to communicate D12 CANOPEN SLAVE EXT STATE Parameterization error or severe run time error CTRL D11 Reserved Reserved for further use D10 D9 CANOPEN SLAVE EXT STATE An error has been issued from the slave FLAG SLAVE ERROR D8 CANOPEN SLAVE EXT STATE Watchdog err
62. kk kk KK ok kok kok kok kok kok kok kok kok kok kok k kk kk k kok k kk kk 2 kk kk kk kk kk k k k k k I 2 2 Packet Description structure CANOPEN SLAVE PACKET RECV TIME STAMP RES T Type Response Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Aueue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of V0OId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2774 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2921 CANOPEN_SLAVE_RECV_TIME_STAMP_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 80 CANOPEN_SLAVE_PACKET_RECV_TIME_STAMP_RES Response to Receive Time Stamp Indication CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 128 191 5 2 12 CANOPEN SLA
63. kk kk kk k kk kk kk kk k k kk k k k k k k KR type of lt code gt CANOPEN APS PCK GET STATE CNF Ttag lt code gt typedef struct CANOPEN APS PCK GET STATE CNF Ttag CANOPEN APS PCK GET STATE CNF T struct CANOPEN APS PCK GET STATE CNF Ttag Get state confirmation TLR_PACKET_HEADER_T tHead packet header CANOPEN APS GET STATE CNF DATA T tData SSD aAckctem Garza 27 KK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk KR Packet Description Structure Information CANOPEN APS PCK GET STATE CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSSOId Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched vOld ulLen UINT32 8 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 1 1 Codes of the CANopen APS Task ulCmd UINT32 0x00002E03 CANOPEN_APS_GET_STATE_CNF Command ulExt UINT32 O Extension not in use set to zero for compatibility reaso
64. mapping table can at maximum contain 8 of such entries therefore the number of application objects in one PDO is also limited to 8 CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 68 191 4 5 Standard Mode vs Extended Mode The CANopen Slave V3 Protocol Stack can be configured in two different modes Standard Mode Object based DPM content Extended Mode PDO based DPM content 4 5 1 How to decide between Operation in Standard Mode and Extended Mode The choice of the mode has a large influence on the behavior the internal operation and the configuration facilities of the stack The choice which one of these to use should be made according to the following rules Standard Mode 1 f your intention is to run existing applications from CANopen Slave Stack V2 you should definitely decide to use Standard Mode Running existing applications with only slight changes is possible as Standard Mode offers a high degree of compatibility to the CANopen Slave Stack V2 2 Also if you want to avoid having to fill in larger amounts of objects into the object dictionary it is recommended to use the Standard Mode Extended Mode On the other hand it is recommended to use the Extended Mode if you want to implement a complete device profile if you want to work with an object dictionary of your own if you want to map objects which had been added to the objec
65. not yet flags supported Using this parameter you can set the status of the input or the output data For each input and output date the following status information in byte is stored in the dual port memory The bits have the following meaning Bit 1 I O Status Enable 0 Status disabled 1 Status enabled not yet supported Bit 2 I O Status 8 32Bit 0 1 Byte mode not yet supported 1 4 Byte mode not yet supported BIT 3 31 Reserved for further use set to zero Address Switch This parameter is represented by bit 4 of the system flags 0 off 1 on It must be set when hardware address switch is used and there is no TAG present Baudrate Switch This parameter is represented by bit 5 of the system flags 0 off 1 on It must be set when hardware baudrate switch is used and there is no TAG present Watchdog Time Watchdog time within which the device watchdog must be 0 20 65535 ms 0 Off ms retriggered from the application program while the application program monitoring is activated When the watchdog time value is equal to 0 respectively the application program monitoring is deactivated Node ID Node ID of CANopen slave Allowed values 1 127 CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 44 191 Getting Started BIT 0 29 BIT IDENTIFIER DISABLED ENABLED Not supported yet se
66. object is not supported by the CANopen Slave V3 protocol stack The SYNC Event is related to the working with synchronous PDOs see section 4 4 5 4 Synchronous vs asynchronous Data Transmission on page 64 4 4 4 7 Emergency Event EMCY Table 33 Emergency Protocol The parameters are transferred within one communication object on the CANopen network The NMT communication object is usually assigned to a COB ID in the range between 129 and 255 It delivers E An emergency error code Anerror register 5 bytes of manufacturer specific error information The Emergency Event EMCY is related to the following packets of the CANopen Slave protocol stack CANOPEN SLAVE SEND EMCY REQ CNF Send Emergency Message allowing you to send an emergency telegram from your application to any consumer within the CANopen network CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 61 191 4 4 5 Process Data Objects PDO Process Data Objects short PDO provide the fastest way for data transmission in CANopen One single PDO can be considered as a segment of the whole process data with a length of 8 Bytes On low level CAN DL each PDO is transmitted as a single CAN telegram and the length of CAN telegrams is limited to 8 Bytes Due to this fact there is an 8 byte limit of the PDO length One of the most important advantages of the PDO concept is that PDO
67. of Change 4 lt 444 e4e4r224eeeee224 4000 eee KKK KERR KK RKK ER KR E EKK RK EKK 33 Table 23 Meaning of Communication Change of State Flags lt eeeaeeeeeeaaeeeseneeeeeeaeeeeeaeeeeneeeeeeeaa 34 Table 24 Extended Status Block General Structure sssssssseee eene nennen nennen nennen 37 Table 25 Additional Info BIOCICa uiii een dn ako sauna E Nea neon D e anase aeae ei daea 38 Table 26 Additional Info Flags 2 irre titer RI Peel Der e Do tete e tein t doxes 39 Table 27 Communication Control Block ainin esien iiei eddau rade deiei ie tisadi endea isete iieiea tiei dakai 41 Table 28 Overview about essential Functionality Cyclic and acyclic Data Transfer and Alarm Handling 42 Table 29 Meaning and allowed Values for Configuration Parameters lt lt lt een 44 Table 30 Objects of the Predefined Connection Set seen from Point of View of the D8ViCE lt lt 51 Table 31 COB IDs with Restrictions of USe 2 2 eee eeaeceeeeeeeeeaaeceeeeeseseeaaeaeeeeesesecaaeeeeeeseseecaeaeeeeeeeeeenenaeees 51 Table 32 NMT States nen cage d va sn sda n RN du a Renard Ea Ee chee dnd Han Ener sagen VALE EK deestendteedeeeaennsteecden ds 58 Table 33 Emergency Protocols E 60 Table 34 PBO Transmission Types etre ete ep tete ei en ERS 65 Table 35 PDO Communication Parameter
68. of the variable ulNmt State which may have the values described in the following table Value Symbolic Name Meaning 1 CANOPEN_SLAVE_SE STATE_OPERATIONAL Operational 2 CANOPEN_SLAVE_SE STATE_STOP Stop 128 CANOPEN_SLAVE_SE STATE_PRE_OPERATIONAL Pre operational 129 CANOPEN_SLAVE_SE STATE_RESET_NODE Reset node 130 CANOPEN_SLAVE_SE STATE_RESET_COMM Reset communication Table 72 NMT States The value 1 for Operational is only supported for compatibility reasons However according to the CANopen specification only the NMT Master is allowed to set the NMT state to Operational Packet Structure Reference KKK KK kk IK I I I kk kk I kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k ck ck ck ck A 22 I 22 ck sk type of lt code gt CANOPEN SLAVE SET NMT STATE REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE SE T STATE REO DATA Ttag CANOPEN SLAVE SET NMT STATE REO DATA T define CANOPEN SLAVE SET NMT STA OPERATIONAL 0x00000001L define CANOPEN SLAVE SET NMT STATE STOP 0x00000002L define CANOPEN SLAVE SET NMT STA PRE OPERATIONAL 0x00000080L define CANOPEN SLAVE SET NMT STA RESET
69. output side 30xx Voltage 31xx Main voltage 32xx Voltage inside the device 33xx Output voltage 40xx Temperature 41xx Ambient temperature 42xx Device temperature 50xx Device hardware 60xx Device software 61xx Internal software 62xx User software 63xx Data set 70xx Additional modules 80xx Monitoring 81xx Communication 8110 CAN overrun objects lost 8120 CAN in Error Passive Mode 8130 Life Guard Error or Heartbeat Error 8140 Recovered from bus off 8150 Transmit COB ID collision 82xx Protocol error 8210 PDO not processed due to length error 8220 PDO length exceeded 90xx External error FOxx Additional functions FFxx Device specific Table 64 Emergency Error Codes Variable usErrorCode CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 107 191 The bits of the error register bErrorRegister have the following meaning Error Code CANOPEN_SLAVE_ERROR_REGISTER_GENERIC_BI 0x01 CANOPEN_SLAVE_ERROR_REGISTER_CURRENT_BI 0x02 CANOPEN_SLAVE_ERROR_REGISTER_VOLTAGE_BI 0x04 CANOPEN_SLAVE_ERROR_REGISTER_TEMPERATURE_BI 0x08 CANOPEN_SLAVE_ERROR_REGISTER_COMM_ERROR_BIT 0x10 CANOPEN_SLAVE_ERROR_REGISTER_DEV_PROFILE_BI 0x20 CANOPEN_SLAVE_ERROR_REGISTER_RESERVED_BIT
70. packet VOId inside the Source Process ulLen UINT32 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x292D CANOPEN SLAVE SET API PARAM CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE SET API PARAM CNF DATA T hSlave TLR HA Slave Handle see TLR Manual NDLE Table 93 CANOPEN SLAVE PACKET SET API PARAM CNF T Confirmation to Set API Parameter Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 147 191 5 2 18 CANOPEN SLAVE NMT STATE CHANGE IND RES NMT State Change Indication This packet indicates a change in the CANopen Slave s own NMT State Machine The new state is delivered with the indication packets ulNmt State variable The relation between the values and the states is as follows Value Symbolic Name State Sub state 1 CANOPEN_SLAVE STATE_OPERATIONAL Operational 2 CANOPEN_SLAVE STATE_STOP Stop 128 CANOPEN SLAVE STATE PRE OPERATIONAL Pre operational 129 CANOPEN SLAVE STATE RESE ODE Initialization Reset Node
71. state Pre operational is reached automatically In Pre operational state No PDO communication is allowed SDO communication is allowed this allows configuration and parameterization Switching from Pre operational state to Operational state and vice versa is done by the NMT Master In Operational state PDO communication is allowed SDO communication is allowed Access to the Object Dictionary CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 48 191 In Stopped state PDO communication is stopped SDO communication is stopped No access to the Object Dictionary possible Further services are also stopped Time stamp EMCY SYNC However if active Node Guarding or life guarding will be continued The Initialization State can be subdivided into 3 sub states in order to enable a complete or partial reset This is illustrated by Figure 8 Initialization State below Reset Communication Initialization Pre Operational Figure 8 Initialization State of NMT Slave The Initialization Sub state red rectangle in Figure 8 performs the basic initialization actions After power on exactly this state is reached and automatically these actions are performed When all actions are performed the slave finally reaches the Pre operational state The Reset Communication Sub state provides the possibility to perform the basic device
72. that the NMT Master requests a change of the Slave s NMT state The NMT Command Event service allows to NMT State change requests from the CANopen Master to one or more CANopen Slaves using the NMT Protocol In terms of the Producer Consumer Model a CANopen Slave acts within a push model as a consumer The CANopen Master acts as producer When receiving an NMT command request the application should react in the following manner Determine which service needs to be executed Execute requested service Send response packet For determining which service should be executed the value of variable ulNmt Command must be evaluated according to the following table Value Requested Service Action to take 1 Start CANopen Slave Set state to Operational 2 Stop CANopen Slave Set state to Stopped 128 Enter state Pre operational Set state to Pre operational 129 Reset node Set state to Initialising sub state Reset node 130 Reset communication Set state to nitialising sub state Reset communication Table 32 NMT States If the application has been previously registered for this event the automatic switching to the new state will be inhibited For switching to the new local NMT state the application is responsible exclusively You can then use the new local NMT state of the CANopen Slave after service execution as value for parameter ul Nmt State in the response packet If the application has not been registe
73. the error control state Additionally it even shares this knowledge with the slaves by informing these on the most current changes This is exactly done with the indication packet CANOPEN_SLAVE_ERR_CTRL_EVENT_IND described here which indicates the occurrence of one or more Error Control Event s i e changes of the error control state within the entire CANopen network and informs the CANopen Slave Error Control Events allow detecting errors within the CAN network They include the following types of events occurring at the slave described in the CANopen Specification CiA Draft Standard 301 subsection 9 2 6 1 2 Life Guarding Event Heartbeat Event For each change of a node s error control state there is an entry in the array of structures atErrCtrlEvent 16 Each array element contains the following structure Name Meaning Data type Range of Values ulEvent Type of event that has happened UINT32 1 6 ulNodeId Node ID UINT32 1 127 Table 97 Array Elements of atErrCtrlEvent 16 The meaning of the values of ulEvent is defined as follows Value Symbolic Name Meaning 1 CANOPEN_SLAVE_HEARTBEAT_STARTED Heartbeat Start for affected node with ID ulNodeId 2 CANOPEN_SLAVE_HEARTBEAT_ERROR Heartbeat Error for affected node with ID ulNodeId 3 CANOPEN SLAVE HEARTBEAT STOPPED Heartbeat
74. tion PEN_SLAVE LLBACK FAR PFN CANOP EN SLAVE CALLBACK ET_API_PARAM_CNF_DATA_Ttag E hSlave N SLAVE PACKET SE API PARAM CNF Ttag lt code gt P ENES AVE PACKET S Sur ger Jew CINE Iie iG CANOP EN SLAVE PAC KES EAP JE 19A RAM CNF T struct CANOP EN SLAVE PACKE Tee SH eA PI_PARAM_CNF_Ttag ER JP VNCIK T HEADE RTI CANOP EN SLAVE SE LANDE PARAM_CNF_DATA_T tData s tHead packet header packet confirmation data Jg KKK IK IK kk kk kk kk kk kk Ck Ck kk I kok k kk kk kk kk kk kk Ck kk kk kk kk kk kk kk kk ck ck ck ck ck ck ck ck ck ck ok ck ok ck ok ck ok ko ke Packet Description structure CANOPEN SLAVE PACKET SET API PARAM CNF T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the
75. to zero Flags tStdBusParam or c ExtBusParam union Depending on BIT 29 either standard bus parameter structure BIT 29 0 or extended bus parameter structure BIT 29 1 see below ul29BitCode UINT32 29Bit Acceptance Code ul29BitMask UINT32 29Bit Acceptance Mask Table 45 Bus parameter structure CANOPEN_SLAVE_BUSPARAM_DATA_T CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 79 191 The variable ulSlaveNodeld indicating the node ID of the CANopen slave is required for the addressing of the device at the bus and has to be unique in the network Therefore it is not allowed to use this number two times in the same network Allowed values range from 1 to 127 The baud rate of the CANopen network can be set using the ulBaudRate variable The settings listed in the following table are applicable Value Corresponding Baud Rate of CANopen Network 0 1 MBaud 1 800 KBaud 2 500 KBaud 3 250 KBaud 4 125 KBaud 5 100 KBaud this value is officially not defined in the CAN specifications 6 50 KBaud 7 20 KBaud 8 10 KBaud 255 Auto Detection Table 46 Codes and Corresponding Baud Rates of CANopen Network The standard bus parameter structure CANOPEN_SLAVE_STD_BUSPARAM DATA T and the extended bus parameter structure CANOPEN_SLAVE_EXT_BU
76. ulDest UINT32 Destination Queue Handle of AP Task Process Queue ulSrc UINT32 Source Queue Handle of CANopen slave Task Process Oueue ulDestId UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet VOId inside the Source Process ulLen UINT32 112 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2912 CANOPEN_SLAVE_STATE_CHANGE_IND Command ulExt UINT32 0 Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN SLAVE STATE CHANGE IND DATA T tSlaveState CANOPEN SLAVE Structure for slave state see explanation below SLAVE STATE tExtended CANOPEN SLAVE Structure for extended slave state see explanation below State EXTENDED STATE T Table 60 CANOPEN SLAVE PACKET STATE CHANGE IND T Change of State Indication CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface CANopen Slave State Structure Reference
77. ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2934 CANOPEN_SLAVE_GET_BUSPARAM_REO Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 104 CANOPEN_SLAVE_PACKET_GET_BUSPARAM_REQ_T Get Bus Parameters Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 159 191 Packet Structure Reference RK IK IK IK IK kok kok kok kok kok kok kok kok kok kok kok I I k kok kk kk kk kk kk kk kk kk kk k k k k ck ck ok sk ok ke ek f struct CANOPEN SLAVE STD BUSPARAM DATA Ttag TLR UINT32 ulVendorId Vendor ID TLR UINT32 ulProductCode Product code ay TLR_UINT32 ulSerialNumber Serial number TLR UINT32 ulRevisionNumber Revision number TLR UINT32 ulDeviceType Device Type if DERM TSD OD ECC20 00 S2E AS z iC OE Tos cose 210 00 7 TLR_UINT8 bObject2001Size fe Siza OE OEC 2001 e TLR UINT8 bObject2002Size fe Size wie elojeeec 2002 Rf MERSU EN ie OS ECC20 SSZ EAS 12 Ca oia Te cose 0103 A TUR ULNIS JefOy jecc220suigers 7 Size gu qoio9jesci 2200 a7 TLR UINT8 bObject2201Size fe Siza CGlojece 2201 TLR UINT
78. ulTxOverflowCnt LR UINT32 ulReserved LR UINT32 ulTimeoutCnt LR UINT32 aulReserved 4 LR UINT32 ulDiagInfoCount LR UINT32 ulLastDiagInfo LR UINT32 ulMaxRecvIdx LR UINT32 ulMaxSendIdx EIS ONE 32 aulAddDetail CANOPEN SLAVE ADD DETAIL SIZE CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 38 191 3 3 2 1 Extended Status Block Additional Info Block for CANopen Slave Offset Type Name Description 0x50 unsigned long ulFlags Bit field for Flags 0x54 unsigned long ulNodeState Current Node State 0x58 unsigned long ulBusOffEveCnt Counter for bus off events Ox5C unsigned long ulErrorPassiveEveCnt Counter for passive event errors 0x60 unsigned long ulRxOverflowCnt Counter for receive overflows 0x64 unsigned long ulTxOverflowCnt Counter for transmit overflows 0x68 unsigned long ulErrorWarningCnt Count of errors and Warnings Ox6C unsigned long ulTimeoutCnt Number of timeouts 0x70 unsigned long aulReserved 3 Reserved for further use 0x7C unsigned long ulIndLostCnt Count of Lost Indications 0x80 unsigned long ulDiagInfoCount Number of diagnostic entries 0x84 unsigned long ulLastDiagInfo Last diagnostic entry 0x88 unsigned long ulMaxRecvIdx Maximum Object Index Value for Receive Data Ox8C unsigned long ulMaxSendIdx Maximum Object Index Value
79. 0 Released Public Hilscher 2011 2013 The Application Interface 152 191 Packet Description structure CANOPEN_SLAVE_PACKET_ERR_CTRL_EVENT_IND_T Type Indication Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet vold inside the Source Process ulLen UINT32 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2930 CANOPEN_SLAVE_ERR_CTRL_EVENT_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN_SLAVE_ERR_CTRL_EVENT_IND_DATA_T atErrCtrlEvent EN SA Structure containing up to 16 Error Control Events Also see Table 97 Array Elements of atErrCtrlEvent 16 VE ER and Table 98 Possible Values of ulEvent and their Meanings R CTRL EVENT _T 16 Tabl
80. 0 Released Public Hilscher 2011 2013 The Application Interface 164 191 5 2 23 CANOPEN SLAVE SETUP PDO INDICATION REQ CNF Setup PDO Indication This reguest can be used by the application for enabling and disabling PDO indications While enabled the CANopen slave sends an indication with each received PDO to the application The PDO indication is described in section CANOPEN SLAVE RECEIVE PDO IND RES Receive PDO in this manual The parameter ulSetupPdoIndication can be used to decide whether you want to disable 1 or enable PDO indications 2 or 3 and whether you want to send multiple PDOs within a single packet Packet Structure Reference RK KK IK kk IK I kok kok kok kok kok k k kok k kok kk kk kk kk kk kk kk kk kk kk kk k k k k k k ck ck ck ck ck ck ck ck ok ck ok ke type of lt code gt CANOPEN SLAVE SETUP PDO INDICATION REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE SETUP PDO INDICATION REO DATA Ttag CANOPEN SLAVE SETUP PDO INDICATION REO DATA T define CANOPEN SLAVE SETUP PDO INDICATION DISABLE 0x000000001L define CANOPEN SLAVE SETUP PDO INDICATION ENABLE 0x000000002L define CANOPEN SLAVE SETUP PDO INDICATION ENABLE EXT 0x000000003L SuBuUCE CANOPEN STAVES or LUPSPDOMINDEECATL TONS Ri OND ATA a TLR UINT
81. 00 0x01 0x02 0x20 0x00 0x01 0x02 0x20 0x00 0x01 0x02 ulDest ulDest ulDest ulDest ulDest ulDest ulDest ulDest 4 ulDest ulDest ulDest ulDest Figure 2 Use of ulDest in Channel and System Mailbox CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 17 191 For use in the destination queue handle the tasks have been assigned to hexadecimal numerical values as described in the following table ulDest Description 0x00000000 Packet is passed to the netX operating system rcX 0x00000001 Packet is passed to communication channel 0 0x00000002 Packet is passed to communication channel 1 0x00000003 Packet is passed to communication channel 2 0x00000004 Packet is passed to communication channel 3 0x00000020 Packet is passed to communication channel of the mailbox else Reserved do not use Table 13 Destination Oueue Handle The picture and the table above both show the use of the destination identifier u Dest A remark on the special channel identifier 0x00000020 Channel Token The Channel Token is valid for any mailbox That way the application uses the same identifier for all packets without actually knowing which mailbox or communication channel is applied The packet stays local The system mailbox is a little bit different because it is used to communicate to the n
82. 0000000 Runtime Failures WATCHDOG TIMEOUT define RCX E WATCHDOG TIMEOUT 0xC000000C Initialization Failures General INITIALIZATION FAULT define RCX E INIT FAULT 0xC0000100 DATABASE ACCESS FAILED define RCX E DATABASE ACCESS FAILED 0xC0000101 Configuration Failures NOT CONFIGURED define RCX E NOT CONFIGURED 0xC0000119 General CONFIGURATION FAULT define RCX E CONFIGURATION FAULT 0xC0000120 INCONSISTENT DATA SET define RCX E INCONSISTENT DATA SET 0xC0000121 DATA SET MISMATCH define RCX E DATA SET MISMATCH 0xC0000122 INSUFFICIENT LICENSE define RCX_E_INSUFFICIENT_LICENSE 0xC0000123 PARAMETER ERROR define RCX_E_PARAMETER_ERROR 0xC0000124 INVALID NETWORK ADDRESS define RCX E INVALID NETWORK ADDRESS 0xC0000125 NO SECURITY MEMORY define RCX E NO SECURITY MEMORY 0xC0000126 CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 36 191 Network Failures General NETWORK FAULT define RCX_COMM_NETWORK_FAULT 0xC0000140 CONNECTION CLOSED define RCX COMM CONNECTION CLOSED 0xC0000141 CONNECTION TIMED OUT define RCX COMM CONNECTION TIMEOUT 0xC0000142 LONELY NETWORK define RCX COMM LONELY NETWORK 0xC0000143 DUPLICATE NODE define RCX COMM DUPLICATE NODE 0xC0000144 CABLE DISCONNECT Zdefine RCX COMM CABLE DISCONNECT 0xC0000145 Version All Implementations The version field holds version of this structure It star
83. 04A001B LR E CANOPEN APS ADDRESS SWITCH CONFIGURATION NOT POSSIBLE Address switch configuration is not possible 0xC04A001C LR E CANOPEN APS BAUD SWITCH CONFIGURATION NOT POSSIBLE Baud switch configuration is not possible 0xC04A001D LR E CANOPEN APS PARAM LED MODE Table 121 Error Messages of the AP Task CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public O Hilscher 2011 2013 Status Error Codes Overview 185 191 6 2 Codes of the CANopen Slave Task 6 2 1 Error Messages The following table defined the error messages of the CANopen slave task Definition Value Description 0x00000000 TLR_S_OK Status ok 0xC0000001 LR E FAIL Common error detailed error information optionally present in the data area of packet 0xC0430003 LR E CANOPEN SLAVE DATA COUNT Invalid data count 0xC0430004 LR E CANOPEN SLAVE DATA OFFSET Invalid data offset 0xC0430005 LR E CANOPEN SLAVE DATA COUNT WITH OFFSET Invalid data count in combination with offset 0xC0430006 LR E CANOPEN SLAVE MODE Invalid mode in command 0xC0430007 LR E CANOPEN SLAVE STATE Command is not allowed in current state 0xC0430009 LR E CANOPEN SLAVE BUS RUNNING Command is not allowed because CANopen is running 0xC043000A LR E CANOPE SLAVE BUS PARAM ALREADY SET Bus par
84. 0x40 CANOPEN_SLAVE_ERROR_REGISTER_MANU_SPEC_BIT 0x80 Table 65 Error Register The field abMan manufacturer specific error information Packet Structure Reference ErrorCode 5 additionally provides the possibility to supply 5 bytes of BKK KK kok ok ok ok ok kok kok kok I EZ kok kok kok kok kok kok kok kok kok k kk I kk kk kk kk kk k 22 2 2 2 2 2 2 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE SEND EMCY REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE SEND EMCY REO DATA Ttag CANOPEN SLAVE SEND EMCY REO DATA T define CANOPEN SLAVE EMCY DATA SIZE 5 define CANOPEN SLAVE ERROR REGISTER ERROR RESE 0x00 define CANOPEN SLAVE ERROR REGISTER GENERIC BI 0x01 define CANOPEN SLAVE ERROR REGISTER CURRENT BI 0x02 define CANOPEN SLAVE ERROR REGISTER VOLTAGE BI 0x04 define CANOPEN SLAVE ERROR REGISTER TEMPERATURE BI 0x08 define CANOPEN SLAVE ERROR REGISTER COMM ERROR BIT 0x10 define CANOPEN SLAVE ERROR REGISTER DEV PROFILE BI 0x20 define CANOPEN SLAVE ERROR REGISTER RESERVED BIT 0x40 define CANOPEN SLAVE ERROR REGISTER MANU SPEC BIT 0x80 struct CAN
85. 1151 0x1402 Peer to Peer PDOA tx 1001 1153 1279 0x1803 Peer to Peer PDOA rx 1010 1281 1407 0x1403 Peer to Peer SDO tx 1011 1409 1535 0x1200 Peer to Peer SDO rx 1100 1537 1663 0x1200 Peer to Peer NMT Error Control 1110 1793 1919 0x1016 0x1017 Peer to Peer Table 30 Objects of the Predefined Connection Set seen from Point of View of the Device The following COB IDs are restricted and may therefore not be used by all configurable COBs and by PDO SDO SYNC TIME STAMP and EMCY COB ID Cause 0 Used by NMT Service fixed assignment 1 Reserved 257 384 Reserved for Safety relevant Data Objects in CANopen Safety Framework 1409 1535 Used by default SDO tx fixed assignment 1537 1663 Used by default PDO rx fixed assignment 1760 Reserved 1793 1919 Used by NMT Error Control fixed assignment 2020 2047 Reserved Table 31 COB IDs with Restrictions of Use CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 52 191 4 4 3 Relation between Communication Objects and NMT States The following table provides the matrix which kinds of communication objects may exist during which states State INITIALISING PRE OPERATIONAL STOPPED Object OPERATIONAL SDO SYNC TIME STAMP EMCY Boot up object NMT objects Green fields indicate the object may operate in this stat
86. 2 1 28 191 General Structure of Messages or Packets for Non Cyclic Data Exchange The non cyclic packets through the netX mailbox have the following structure Structure Information Area Variable Type Value Range Description tHead Structure Information ulDest UINT32 Destination Aueue Handle ulSrc UINT32 Source Queue Handle ulDestId UINT32 Destination Queue Reference ulSrcId UINT32 Source Queue Reference ulLen UINT32 Packet Data Length In Bytes ulld UINT32 Packet Identification As Unique Number ulSta UINT32 Status Error Code ulCmd UINT32 Command Response ulExt UINT32 Reserved ulRout UINT32 Routing Information tData Structure Information User Data Specific To The Command Table 19 General Structure of Messages or Packets for Non Cyclic Data Exchange Some of the fields are mandatory some are conditional others are optional However the size of a packet is always at least 10 double words or 40 bytes Depending on the command a packet may or may not have a data field If present the content of the data field is specific to the command respectively the reply Destination Queue Handler The ulDest field identifies a task queue in the context of the netX firmware The task queue represents the final receiver of the packet and is assigned to a protocol stack The u Dest field has to be filled out in any case Otherwise the netX operating system cannot rou
87. 2927 CANOPEN_SLAVE_RECV_RXPDO_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 86 CANOPEN_SLAVE_PACKET_RECV_RXPDO_RES_T Response to Receive RxPDO Indication CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 138 191 5 2 15 CANOPEN SLAVE SET EVENTS INDICATED REQ CNF Set Events Indicated Reguest Note This packet will be denied in case of being called as long as the Configuration lock flag of the netX is set The following types of indications may occur in the CANopen Protocol Stack V3 and indicate that a specific event has happened NMT State Change Event CANOPEN SLAVE NMT STATE CHANGE IND RES NMT State Change Indication for more information see page 147 Time Stamp Event CANOPEN SLAVE RECV TIME STAMP IND RES Receive Time Stamp Indication for more information see page 125 Error Control Event CANOPEN SLAVE ERR CTRL EVENT IND RES Error Control Event Indication for more information see page 150 Receive PDO Event CANOPEN SLAVE RECV RXPDO IND RES Receive RxPDO Indication for more information see page 135 NMT Command Event CANOPEN SLAVE NMT COMMAND IND RES NMT Command Indication for more information see page 154 Send EMCY Event CANOPEN SLAVE SEND EMCY IND RES Emergency Message Indication for mo
88. 3 RE SUBOBJECT NOTIFY RE DV3 UN R SUBOBJECT NOTIFY DV3 RE DEFINED NOTIFY RE DV3 U ISTER UNDEFINED NOTIFY DV3 RE TER OBJINFO NOTIFY REQ DV3 U ISTER OBJINFO NOTIFY REQ DV3 CRE DATATYPE REO DV3 DELETE DATATYPE REO DV3 SET TIMEOUT REQ DV3 SET OBJECT NAME REO DV3 SET SUBOBJECT NAME REO DV3 LOCK OBJECT DELETION REO ODV3 UNLOCK OBJECT DELETION REO O UJ G DO X O Dana DQ Da O Wu A n a nu A NHN A zee j Z 7 E O O ux uev O Qo UO uo uev coo Whether or not indications are sent to your application depends on which ODV3 events have been notified CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Status Error Codes Overview 183 191 6 Status Error Codes Overview 6 1 1 Codes of the CANopen APS Task 6 1 2 Error Messages Definition Value Definition Description 0x00000000 TLR_S_OK Status ok 0xC0000001 LR_E_FAIL Common error detailed error information optionally present in the data area of packet 0xC04A0002 LR E CANOPEN APS DATABASE FOU
89. 32 x Routing Information tData Structure CANOPEN SLAVE EXCHANGE DATA REO DATA T ulRecvIndex UINT32 0x2200 0x2203 Receive object index ulRecvSub UINT32 1 255 Receive object sub index Index ulRecvData UINT32 0 255 Number of data bytes to be read Cnt ulSendIndex UINT32 0x2000 0x2003 Send object index ulSendSub UINT32 1 255 Send object sub index Index ulSendData UINT32 0 255 Number of data bytes to be sent Cnt abSendData UINTS Data to be sent 255 Table 58 CANOPEN SLAVE PACKET EXCHANGE DATA REO T Exchange Data Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 98 191 Eko kok kk kok kok kok kok kok kok kok kok k k kok k kk kk k kok k kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k ck ck ok ck ok sk type of lt code gt CANOP EN SLAV E EXCHANGE DATA CNF DATA Ttag lt code gt typedef struct CANOPEN SLAVE E XCHANGE DATA CNF DATA Ttag CANOPEN SLAVE EXCHANG E DATA CNF DATA T Structure of task command start stop CANopen confirmation data Struct CANOPEN SLAVE EXCHANGE TLR_UINT32 ulRecvIndex TLR_UINT32 ulRecvSubIndex TLR_UINT32 ulRecvDataCnt TLR_UINT32 ulSendIndex TLR_UINT32 ulSendSubIndex
90. 32 ulSetupPdoIndication Parameter for PDO indications J CK CKCK KE kk Kk KC kk Ck kk Kk Kk KK CK KOC KK CK KC Kk CK RIOR IO I KK KC KC ko AIR IO kk A IK IO AI Kok oko k ke koe k eek type of lt code gt CANOPEN SLAVE PACKET SETUP PDO INDICATION REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SETUP PDO INDICATION REQ Ttag CANOPEN SLAVE PACKET SETUP PDO INDICATION REO T Siem ct CANOPENE SUAVE PACK TSE LUPE DOMED ECAT TON SRE OMETA TLR PACKET HEADER T tHead packet header CANOPEN SLAVE SETUP PDO INDICATION REO DATA T tData packet data R kok k k kok kk kok kok kok kok kok kok kok kok kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k k k ck ck ok sk CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Description 165 191 Structure Information CANOPEN SLAVE PACKET SETUP PDO INDICATION REO T Type Reguest Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle of CANopen slave Task Process QUE_CANOPEN Queue SLV ulSrc U
91. 5 5161 E Mail cn support hilscher com France Hilscher France S a r l 69500 Bron Phone 33 0 4 72 37 98 40 E Mail info hilscher fr Support Phone 33 0 4 72 37 98 40 E Mail fr support hilscher com India Hilscher India Pvt Ltd New Delhi 110 065 Phone 91 11 26915430 E Mail info hilscher in Italy Hilscher Italia S r l 20090 Vimodrone MI Phone 39 02 25007068 E Mail info hilscher it Support Phone 39 02 25007068 E Mail it support hilscher com CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public 191 191 Japan Hilscher Japan KK Tokyo 160 0022 Phone 81 0 3 5362 0521 E Mail info hilscher jp Support Phone 81 0 3 5362 0521 E Mail jp support hilscher com Korea Hilscher Korea Inc Seongnam Gyeonggi 463 400 Phone 82 0 31 789 3715 E Mail info hilscher kr Switzerland Hilscher Swiss GmbH 4500 Solothurn Phone 41 0 32 623 6633 E Mail info hilscher ch Support Phone 49 0 6190 9907 99 E Mail ch support hilscher com USA Hilscher North America Inc Lisle IL 60532 Phone 1 630 505 5301 E Mail info hilscher us Support Phone 1 630 505 5301 E Mail us support hilscher com Hilscher 2011 2013
92. 8 Total Number Of Blocks Of This Channel 0x0054 UINT32 Size Of Channel In Bytes 0x0058 UINTS 8 Reserved set to zero These addresses correspond to communication channel 0 for communication channels 1 2 and 3 you have to add an offset of 0x0010 0x0020 or 0x0030 to the address values respectively 5 Finally you can access the communication channel using the addresses you determined previously For more information how to do this please refer to the netX DPM Manual especially section 3 2 Communication Channel CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 22 191 2 4 Client Server Mechanism 2 4 1 Application as Client The host application may send request packets to the netX firmware at any time transition 1 gt 2 Depending on the protocol stack running on the netX parallel packets are not permitted see protocol specific manual for details The netX firmware sends a confirmation packet in return signaling success or failure transition 3 gt 4 while processing the request The host application has to register with the netX firmware in order to receive indication packets transition 5 gt 6 Depending on the protocol stack this is done either implicit if application opens a TCP UDP socket or explicit if application wants to receive unsolicited packets Details on when and how to register for certain events i
93. 8 bObject2202Size uve Cit Gigs 2202 IMIR DUNS lefol jiexew2osSaen Size Cue eje 2203 ay TLR_UINT16 usNumOfRxPdo Number of receive PDOs TLR_UINT16 usNumOfTxPdo Number of transmit PDOs TLR_UINT32 aulReserved 2 Reserved set to zero struct CANOPEN_SLAVE_EXT_BUSPARAM DATA_Ttag TLR_UINT16 usNumOfRxPdo Number of receive PDOs TLR_UINT16 usNumOfTxPdo Number of transmit PDOs TLR UINT32 aulReserved 9 Reserved set to zero Ve KKK IK kk kk kk kk I I I kok kok kok kok k k kok k I kk kk I kk kk kk kk kk kk kk kk k k k ck ck k k ck ck ck ck ok ke Structure of task command set bus param data struct CANOPEN SLAVE BUSPARAM DATA Ttag TLR_UINT32 ulSlaveNodeld Node ID TLR UINT32 ulBaudrate Baud rate 27 TLR_UINT32 ulCanOpenFlags CANopen flags union CANOPEN_SLAVE_STD_BUSPARAM DATA T tStdBusParam Parameter for standard mode CANOPEN SLAVE EXT BUSPARAM DATA T tExtBusParam Parameter for extended mode uMode TLR_UINT32 ul29BitCode 29Bit Code TLR_UINT32 ul29BitMask 29Bit Mask kok kok kk kok kok kok kok kok kok kok kok k k kok k kok k kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k ck ck ck ck ck ck ok ckok ke type of lt code gt CANOPEN SLAVE BUSPARAM DATA Ttag lt code gt typedef struct CANOPEN SL
94. 9 Table 9 Terms Abbreviations and Definitions uuuu000uunnnnnennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 10 Table 10 References M Table 11 ASCII Aueue Name Table 12 Meaning of Source and Destination related PAraMeteTS 44 4 eene een 14 Table 13 Destination Queue Handle 22 2 eee ee eee eee eee eee nene eene eren KOK KA RKK E KARA RER KK ss sss nnne tente KKK K OR en nn n 17 Table 14 Usingutsresand ulSreT RL EI t p e ti elders deno fecit oe 19 Tabled o Ap u Data mage eh REOR J 25 Table 16 Input Data Image for netX devices with 8 kByte Dual port Memory ee emm 25 Table 17 Qutput Data Image o ere rte bere en E empereur ia eter Ra Eee RU RA ERE dr E RR Ehren RT ER 26 Table 18 Output Data Image for netX devices with 8 kByte Dual port Memory sseseeeeee emen 26 Table 19 General Structure of Messages or Packets for Non Cyclic Data Exchange een 28 Table 20 Chanrnel MailbOX6S 5 iaa Et poe canst zen prensa cd eec tote ab ran Lan etta Eo niea cece cuesta recedet banc og Cd NE ED De Una E 31 Table 21 Common Status Structure Definition 2 cece cece cece cece cece teen cece eaae ee eeeeeeseeaaeaeeeeeeescaaeaeeeesesecaeaeeeeeeeseesenaeees 33 Table 22 Communication State
95. ANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 5 2 7 110 191 CANOPEN SLAVE SEND EMCY IND RES Emergency Message Indication This indication informs the application about the sending of an emergency telegram by the CANopen protocol stack The emergency error codes have the following meaning Error Code Meaning 00xx Error reset or no error 10xx Generic error 20xx Current 21xx Current device input side 22xx Current inside the device 23xx Current device output side 30xx Voltage 31xx Main voltage 32xx Voltage inside the device 33xx Output voltage 40xx Temperature 41xx Ambient temperature 42xx Device temperature 50xx Device hardware 60xx Device software 61xx Internal software 62xx User software 63xx Data set 70xx Additional modules 80xx Monitoring 81xx Communication 8110 CAN overrun objects lost 8120 CAN in Error Passive Mode 8130 Life Guard Error or Heartbeat Error 8140 Recovered from bus off 8150 Transmit COB ID collision 82xx Protocol error 8210 PDO not processed due to length error 8220 PDO length exceeded 90xx External error FOxx Additional functions FFxx Device specific Table 68 Emergency Error Codes Variable usErrorCode CANopen Slave Protocol API DOC111001API05EN Revision 5
96. API Parameter This packet can be used to register callbacks for data exchange between Slave and APS task at the CANopen Slave Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Packet Structure Reference RK ok ok KK ok k kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk 2 kk kk kk kk kk kk 2 kc kk ke kk kc ke kc 2 2 2 22 2 2 22 2 2 2 2 2 2 type of code CANOPEN SLAVE SET API PARAM REQ DATA Ttag code typedef struct CANOPEN SLAVE SET API PARAM REQ DATA Ttag CANOPEN SLAVE SET API PARAM REQ DATA T typedef TLR VOID CALLBACK FAR PFN CANOPEN SLAVE CALLBACK TLR HANDLE hApplication struct CANOPEN SLAVE SET API PARAM REQ DATA Ttag TLR_HANDLE hApplication PFN CANOPEN SLAVE CALLBACK pFncSendDataUpdated TLR UINT8 FAR pbSrcData EU NO 2 Sme PFN CANOPEN SLAVE CALLBACK pFncRecvDataUpdated TLR UINT8 FAR pbDstData TLR_UINT32 ulDstDataCnt xx kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk kk kk kk kk k k kkkkkkkkkkkxkkxx type of lt code gt CANOPEN SLAVE PACKET SET API PARAM REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET API PARAM REO Ttag CANOPEN SLAVE PACKET SET API PARAM REO T
97. API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 131 191 5 2 13 CANOPEN_SLAVE_RECV_RXPDO_REO CNF Receive RxPDO Request This packet sends one or more RTR Telegrams CAN Remote Frames to the CANopen network in order to request a RxPDO from a communication partner CANopen Master or Slave Issueing the request packet CANOPEN_SLAVE_RECV_RXPDO_REQ causes a CAN Remote Frame to be sent causing an indication at the communication partner It is up to the communication partner to decide whether it wants to react to this RTR Telegram or not In case of a positive decision the communication partner will send a response with the requested application to the CANopen Slave Requesting can be done simultaneously for up to 16 RxPDOs whose numbers must be assigned to the members of array aulRecvRxPdoNumber of the request packet The 16 RxPDOs will be processed separately and for each the resulting status code success error will be stored in array aulRecvRxPdoResult of the confirmation packet For details of the protocol see the lower part of Figure 17 CANopen PDO Protocol In Figure 17 CANopen PDO Protocol request s there relates to the CANOPEN_SLAVE_RECV_RXPDO_REQ packet and confirmation s to the CANOPEN_SLAVE_RECV_RXPDO_CNF packet Application Objects Figure 17 CANopen PDO Protocol CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Re
98. ATCHDOG FAIL CNF T struct CANOPEN SLAVE PACKET SET WATCHDOG FAIL CNF Ttag TLR PACKET HEADER T tHead packet header n J KCKCKCKCKCk ok ok ok ok kok ok kok kok kok kok kok kok kok kok kok kok kok kok k kk kk k kok kk kk kk kk kk kk k ck k k k k k ck ck ok ke Packet Description Structure Information CANOPEN SLAVE PACKET SET WATCHDOG FAIL CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSSOId Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched V0O0Id ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x29AB CANOPEN SLAV SET WATCHDOG FAIL CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change Table 107 CANOPEN SLAVE PACKET SET WATCHDOG FAIL CNF T Set Watchdog Fail Confirmation CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 1
99. AVE BUSPARAM DATA Ttag CANOPEN SLAVE GET BUSPARAM CNF DATA T KKK k kok ok kok kk kk kok kok kok k k kok k k kok k k kok k kok kk kk kk kk kk kk kk kk kk kk k ck k ck k k k ck ck k k I 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE PACKET GET BUSPARAM CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET GET BUSPARAM CNF Ttag CANOPEN SLAVE PACKET GET BUSPARAM CNF T Structure of task command get bus parameter confirmation struct CANOPEN SLAVE PACKET GET BUSPARAM CNF Ttag CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface ER INCH JME AD ER_T tHead CANOPE N_SLAVE G Ur _IS0 SEVANRVAM TEN IDI E EDC p packet header JOSS ieget Glace 2 EX 160 191 kok kok kok kok kok kok kok kok kok kok k kk k kok kk kk kk kk kk kk kk kk kk kk kk kk kk kk I 2 2 2 2 2 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2073 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 161 191 Packet Description structure CANOPEN_SLAVE_PACKET_GET_BUSPARAM CNF_T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T
100. AVE SEND TXPDO REO DATA T tData packet data RK k IK kk IK I kok kok kok kok kok kok kok kok kok I kok kk kk kok kk kk kk kk kk k k k k k A 2 2 2 2 2073 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 129 191 Packet Description structure CANOPEN SLAVE PACKET SEND TXPDO REO T Type Reguest Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle QUE_CANOPEN SLV ulSrc UINT32 0 277 4 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 64 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2922 CANOPEN_SLAVE_SEND_TXPDO_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure
101. AVE_PACKET_EXCHANGE_DATA_CNF_T Exchange Data Confirmation CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 100 191 5 2 5 CANOPEN_SLAVE_STATE_CHANGE_IND RES Change of Task State Indication This indication packet signifies a change of the state of the CANopen slave task The indication delivers two important blocks containing status information about the CANopen slave namely The slave state The extended slave state These blocks delivering information about the change of state are described in detail below Note Use this packet only when working with linkable object modules It is not designed for usage in the context of loadable firmware Note This indication is used by the AP Task in order to set status information in the DPM and will not be routed to the user application In order to be able to receive this indication the CANOPEN_SLAVE Register Application request has to be executed by the AP Task ve EGISTER_REQ CNF Packet Structure Reference KKK HK KK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k k I k ck ck ck ck ck ck 2 I 22 ck sk type of lt code gt CANOPEN SLAVE STATE CHANGE IND DATA Ttag lt code gt typedef struct CANOPEN SLAVE STATE CHANGE IND DATA Ttag CANOPEN SLAVE STATE CHANGE IND DATA T
102. Aa Ear En aaea 3 2 6 Channel Mailboxes Details of Send and Receive Mailboxes SOMME uU ML Pe e e a Gomimorn tatus eret rti eR E E E NR SRE PE RR ESERE A UE Er ne ARR Te RARE PER TERRA RE UEE 3 3 2 Extended Status sep eiae res A ae entero ie rte er eee 3 4 Control BIOCK hine m b tis tte e a ek redimit HA Lamestuv pese dt made 4 Getting Started niea necis diu lu diete desire c si stvondceetted 42 4 1 Overview about Essential Functionality eee nen nen 42 4 2 Configuration Parameters and Procedures eee nene 42 4 2 1 Using a Packet CANOPEN APS SET CONFIGURATION REO CNF oeececeeeeeeeecceceeeeeseeeeceeeeeeeeeeeees 43 4 2 2 Behavior when receiving a Set Configuration Command sese 45 4 3 Task Structure of the CANopen Slave V3 Stack eee eee eee nenene nn n 45 4 4 CANopen Basic Topics eee s e2eee eee 00000000 e eee n KKK KKK enne meten enn entere nn enne nnns 47 4 4 1 NMT Slave State Machine eee eect rere eee enter eee eee KKK KKK E ER K E KKK nn 47 4 4 2 Communication Objects COB IDs and Priority of Processing see 50 4 4 3 Relation between Communication Objects and NMT States eee 52 LIAE acc Q 4 4 5 Process Data Objects PDQ x 2ER Ei cde tdr eee nein je dre 4 5 Standard Mode vs Extended Mode 4 5 1 How to decide between Operation in Standard Mode and Extended Mode
103. BUSPARAM CNF T Set Bus Parameter Confirmation 121 CANOPEN SLAVE PACK SEND TIME STAMP REO T Send Time Stamp Reguest nenn 123 CANOPEN SLAVE PACK SEND TIME STAMP CNF T Confirmation to Send Time Stamp Request 124 CANOPEN SLAVE PACK RECV TIME STAMP IND T Receive Time Stamp Indication 126 CANOPEN SLAVE PACKET RECV TIME STAMP RES Response to Receive Time Stamp Indication 127 CANOPEN SLAVE PACK SEND TXPDO REO T Send TxPDO Reguest eee 129 CANOPEN SLAVE PACK SEND TXPDO CNF T Confirmation to Send TxPDO Request 130 CANOPEN SLAVE PACK RECV RXPDO REO T Receive RxPDO Request eee 133 CANOPEN SLAVE PACKET RECV RXPDO CNF T Confirmation to Receive RxPDO Request 134 CANOPEN SLAVE PACK RECV RXPDO IND T Receive RxPDO Indication eeeeesessse 136 CANOPEN SLAVE PACKET RECV RXPDO RES T Response to Receive RxPDO Indication 137 Bit Mask ulEventslindicatediicu is MP jo A cade ode aa Muell iR iU a an cel 138 CANOPEN SLAVE PACKET SET EV S INDICATED REO T Set Events Indicated Request 140 CANOPEN SLAVE PACK SE V S INDICATED CNF T Confirmation to Set Events Indicated USS nennen Nun E 141 CANOPEN SLAVE PACK G IO INFO REO T Get I O Info Reguest eee 142 CANOPEN SLAVE PACKET GET IO INFO CNF Confirmation to Get I O Info Request
104. CANOPEN SLAVE BUSPARAM DATA T related to parameter tDeviceCfg consists of the following items CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 78 191 Parameter Type Meaning Range of Values ulSlaveNodeld UINT32 Node ID of CANopen Slave 1 127 ulBaudrate UINT32 Baudrate for CANopen network Allowed values see Table 46 Codes and Corresponding Baud Rates of CANopen Network ulCanOpenFlags UINT32 CANopen Flags BIT 0 29 BIT IDENTIFIER DISABLED ENABLED Not supported yet set to zero BIT 1 3 Reserved for further use set to zero BIT4 up to BIT10 are only applicable in Standard Mode BIT 4 Evaluate Vendor ID DISABLED ENABLED BIT 5 Evaluate Product Code DISABLED ENABLED BIT 6 Evaluate Serial Number DISABLED ENABLED BIT 7 Evaluate Revision Number DISABLED ENABLED BIT 8 Evaluate Device Type DISABLED ENABLED BIT 9 Evaluate Object Size DISABLED ENABLED BIT 10 Evaluate PDO Count DISABLED ENABLED BIT 11 15 Reserved for further use set to zero BIT 16 Disable Send COS Synchronous Acyclic BIT 17 Disable Send COS Manufacturer Spec BIT 18 Disable Send COS Profile Spec BIT 19 24 Reserved for further use set to zero BIT 25 Hold last state BIT 26 28 Reserved for further use set to zero BIT 29 Extended Mode Flag BIT 30 32 Reserved for further use set
105. CANOPEN SLAVE SEND TXPDO REO DATA T aulSendTxPdoNu UINT32 1 255 foreach Array of numbers of TxPDOs for sending mber 16 number Table 81 CANOPEN SLAVE PACKET SEND TXPDO REO T Send TxPDO Request CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 130 191 RK k kk kok kok kok kok kok kok kok kok kok kok k kk k kok k kk kok I 2 2 22 2 2 2 2 2 2 type of lt code gt CANOPEN SLAVE SEND TXPDO CNF DA1 typedef struct CANOPEN SLAVE SEND TXPDO CNF DATA Ttag CANOPEN SLAVE SEND TXPDO CNF DATA T define CANOPEN SLAVE SEND TXPDO REO MAX 16 struct CANOPEN SLAVE SEND TXPDO CNF DATA Ttag A Ttag lt code gt TLR UINT32 aulSendTxPdoResult CANOPEN SLAVE n END_TXPDO_REQ MAX type of lt code gt CANOPEN_SLAVE_PACKET_SEND_TXPDO_CNF_Ttag lt code gt typedef struct CANOPEN_SLAVE_PACKET_SEND_TXPDO_CNF_Ttag CANOPEN_SLAVE_PACKET_SEND_TXPDO_CNF_T struct CANOPEN_SLAVE_PACKET_SEND_TXPDO_CNF_Ttag TLR_PACKET_HEADER_T tHead CANOPEN_SLAVE_SEND_TXPDO_CNF_DATA_T tData packet header 55 WCE CICA ny KKK IK IK kk kk kk
106. CiA Draft Standard 301 subsection 9 2 6 1 1 These are Start Remote Node Stop Remote Node Enter Pre Operational Reset Node Reset Communication The Error Control Events allow detecting errors within the CAN network They include the following types of events described in the CANopen Specification CiA Draft Standard 301 subsection 9 2 6 1 2 Node Guarding Event Life Guarding Event Heartbeat Event There is one single type of Time Stamp Event defined in CANopen which can be handled by the CANOPEN SLAVE RECV TIME STAMP IND RES Receive Time Stamp Indication in the CANopen Slave V3 protocol stack Packet Structure Reference Oko kok kok kok kok kok kk kok kok kok kok k k kok k kk kk kk kk kk kk kk kk kk kk kk kk k kk k k k k k ck k ck ck ck ck ck ck ck ckok ke type of lt code gt CANOPEN SLAVE SET EVENTS INDICATED REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE SET EVENTS INDICATED REO DATA Ttag CANOPEN SLAVE SET EVENTS INDICATED REO DATA T define CANOPEN SLAVE EVENT NMT STATE CHANGE MSK 0x00000001L define CANOPEN SLAVE EVENT TIME STAMP MSK 0x00000002L define CANOPEN SLAVE EVENT ERR CTRL MSK 0x00000004L define CANOPEN SLAVE EVENT RECV RXPDO MSK 0x00000008L define CANOPEN_SLAVE_EVENT_NMT_COMMAND_M
107. Cmd UINT32 0x291E CANOPEN SLAVE SEND TIME STAMP REO Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN_SLAVE un END_TIME_STAMP_REO_DATA_T ulMilliseconds UINT32 0 86 399 999 Milliseconds part of time stamp number of milliseconds that have occurred since last midnight usDays UINT16 0 65535 Days part of time stamp number of days that have occurred since January 1 1984 Table 77 CANOPEN_SLAVE_PACKET_SEND_TIME_STAMP_REQ_T Send Time Stamp Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 124 191 Packet Structure Reference RK KK IK IK IK kk kok kok kok kok kok kok kok kok I kok kok k kk 2 22 kk kk kk kk kk kk kk kk kk k k k k I 2 2 2 2 22 2073 type of lt code gt CANOPEN SLAVE PACKET SEND TIME STAMP CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SEND TIME STAMP CNF Ttag CANOPEN SLAVE PACKET SEND TIME STAMP CNF T Struct CANOPEN SHAVE PACKET SEND TIME STAMP CNE vag TLR_PACKET_HEADER_T tHead packet header hi RK IK IK kk IK I kok kok kok kok kok k kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k c
108. Configuration Parameters and Procedures The following ways are available to configure the CANopen Slave By Set Configuration packet By SYCON net only applicable in Standard Mode By netX configuration tool only applicable in Standard Mode CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 43 191 4 2 1 Using a Packet CANOPEN APS SET CONFIGURATION REQ CNF The following table contains relevant information about the configuration parameters for the CANopen Slave firmware such as an explanation of the meaning of the parameter and ranges of allowed values Parameter Meaning Range of Value Value Bus Startup The start of the device can be performed either application Application controlled 1 controlled or automatically Automatic 0 Automatic not available in Extended Default Automatic 0 Mode Network connections are opened automatically without taking care of the state of the host application Application controlled The channel firmware is forced to wait for the host application to set the Application Ready flag in the communication change of state register see section 3 2 5 1 of the netX DPM Interface Manual For more information concerning this topic see section 4 4 1 Controlled or Automatic Start of the netX DPM Interface Manual 1 0 Status This parameter is represented by bits 1 and 2 of the system
109. DATA T 29 bit code 29 bit code for acceptance filtering 29 bit mask 29 bit mask for acceptance filtering Table 29 Meaning and allowed Values for Configuration Parameters CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public O Hilscher 2011 2013 Getting Started 45 191 4 2 2 Behavior when receiving a Set Configuration Command The following rules apply for the behaviour of the CANopen Slave protocol stack V3 when receiving a set configuration command The configuration packets name is CANOPEN_APS_SET_CONFIGURATION_REQ for the request and CANOPEN APS SET CONFIGURATION CNF for the confirmation The configuration data are checked for consistency and integrity In case of failure no data are accepted In case of success the configuration parameters are stored internally within the RAM The parameterized data will be activated only after a channel init has been performed No automatic registration of the application at the stack happens The confirmation packet CANOPEN_APS_SET_CONFIGURATION_CNF only transfers simple status information but does not repeat the whole parameter set A Set Configuration Command will not be processed in case of the protocol stack has already been configured via database prior to receiving this command 4 3 Task Structure of the CANopen Slave V3 Stack The illustration below displa
110. DOs and 0x2200 to 0x2203 RxPDOs The object dictionary is completely filled with objects up to the maximum extent supported at that time According to the entries made in the EDS file all entries are automatically created within the object dictionary For a precise list of supported entries see subsection 4 5 5 Object Dictionary with Firmware Functionality on page 72 below If further objects are added later these cannot be PDO mapped in Standard Mode 4 5 3 1 The standard bus parameter structure CANOPI consists of the following items Configuring the Standard Mode EN SLAVI E STD BUSPARAM DATA T is used It Parameter Type Meaning Range of Values Default ulVendorId UINT32 Vendor code if corresponding bit in parameter ulCanopenFlags is set ulProductCode UINT32 Product code if corresponding bit in parameter ulCanopenFlags is set ulSerialNumber UINT32 Serial number if corresponding bit in parameter ulCanopenFlags is set ulRevisionNumber UINT32 Revision number if corresponding bit in parameter ulCanopenFlags is set ulDeviceType UINT32 Device Type if corresponding bit in parameter ulCanopenFlags is set bobject2000Size UINT8 Size of object 0x2000 bobject2001Size UINT8 Size of object 0x2001 bobject2002Size UINT8 Size of object 0x2002 bobject2003Size UINT8 Size of object 0x2003 bobject2200Size UINT8 Size of object 0x2200 bob
111. DOs 0 256 usNumOfTxPdo UINT16 Number of Transmit PDOs 0 256 aulReserved 9 UINT32 9 Reserved set to zero Table 39 Extended bus parameter structure CANOPEN_SLAVE_EXT_BUSPARAM_DATA_T 4 5 4 2 Handling of Process Data in Extended Mode The 4 objects 0x2000 0x2003 for send data and 4 objects of receive data 0x2200 0x2203 are not used in Extended Mode In the Extended Mode the DPM contains PDOs instead of objects 4 5 4 3 Start Sequence of Extended Mode The following sequence of steps is necessary to get the Extended Mode running after the bus parameters have been set 1 Create all necessary objects within the object dictionary Only objects mentioned in Table 40 Supported Object Dictionary Entries Communication Profile present in the EDS file below make sense in this context 2 Register all required indications however a later registration is also possible 3 Start communication This causes a verification whether sufficient information is available to start up the protocol stack For example if 3 PDOs are configured the objects 0x1400 0x1600 0x1401 0x1601 0x1402 and 0x1602 must exist and will be checked for existence 4 Then no communication objects may be deleted anymore Note In Extended Mode configuration can only be done by Set Configuration packet However the auto start option is not available CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released
112. DY define CANOPEN SLAVE M EXT S D HEE define CANOPEN_SLAVE_EXT_S ATE_FLAG TIMEOUT WARNING define CANOPEN_SLAVE_EXT_S E_UNKNOWN define CAN PEN SLAVE EXT S define CANOPEN SLAVE EXT S STOP E OPERATIONAL define CANOPEN SLAVE EXT S E PRE OPERATIONAL Qo E GONG U define CANOPEN SLAVE EXT S p op pp i define CANOPEN_SLAVE_ADD_D ETAIL SIZI struct CANOPEN SLAVE EXTEND EveCnt E INITIALISING ED STATE Ttag TLR UINT32 ulFlags TLR UINT32 ulNodeState TLR UINT32 ulBusOff5svecnt TLR UINT32 ulErrorPassivel TLR_UINT32 ulRxOverflowCnt TLR_UINT32 ulTxOverflowCnt TLR UINT32 ulErrorWarningCnt TLR UINT32 ulTimeoutCnt TLR UINT32 aulReserved 3 TLR HINT3S2Z ulIndbhostonts TLR UINT32 ulDiagInfoCount OUPO ZAS Du EIG ILE TLR UINT32 ulMaxRecvIdx TLR UINT32 ulMaxSendIdx TLR UINT32 aulAddDetail CANOP EN SLAVE ADD DETAIL 0x000000011 0x000000021 0x000000041 0x000000081 0x000000101 0x000000201 0x000000401 0x000001001 0x000002001 0x000010001 0x000020001 0x000040001 0x000100001 0x000000001 0x000000011 0x000000021 0x000000801 0x000000FFI E U U Lis 0x000000031 SIZE VE kk kk I 2 kk kk I kok I I kk kk kk kk kk kk kk k
113. E CANOPEN APS PARAM POOL ELEMENT Invalid parameter for number of pool elements 0xC04A0012 LR E CANOPEN APS PARAM CYCLETI Invalid parameter for cycle time CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Status Error Codes Overview 184 191 Definition Value Definition Description Invalid parameter for LED mode 0xC04A0013 LR E CANOPEN APS PARAM CHN INSTANCE Invalid parameter for channel instance 0xC04A0014 LR E CANOPEN APS NUM OF RX PDO PARAMETER Invalid parameter for number of receive PDO 0xC04A0015 LR E CANOPEN APS NUM OF TX PDO PARAMETER Invalid parameter for number of send PDO 0xC04A0016 LR E CANOPEN APS SIZE TABLE VERSION Invalid size of table Version 0xC04A0017 LR E CANOPEN APS INVALID DBM VERSION Invalid version of table Version 0xC04A0018 LR E CANOPEN APS SIZE TABLE BUS CAN STD Invalid size of table BUS COS STD 0xC04A0019 LR E CANOPEN APS SIZE TABLE BUS CAN EXT Invalid size of table BUS COS EXT 0xC04A001A LR E CANOPEN APS AUTOSTART WITH EXTENDED MODE Auto start not allowed in extended mode 0xC
114. EN SLAVE LIFE GUARD STARTED 0x000000041 EN SLAVE LIFE GUARD ERROR 0x000000051 EN SLAVE LIFE GUARD STOPPED 0x00000006L E u E u struct CANOPEN_SLAVE_ERR_CTRL_EVENT_Ttag TLR_UINT32 ulEvent TLR_UINT32 ulNodeld struct CANOPEN_SLAVE_ERR_CTRL_EVENT_IND_DATA_Ttag CANOPEN_SLAVE_ERR_CTRL_EVENT_T atErrCtrlEvent CANOPEN_SLAVE_MAX_ERR_CTRL_EVENT J KCKCKCKCKCk ok ok kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok k kk kk kk kk kk kk kk kk kk kk k k k k k ck ck ok sk ok ke type of lt code gt CANOPEN SLAVE PACKET ERR CTRL EVENT IND Ttag lt code gt typedef struct CANOPEN SLAVE PACKET ERR CTRL EVENT IND Ttag CANOPEN SLAVE PACKET ERR CTRL EVENT IND T struct CANOPEN SLAVE PACKET ERR CTRL EVENT IND Ttag TLR PACKET HEADER T tHead packet header CANOPEN_SLAVE_ERR_CTRL_EVENT_IND_DATA_T tData packet data i T kk k k k ok kok kok kk kok kok kok kok kok kok kok k k kok k k kok k kok k kk kk kk kk kk kk kk kk k k k k k k k k ck ck ck ck ok ke CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 1
115. ES_REQ packet shall be done The behaviour using the configuration packet SET_CONFIG_REO is the same CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 173 191 Packet Structure Reference typedef struct TLR_SWITCH_VALUE_Ttag TLR_UINT8 16 abSwitchName fe Swiiccla Name Ieenmcir er 1 8 BAD jana TLR UINT32 ulSwitchValue HW Switch Value to set S LPORLBCSWITCHCVARNUS U typedef struct RCX SET HW SWITCH VALUES REQ DATA Ttag TLR UINT32 ulNumberOfSwitches TLR SWITCH VALUE T tSwitchValue f mese oues evel Nene Valve 97 used as much as NumberOfSwitches RCX SET HW SWITCH VALUES REO DATA T typedef struct RCX SET HW SWITCH VALUES REO Ttag TLR_PACKET_HEADER_T tHead packet header RCX SET HW SWITCH VALUES REO DATA T tData RCX SET HW SWITCH VALUES REO T Packet Description structure RCX SET HW SWITCH VALUES REO T Type Request Area Variable Type Value Description Range tHead structure TLR PACKET HEADER T ulDest UINT32 Destination gueue handle of application task process queue ulSrc UINT32 Source Queue Handle of PNSIF task proce
116. E_PACKET_SEND_EMCY_IND_Ttag lt code gt typedef struct CANOPEN_SLAVE_PACKET_SEND_EMCY_IND_Ttag CANOPEN_SLAVE_PACKET_SEND_EMCY_IND_T struct CANOPEN_SLAVE_PACKET_SEND_EMCY_IND_Ttag TLR PACKET HEADER T tHead packet header B CANOPEN SLAVE SEND EMCY IND DATA T tData packet induest data A CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Description 112 191 Structure Information CANOPEN SLAVE PACKET SEND EMCY IND T Type Indication Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 OUE CANOPEN Destination Queue Handle of CANopen slave Task Process SLV Oueue ulSrc UINT32 0 2 1 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process ulSrcId UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet voId inside the Source Process ulLen UINT32 8 Packet Data Length in bytes ulld UINT32 0 22 4 Packet Identification as unique number generat
117. English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 111 191 The bits of the error register bErrorRegister have the following meaning Error Code CANOPEN_SLAVE_ERROR_REGISTER_GENERIC_BI 0x01 CANOPEN_SLAVE_ERROR_REGISTER_CURRENT_BI 0x02 CANOPEN_SLAVE_ERROR_REGISTER_VOLTAGE_BI 0x04 CANOPEN_SLAVE_ERROR_REGISTER_TEMPERATURE_BI 0x08 CANOPEN_SLAVE_ERROR_REGISTER_COMM_ERROR_BIT 0x10 CANOPEN_SLAVE_ERROR_REGISTER_DEV_PROFILE_BI 0x20 CANOPEN_SLAVE_ERROR_REGISTER_RESERVED_BIT 0x40 CANOPEN_SLAVE_ERROR_REGISTER_MANU_SPEC_BIT 0x80 Table 69 Error Register The field abManErrorCode 5 additionally provides the possibility to supply 5 bytes of manufacturer specific error information Packet Structure Reference type of lt code gt CANOPEN SLAVE SEND EMCY IND DATA Ttag lt code gt typedef struct CANOPEN SLAVE SEND EMCY IND DATA Ttag CANOPEN SLAVE SEND EMCY IND DATA T struct CANOPEN SLAVE SEND EMCY IND DATA Ttag TLR_UINT16 usErrorCode TLR UINT8 abManErrorCode CANOPEN SLAVE EMCY DATA SIZE TLR UINT8 bErrorRegister type of lt code gt CANOPEN_SLAV
118. Features Parameter Maximum number of input data 1020 bytes Maximum number of output data 1020 bytes Number of receive PDOS 0 255 netX 50 100 500 for mapping objects 2200 2203 0 8 netX 10 for mapping objects 2200 2203 Number of transmit PDOs 0 255 netX 50 100 500 for mapping objects 2000 2003 0 8 netX 10 for mapping objects 2000 2003 Table 7 Technical Data Protocol Stack Standard Mode Configured Settings E Note 1 Using other settings than the default settings requires a suitable EDS file Note 2 The actual maximum number of IO Data and PDOs depends on the available amount of memory Note 3 SYCON net and netX configuration tool do not support the configuration of the extended mode CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 9 191 1 5 1 2 Technical Data Extended Mode In extended mode the stack offers extended functionality To use these functions requires an application program that configures and supports these functions e g to create an own object dictionary In extended mode more input and output data can be used and transmit and receive PDOs can be used Note The actual maximum number of IO Data and PDOs depends on the available amount of memory To use the extended mode requires creating a suitable EDS file The knowledge of the EDS specification is r
119. Hilscher 2011 2013 Getting Started 71 191 4 5 4 Extended Mode The Extended Mode is characterized by the following features The Extended Mode has been designed for maximum flexibility for instance if you want to create an object directory of your own or you want to create your own device profile The extended bus parameter structure CANOPEN SLAVE EXT BUSPARAM DATA T is applied see Table 39 Extended bus parameter structure CANOPEN_SLAVE_EXT_BUSPARAM_DATA_T on page 71 The AUTOSTART option is not available Configuration can only be done by Set Configuration packet Currently there are no suitable configuration tools available The DPM contains the PDOs DPM Byte 0 7 PDO1 DPM Byte 8 15 PDO2 and so on The object dictionary must completely be set up manually For each of the entries made in the EDS file that you want to use the according entries must be made in the object dictionary via ODV3 object create and write For a precise list of entries that can be set up see subsection 4 5 5 Object Dictionary with Firmware Functionality on page 72 below If further objects are added later these may be mapped in Extended Mode 4 5 4 1 Configuring the Extended Mode The extended bus parameter structure CANOPEN SLAVE EXT BUSPARAM DATA T is used It consists of the following items Parameter Type Meaning Range of Values usNumOfRxPdo UINT16 Number of Receive P
120. Hilscher 2011 2013 Appendix 190 191 7 2 List of Figures Figure 1 The 3 different Ways to access a Protocol Stack running on a netX System lt lt lt 13 Figure 2 Use of ulDest in Channel and System Mailbox seeeeeee nene eene enne nns 16 Figure 3 Using ulSrc and ulSrceIq uei ete eic ave ee dep iet eed te Detain i exi ve ee indo 18 Figure 4 Transition Chart Application as Client enne enn nhnemrnn sinn inneren KRKA K Ann 22 Figure 5 Transition Chart Application as Server nennen nemen enne KRK KERR P nnns 23 Figure 6 Internal Structure of CANopen Slave V3 Firmware ssssesseeeneenen nennen nenne nennen nnns 45 Figure 7 NMT Slave State Machine 242 00u0402424240440aannannnnnnnnanannannannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnannnnnannnnnnnnnnnnnnnnnnanann 47 Figure 8 Initialization State of NMT Slave ssssseseseene enn enne ennnnen nennen nnne enhn en eren nnne enne nnns 48 Figure 9 Node Guarding Protocol nee ee sn Enns 55 Figure 10 Heartbeat Protocol iecit cred eiie ert tre aan ee aaa e spe Dane pe ig rene ers dae EE a fede tod aera eee tah 56 Figure 11 Node Start Stop State Transition eene nennen nennen nnnm nennen nennen entren nnns 58 Figure 12 Producer Consumer Modlel iier eterni entm denn ren eodera Sek a tera ii aaea nnne rd 61 Figure 13 Modes of Communication Event driven Polling Synchronized een 63 Figure 14 PDO Mappi
121. INR GINTS lefolojiec220 3 subvep f Size oO olejeec 22103 ey TLR_UINT16 usNumOfRxPdo Number of receive PDOs TLR_UINT16 usNumOfTxPdo Number of transmit PDOs TLR_UINT32 aulReserved 2 Reserved set to zero PACKED POST PACKED PRE struct CANOPEN SLAVE EXT BUSPARAM DATA Ttag TLR_UINT16 usNumOfRxPdo Number of receive PDOs TLR_UINT16 usNumOfTxPdo Number of transmit PDOs TLR_UINT32 aulReserved 9 Reserved set to zero PACKED POST Structure of task command set bus param data PACKED PRE struct CANOPEN SLAVE BUSPARAM DATA Ttag TLR UINT32 ulSlaveNodeld Node ID TLR UINT32 ulBaudrate Baud rate 27 TLR_UINT32 ulCanOpenFlags CANopen flags PACKED PRE union CANOPEN SLAVE STD BUSPARAM DATA T tStdBusParam Parameter for standard mode CANOPEN SLAVE EXT BUSPARAM DATA T tExtBusParam Parameter for extended mode PACKED POST uMode TLR UINT32 ul29BitCode TLR UINT32 ul29BitMask 29Bit Code 29Bit Mask PACKI LH DEROGHE CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 119 191 RK KK ok k EEE kk ok oko oko oko kk kk kk ok oko ok ok kok kok kok k 22 22 2 2 22 22 22 2 2 22 22 22 ck ck k ck 22 2 2 2 2 2 2 20 type of code CANOPEN SLAVE BUSPARAM DATA Ttag lt code gt typedef struct CANOPEN SLAVE BUSPARAM DATA
122. INT32 0 2774 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process ulSrcId UINT32 ulAPSS0Id Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x29BA CANOPEN SLAVE SETUP PDO INDICATION REO Command ulExt UINT32 O Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN SLAVE SETUP PDO INDICATION REO DATA T ulSetupPdoIn UINT32 0x00000001 Disable PDO Indications dication 0x00000002 Enable PDO Indication 0x00000003 Enable PDO Indication for multiple PDO transfer Table 108 CANOPEN SLAVE PACKET SETUP PDO INDICATION REO T Setup PDO Indication Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 166 191 Packet Structure Reference RK k kok kok kk kok kok kok kok kok kok kok kok kok kok kok I 22 2 2 kk kk kk kk kk k k k k k k ck ck ck ck ck ck ck ck ok ck ok ke type of lt code gt CANOPEN SLAVE PACKET SETUP PDO INDICATION CNF Ttag lt code gt typedef struct CANOPE
123. K I kok kok kok kok kok kok kok k kk 2 kok I 2 2 22 2 2 2 2 2 2 22 273 typedef struct CANOPEN SLAVE NMT COMMAND RES DATA Ttag CANOPEN SLAVE NMT COMMAND RES DATA T struct CANOPEN SLAVE NMT COMMAND RES DATA Ttag TLR_UINT32 ulNmtState New local NMT state Ax kk kok kok ok kok kok kok kok kok kok kok kok kok kok kok kok k k kok kok kok k kk kk kk kk kok kok kk kk kk k k k k k ok ck ok ke type of lt code gt CANOPEN SLAVE PACKET NMT COMMAND RES Ttag lt code gt typedef struct CANOPEN SLAVE PACKET NMT COMMAND RES Ttag CANOPEN SLAVE PACKET NMT COMMAND RES T struct CANOPEN SLAVE PACKET NMT COMMAND RES Ttag TLR PACKET HEADER T tHead CANOPEN SLAVE NMT COMMAND RES DATA T tData packet header Jers Teele ce PE k kk kk kok kok kok kok kok I 2 2 2 2 22 2 2 2 2 2 2 2073 Packet Description structure CANOPEN SLAVE PACKET NMT COMMAND RES T Type Response Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within
124. Modules CANOPEN SLAVE SET API PARAM REQ CNF Set API Parameter CANOPEN SLAVE SET BUSPARAM REQ CNF Set Bus Parameters The following packet of the CANopen Slave Task will be denied if the Configuration Lock flag is set CANOPEN SLAVE SET EVENTS INDICATED REQ CNF Set Events Indicated Request The following table lists all packets of the CANopen Slave Task and specifies whether they can be used with LFW with LOM and whether they will be denied if the Configuration Lock flag is set CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 86 191 Section Name LFW LOM Denied on Cfg Lock 5 2 1 CANOPEN_SLAVE_REGISTER_REQ CNF Register Application 0 x X 5 2 2 CANOPEN SLAVE STARTSTOP REQ CNF Start Stop CANopen x x x Network 5 2 3 CANOPEN SLAVE INITIALIZE REQ CNF Initialization of CANopen 0 X x Slave 5 2 4 CANOPEN SLAVE EXCHANGE DATA REQ CNF Exchange Data X X X 5 2 5 CANOPEN SLAVE STATE CHANGE IND RES Change of Task State 0 x x Indication 5 2 6 CANOPEN_SLAVE_SEND_EMCY_REQ CNF Send Emergency Message x x X 5 2 7 CANOPEN SLAVE SEND EMCY IND RES Emerg
125. N SLAVE NMT STATE RESET NODE 0x81 define CANOPEN SLAVE NMT STATE RESET COM 0x82 RK ok ok kok ok k oko ok k kok k ok kok kk kk kok kok kok kok kok kok kk kk kc k kk kk kk kk kk kk kk kk kok kk kk k k kk type of lt code gt CANOPEN SLAVE NMT COMMAND IND DATA Ttag lt code gt typedef struct CANOPEN SLAVE NMT COMMAND IND DATA Ttag CANOPEN SLAVE NMT COMMAND IND DATA T struct CANOPEN SLAVE NMT COMMAND IND DATA Ttag TLR_UINT32 ulNmtCommand Request NMT command from NMT master bp RRR RR HR 2 2 2 KK KK kkk kkk kk kkk kkk kk kk k k kk k 2 2 2 2 2 22 2 2 2 2 2 2 22 2 2 22 2 2 202 2 2 2 2 k k k k k k k k k k 2 2 2 20 type of lt code gt CANOPEN_SLAVE_PACKET_NMT_COMMAND_IND_Ttag lt code gt typedef struct CANOPEN_SLAVE_PACKET_NMT_COMMAND_IND_Ttag CANOPEN_SLAVE_PACKET_NMT_COMMAND_IND_T struct CANOPEN_SLAVE_PACKET_NMT_COMMAND_IND_Ttag TLR_PACKET_HEADER_T tHead packet header CANOPEN_SLAVE_NMT_COMMAND_IND_DATA_T tData packet data l RK ok ok kok ok k kk kk kk kk oko ok ok kok kk kk kk kk kk kk kk kk kk kk 2 kk kk kk ko kc ke kc ko kc 2 2 2 2 22 2 2 22 2 2 2 2 2 2 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 156 191
126. N SLAVE PACKET SETUP PDO INDICATION CNF Ttag CANOPEN SLAVE PACKET SETUP PDO INDICATION CNF T struct CANOPEN SLAVE PACKET SETUP PDO INDICATION CNE Ttag TLR_PACKET_HEADER_T tHead packet header P k kk kk ok ok kok kok kok kok kok kok kok kok kok kok kok kok k k kok k kk kk kk kk kk kk k ck kk kk kk k ck k k ck k k k k ck ck ok ck ok ke Packet Description Structure Information CANOPEN SLAVE PACKET SETUP PDO INDICATION CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 julAPSSOId Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSLV Source End Point Identifier untouched OId ulLen UINT32 0 Packet Data Length in bytes ulId UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x29BB CANOPEN SLAVE SETUP PDO INDICATION CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change Table 109 CANOPEN_SLAVE_PACKET_SETUP_PDO_INDICATION_CNF_T Setup PDO Indication Confirmation
127. ND Configuration database found 0xC04A0003 LR E CANOPEN APS NODE ID PARAMETER Invalid parameter for node id 0xC04A0004 LR E CANOPEN APS BAUDRATE PARAMETER Invalid parameter for baudrate 0xC04A0005 LR E CANOPEN APS STATE Request not possible in current state 0x404A0007 TLR I CANOPEN APS OPEN DBM FILE Failed to open configuration database 0xC04A0008 LR E CANOPEN APS DATASET Failed to open configuration dataset 0xC04A0009 LR E CANOPEN APS TABLE GLOBAL Failed to open GLOBAL configuration dataset 0xC04A000A LR E CANOPEN APS TABLE BUS CAN Failed to open BUS CAN configuration dataset 0xC04A000B TLR E CANOPEN APS SIZE TABLE BUS CAN Invalid size of BUS CAN configuration dataset 0x404A000C TLR I CANOPEN APS CONFIG LOCK Configuration is locked 0xC04A000D LR E CANOPEN APS PACKET LENGTH Invalid packet length 0xC04A000E LR E CANOPEN APS WATCHDOG PARAMETER Invalid parameter for watchdog supervision 0xC04A000FL LR E CANOPEN APS WATCHDOG ACTIVATE Failed to activate watchdog supervision 0xC04A0010 LR E CANOPEN APS PARAM QUEUE ELEMENT Invalid parameter for number of queue elements 0xC04A0011 LR
128. NODE 0x00000081L define CANOPEN SLAVE SET NMT STATE RESET CO 0x00000082L struct CANOPFE SLAVE SET NMT STATE REO DATA Ttag TLR UINT32 ulNmtState NMT state KKK IK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k k ck ckck ck ck ck ck ck ck ck ck ckckckckck ck type of lt code gt CANOPEN SLAVE PACKET SET NMT STATE REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET NMT STATE REO Ttag CANOPEN SLAVE PACKET SET NMT STATE REO T struct CANOPEN SLAVE PACKET SET NMT STATE REO Ttag TLR PACKET HEADER T tHead packet header y CANOPEN SLAVE SET NMT STATE REQ DATA Data packer data RK KK IK kk oko kk kk I kok kk kok kok kok kok kok Ck kk kk kk ok k kk kk kk kk kk kk kk kk kk kk k k k k kk ke ke ke CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Description 115 191 Structure Information CANOPEN_SLAVE_PACKET_SET_NMT_STATE_REQ_T Type Request Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest
129. NTIFY needs to be used ASCII queue name Description QUE_CANOPENAPS Name of the APS Task process queue Table 42 APM Task Process Queue The returned handle has to be used as value ulDest in all request packets to be sent to the AP Task This handle is the same handle that has to be used in conjunction with the macros like TLR QUE SENDPACKET FIFO LIFO for sending a packet to the AP Task CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 5 1 1 75 191 CANOPEN APS GET STATE REQ CNF Get State of AP Task This request can be used by the user application to get status information from the AP Task Packet Structure Reference typedef struct CANOPEN_APS_PCK_GET_STATE CANOPI EO Ttag SNL INES IC GE SWAIN BHO IP struct CANOPEN INP IS ICIS Gi S DEERE OM Lag TIGR VNC INGE IE del Get state request EADER T tHead packet header Packet Description Structure Information CANOPEN APS PCK GET STATE REO T Type Request Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 0x20 Dest
130. N_APS_SET_CONFIGURATION_REQ CNF Set Configuration with the same meaning and in the same way For more information about these parameters see Table 45 Bus parameter structure CANOPEN SLAVE BUSPARAM DATA T on page 78 and the description given there Packet Structure Reference by the packet RK ok ok kok ok k kok ok k kk kk kk kk kk EZ 2 oko ko kk oko oko ko oko kok oko oko k kok kok kok kok k kok ko kc ko kc kc 2 2 22 2 2 2 2 2 2 I kk type of lt code gt CANOPEN SLAVE STD BUSPARAM DATA Ttag lt code gt typedef struct CANOPEN SLAVE STD BUSPARAM DATA Ttag CANOPEN SLAVE STD BUSPARAM DATA T type of lt code gt CANOPEN SLAVE typedef struct CANOPEN SLAVE EXT BUSPARAM DATA Ttag CANOPEN SLAVE EXT BUSPARAM DATA T S u XI type of lt code gt CANOPEN SLAVE BUSPARAM DATA Ttag lt code gt typedef struct CANOP SLAVE BUSPARAM DATA Ttag CANOPEN SLAVE BU PARAM DATA T T BUSPARAM DATA Ttag lt code gt m Common configuration flags x define CANOPEN SLAVE COMMON FLAG CFG EXT MODE 0x10000000L
131. OPE SLAVE SEND EMCY REO DATA Ttag TLR UINT16 usErrorCode TLR UINT8 abManErrorCode CANOPEN SLAVE EMCY DATA SIZE TLR UINT8 bErrorRegister hi RK IK IK IK kk I kok kok kok kok kok kok kok kok kok kok kok kok k kk kk k kok kk kk kk kk kk kk k ck k ck kk k k k k I 2 2 2 2 22 2073 type of lt code gt CANOPEN SLAVE PACKET SEND EMCY REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SEND EMCY REO Ttag CANOPEN SLAVE PACKET SEND EMCY REO T struct CANOPEN SLAVE PACKET SEND EMCY REO Ttag TLR PACKET HEADER T tHead packet header CANOPEN SLAVE SEND EMCY REO DATA T tData packet request data s EPA KK KK IK kk kk kk kk kk kk kok kok k kk Ck k k kok k kok kk kk kk kk kk kk kk kk kk kk ck ck ck ck k ck k ck k ck ck ck ck ck ck ck ck ck ck ck ok ke CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 108 191 Packet Description Structure Information CANOPEN SLAVE PACKET SEND EMCY REO T Type Reguest Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination
132. PEN SLAVE SETUP PDO INDICATION REQ CNF Setup PDO x x x Indication 5 2 24 CANOPEN SLAVE RECEIVE PDO IND RES Receive PDO Indication x X X Table 51 Packets of CANopen Slave Protocol Stack V3 and Restrictions of Usage CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 87 191 5 2 1 CANOPEN SLAVE REGISTER REQ CNF Register Application This packet is used in order to register to the CANopen slave task After this reguest is performed successfully indication packets are sent from the CANopen slave task to the source gueue of this reguest packet Note Use this packet only when working with linkable object modules It has not been designed for usage in the context of loadable firmware Note This packet is used by the AP task only and will not be routed from the user application to the CANopen Slave task Packet Structure Reference KKK KK k k k k k k kk k k k k k k k k k k k k k k k k k k k ck ck k k k ck ck ck 2 22 I 22 2 2 ok type of lt code gt CANOPEN SLAVE REGISTER REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE REGISTER REO DATA Ttag CANOPEN SLAVE REGISTER REO DATA T struct CANOPEN SLAVE REGISTER REO DATA Ttag TLR UINT8 bReserved
133. Queue Handle of CANopen slave Task Process QUE_CANOPEN Queue SLV ulSrc UINT32 0 2774 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process ulSrcId UINT32 ulAPSS0Id Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 8 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x2918 CANOPEN_SLAVE_SEND_EMCY_REQ Command ulExt UINT32 O Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN_SLAVE_SEND_EMCY_REQ_DATA_T usErrorCode UINT16 Emergency Error Code abManError UINTS Area for manufacturer specific error codes Code 5 bErrorRegist UINT8 Bit mask See Table 65 Error Register er Table 66 CANOPEN SLAVE PACKET SEND EMCY REO T Send Emergency Message Request CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 109 191 Packet Structure Reference RK k kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok k kok k kok k kk kk kk kk kk kk kk kk k ck k ck k k k ck ck ck ck ok ck ok sk ok ke ek f type of lt code gt CANOPEN SLAVE PACKET
134. REPRE 102 Table 62 Bit field ulFlags t aget Sedo ee ee Eae get cud d s Pk Eee ced ede e a osy eed aee Tode mee qe edt toco due EEN 103 Table 63 CANOPEN SLAVE PACKET STATE CHANGE RES T Change of State Response 105 CANopen Slave Protocol API DOC111 001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Appendi Table 64 Table 65 Table 66 Table 67 Table 68 Table 69 Table 70 Table 71 Table 72 Table 73 Table 74 Table 75 Table 76 Table 77 Table 78 Table 79 Table 80 Table 81 Table 82 Table 83 Table 84 Table 85 Table 86 Table 87 Table 88 Table 89 Req Table 90 Table 91 Table 92 Table 93 Table 94 Table 95 Table 96 Table 97 Table 98 Table 99 Table 100 Table 101 Table 102 Table 103 Table 104 Table 105 Table 106 Table 107 Table 108 Table 109 Table 110 Table 111 Table 112 Table 113 Table 114 Table 115 Table 116 Table 117 Table 118 Table 119 Table 120 Table 121 Table 122 CANopen
135. RK k kok ok kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok 2 kok kk kk kk kk kk kk k ck k ck k ck k ck k k k I 2 2 2 2 Packet Description Structure Information CANOPEN SLAVE PACKET STARTSTOP CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSS0Id Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched VOId ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task els UINT32 0x00002903 CANOPEN SLAVE STARTSTOP CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change tData structure CANOPEN SLAVE STARTSTOP CNF DATA T ulMode UINT32 Depending on this assignment communication is either started or stopped 0 Stop CANopen 1 Start CANopen Table 55 CANOPEN SLAVE PACKET STARTSTOP CNF T Start Stop Communication Confirmation CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013
136. Released Public Hilscher 2011 2013 The Application Interface 135 191 5 2 14 CANOPEN SLAVE RECV RXPDO IND RES Receive RxPDO Indication This packet indicates the the arrival of new process data from a communication partner CANopen Master or a Slave i e the reception of one or more PDOs Sending a response does not send new telegrams or execute other reactions The packet can simultaneously indicate requests of the communication partner for up to 16 RxPDOs whose numbers are transmitted by the members of array aulRecvRxPdoNumber of the request packet The 16 RxPDOs will be processed separately and for each the resulting status code success error will be stored in the parameter array aulRecvRxPdoResult of the indication packet The response packet does not have any parameters PDO communication works based on the producer consumer model the CANopen Slave acts as a consumer here the communication partner acts as producer For details of the protocol see the lower part of Figure 18 CANopen PDO Protocol Indication there relates to the CANOPEN_SLAVE_RECV_RXPDO_IND packet and Response to the CANOPEN_SLAVE_RECV_RXPDO_RES packet Application Objects Figure 18 CANopen PDO Protocol CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 136 191 kk kok kok kok kok kk kok kok kok kok ko
137. S EE 183 6 2 Codes of the CANopen Slave Task eee eee eee eee ee 00000 ee eee nano nennen 185 6 2 1 Error Messages ss oan ani meer eee Ab ian Siena 185 6 3 Godes ofF GAN D F Sk Rs ee ana een serere tate pee etre ee ene En EET 187 6 4 CodeS OF OD V EE 187 7 Appendix 2 EE 188 PN CEstorlabl68S 5 3ue ie een eu na e oe Bet beoetuecs ther iedob Bebes cou lode obo 188 TZ EiSt ot EMgures iit meet eg atte etus Leti asi Eee tA M ela Uds ee Che Lee LM aget ubt cect aid 190 TE E O o A E 1 EE E I LM 191 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 4 191 1 Introduction 1 1 Abstract This manual describes the application interface of the CANopen Slave stack with the aim to support and lead you during the integration process of the given stack into your own application Base of the development of the stack itself is the Hilscher s Task Layer Reference Programming Model It is a description of how to program a Task in general which is defined as a combination of appropriate functions belonging to the same type of protocol layer It furthermore defines of how different Tasks have to communicate with each other in order to exchange their layer information in between The reference model is commonly used by all programmers at Hilscher and shall be used by you as well when writing your Application Task on top of the stack
138. SEND EMCY CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SEND EMCY CNF Ttag CANOPEN SLAVE PACKET SEND EMCY CNF SETUCE LERNOPENESTAVEFPACKETZSENDEREMEYECENEF TEA TLR_PACKET_HEADER_T tHead packet header 4 RK IK IK kk I I kok kok kok kok kok kok kok k kok I kok kk kk kk kk k ck k ck kk k ck k ck k ck k ck k k k k ck ck ok sk ok ke Packet Description Structure Information CANOPEN SLAVE PACKET SEND EMCY CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Oueue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSS0Id Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched vOld ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes ofthe CANopen Slave Task m UINT32 92919 CANOPEN_SALVE_SEND_EMCY_CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change Table 67 CANOPEN SLAVE PACKET SEND EMCY CNF T Send Emergency Message Confirmation C
139. SET CONFIGURATION REO DATA Ttag CANOPEN APS SET CONFIGURATION REO DATA T define CANOPEN APS SYS FLAG COM CONTROLLED RELEASE 0x00000001L Automatic start ey define CANOPEN APS SYS FLAG IO STATUS ENABLED 0x00000002L Not supported p define CANOPEN APS SYS FLAG IO STATUS 32 BIT 0x00000004L Not supported s define CANOPEN APS SYS FLAG ADDRESS SWITCH 0x00000010L Switch for address define CANOPEN APS SYS FLAG BAUD SWITCH 0x00000020L Switch for baud CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 82 191 define CANOPEN APS WD OFF 0x00000000L Watchdog disabled define CANOPEN_APS_WD_MIN_TIMEOU 0x00000014L Minimum watchdog define CANOPEN_APS_WD_MAX_TIMEOU 0x0000FFFFL Maximum watchdog define CANOPE SLAVE MIN SLAVE NODE ID zi define CANOPFE SLAVE MAX SLAVE NODE ID L27 define CANOPEN_SLAVE_CFG_BAUD_1000 0x00000000L 1MBaud DA define CANOPEN SLAVE CFG BAUD 800 0x00000001L 800kBaud define CANOPEN SLAVE CFG BAUD 500 0x00000002L 500kBaud define CANOPEN SLAVE CFG BAUD 250 0x00000003L 250
140. SK 0x00000010L define CANOPEN_SLAVE_EVENT_SEND_EMCY_MSK 0x00000020L define CANOPEN_SLAVE_EVENT_RESERVED_MSK OxFFFFFFCOL struct CANOPEN SLAVE SET EVENTS INDICATED REO DATA Ttag TLR UINT32 ulEventsIndicated RK IK IK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk I kk k ck k ck k ck k ck k ck k ck k ck k ck k ck ck ck ck ck ck ck ck ck AI ke type of lt code gt CANOPEN SLAVE PACKET SET EVENTS INDICATED REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET EVENTS INDICATED REQ Ttag CANOPEN SLAVE PACKET SET EVENTS INDICATED REQ T struct CANOPEN SLAVE PACKET SET EVENTS INDICATED REO Ttag TLR PACKET HEADER T tHead packet header CANOPEN SLAVE SET EVENTS INDICATED REO DATA T tData packet data KKK KK IK kk I IK kok kok kok kok kok kok kok k kk kk kk k kok k kk kk kk kk kk kk kk kk kk kk kk k k k k k I 2 2 2 2 2 2 2 2 2073 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 140 191 Packet Description structure CANOPEN SLAVE PACKET SET EVENTS INDICATED REO T Type Reguest Area Variable Type Value Range Description tHead struc
141. SLAVE EXCHANGE DATA REO DATA Ttag CANOPEN SLAVE EXCHANGE DATA REO DATA T Structure of task command start stop CANopen request data struct CANOPEN SLAVE EXCHANGE DATA REO DATA Ttag TLR_UINT32 ulRecvIndex Object index for recv data 2 TLR_UINT32 ulRecvSubIndex OB S SSB AC Orme cv daran TLR_UINT32 ulRecvDataCnt Recv data count B TLR UINT32 ulSendIndex Object index for send Data E TLR_UINT32 ulSendSubIndex Object sub index for send Data TLR UINT32 ulSendDataCnt Send data count Ay TERZUTNTS abSendData CANOPEN SLAVE MAX SEND SUB IDX hi define CANOPEN SLAVE EXCHANGE DATA HEAD SIZE 6 sizeof TLR_UINT32 RK ok IK kk kk kok kok kok kok kok kok kok kok kok k k kok kok kok k kok kk kk kk kk kk kk kk kk k ck k ck k ck k k k k I 2 2 2 2 type of lt code gt CANOPEN SLAVE PACKET EXCHANGE DATA REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET EXCHANGE DATA REO Ttag CANOPEN SLAVE PACKET EXCHANGE DATA REO T Structure of task command exchange data reguest struct CANOPEN SLAVE PACKET EXCHANGE DATA REO Ttag u TLR_PACKET_HEADER_T tHead packet header A CANOPEN SLAVE EXCHANGE DATA REO DATA tData VAS packen request daran
142. SLAVE PACK SETUP PDO INDICATION CNF T Setup PDO Indication Confirmation 166 CANOPEN SLAVE PACKET RECEIVE PDO IND T Receive PDO Indication esee 168 CANOPEN SLAVE PACKET RECEIVE PDO RES T Receive PDO Response sss 169 tSwitchValue Structure of Switch Value set uuuuussesssssseeenensnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnnnnnnn nn nnne ent ena nnn 172 RCX SET HW SWITCH VALUES REO T Set Hardware Switch Values Request eee 173 RCX SET HW SWITCH VALUES CNF Confirmation to Set Hardware Switch Values Request 174 Protocol Parameter IDs three eta Ce ge ihv ve ved uk EF rre Ed E lungen 176 Common error scenarios and error codes to use cccccccccccseessececececeaseaseceeeeeseaueaseceeeeeseaueaseeeeeeeseaueneeeeasees 176 RCX SET FW PARAMETER REO T Set Value of the Firmware Parameter Request 177 RCX SET FW PARAMETER CNF T Confirmation to the Set Value of the Firmware Parameter Request 178 RCX GET FW PARAMETER REO T Get Firmware Parameter ReguesSt eee 179 RCX GET FW PARAMETER CNF Get Firmware Parameter Response eee een 180 Error Messages of the AP Task iiiter trt Debe cp redet Res renden an pas pre 184 Error Messages of the CANopen Slave Task sssssssseeeeene nennen nennen nnne nennen nnns 187 Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public
143. SPARAM DATA T are described in Table 36 Standard bus parameter structure CANOPEN_SLAVE_STD_BUSPARAM_DATA_T on page 69 and in Table 39 Extended bus parameter structure CANOPEN_SLAVE_EXT_BUSPARAM_DATA_T on page 71 The following table on page 80 explains the meaning of the CANopen Flags in a more detailed manner CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 80 191 Explanation of Parameter ulCanOpenFlags Bit Name Comment Applicable Applicable for for Standard Extended Mode Mode 0 29 bit identifier Currently 29 bit identifiers are not supported x x DISABLED ENABLED Therefore set this value to 0 4 Evaluate Vendor ID The ulVendorId parameter provides the value for X DISABLED ENABLED the Vendor ID entry in the object dictionary of the CANopen slave Object 0x1018 sub index 1 if bit 4 in parameter ulCanopenFlags is set Otherwise the vendor ID is set to zero 5 Evaluate Product Code The ulProductCode parameter provides the value X DISABLED ENABLED for the product code entry in the object dictionary of the CANopen slave Object 0x1018 sub index 2 if bit 5 in parameter ulCanopenFlags is set Otherwise the product code is set to zero 6 Evaluate Serial Number The ulSerialNumber parameter provides the value x DISABLED ENABLED for the serial number entry in the obje
144. Set Value of the Firmware Parameter Request CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 5 3 3 Firmware Parameter 179 191 RCX GET FW PARAMETER REQ CNF Get the Value of the This packet delivers the current value of the chosen firmware parameter i e hardware switch value address or Name of Station etc The data area of the packet is field bus specific and is defined using TLV Tag ParameterID Length Value format One parameter can be requested with each packet If the firmware uses a different parameter than the one set by RCX SET FW PARAMETER R EQ e g the hardware switch value changed during runtime which can not be applied by the firmware in runtime the RCX GET FW PARAMETER CNF returns the parameter currently used by the firmware and not the one that was set Packet Structure Reference typedef struct typedef struct TLR_PACKET_HEADER_T tHead RCX GET FW PARAMETER REO DATA T tData RCX GET FW PARAMETER REO T Packet Description TLR UINT32 ul RCX GET FW PA ParameterID RAMETER REO DATA T RCX GET FW PARAMETER REO DATA Ttag RCX GET FW PARAMETER REO Ttag packet header structure RCX GET FW PARAMETER REO T Type Regu
145. Source End Point Identifier untouched V0O0Id ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2905 CANOPEN SLAVE INITIALIZE CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change tData Structure CANOPEN SLAVE INITIALIZE CNF DATA T ulReserved UINT32 0 Reserved for further use set to zero Table 57 CANOPEN SLAVE PACKET INITIALIZE CNF T Initialization of CANopen Slave Confirmation CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 96 191 5 2 4 CANOPEN SLAVE EXCHANGE DATA REQ CNF Exchange Data This packet can be used to exchange send and receive object data with the CANopen network It can be used instead of exchanging data with the input and output image of the DPM With each packet data of one receive object can be read and data of one send object can be written This packet is only applicable in Standard Mode Packet Structure Reference RK IK IK kk kk ok kok kok kok kok kok kok kok kok kok kok k k kok k k kok k kk kok kk k ck kk kk kk k ck k ck k ck k k k k k kk type of lt code gt CANOPEN SLAVE EXCHANGE DATA REO DATA Ttag lt code gt typedef struct CANOPEN
146. TLR UINT32 ulSendDataCnt TLR_UINT8 abRecvData define CANOPEN SLAVE EXCHANGE DATA CNF DATA Ttag Object index for recv data Object sub index for recv data Recv data count Bl Object index for send Data wf Object Bibloy ilistsles ror Send Data y Send data count E CANOPE N SLAVE MAX RECV SUB IDX DATA HEAD SIZE 6 sizeof TLR UINT32 RK KK IK kk kk kk kk kk kok kok kok k Ck Ck kk kk kk k Ck Ck k Ck kk kk kk kk kk kk kk kk kk ck ck k ck k ck k ck k ck ck ck ck ck ck ck ck ck ck ko ke type of lt code gt CANOP EN SLAV E PACKET EXCHANGE DATA CNF Ttag lt code gt typedef struct CANOPEN SLAVE P ACKET EXCHANGE DATA CNF Ttag CANOPEN SLAVE PACKET EXCHANG E DATA CNF T Structure of task command exchange data confirmation struct CANOPEN SLAVE PACKET EX CHANGE DATA CNF Ttag TLR_PACKET_HEADER_T tHead packet header CANOPEN SLAVE EXCHANG E DATA CNF DATA eDattap ASO ACRO Comiriliameiciwom Cleica A KKK k kok kok ok kok ok kok kok kok kok kok kok kok kok kok kok kok kok kok kok k k kok k kk kk k ck k ck kk kk k ck k ck kk k k k k k k kk CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hi
147. The Application Interface 93 191 5 2 3 CANOPEN SLAVE INITIALIZE REQ CNF Initialization of CANopen Slave This command is used in order to reset and initialize the CANopen slave You can read in section 4 4 1 NMT Slave State Machine what happens in detail during the initialization process of the CANopen Slave protocol stack If you are interested to know in detail what happens during the initialization process of the CANopen Slave protocol stack you should read section 4 4 1 NMT Slave State Machine context of loadable firmware we recommend to use config reload instead Note This command does not delete configuration databases If the CANopen Slave is configured by configuration database this configuration is reloaded again after the initialize command is completed Note Use this packet preferably when working with linkable object modules In the Packet Structure Reference BKK KK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k 2 k 2 I I I ck ck ck ck ck ck ck ck ck ck ck ck ok sk ok type of lt code gt CANOPEN SLAVE INITIALIZE REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE INITIALIZE REO DATA Ttag CANOPEN SLAVE INITIALIZE REO DATA T Structure of task command delete configuration CANopenrequest data struct CANOPEN SLAVE INITIALIZE REO DATA Ttag TLR_UINT32 ulReserved Reserved f
148. Ttag CANOPEN SLAVE SET BUSPARAM REQ DATA T RK IK ok k kk Ck kk oko ok ok kk kk kk kk kk kk kk Ck kok ok kok kok kok kok kok kok kok kok kok kok ck k ck k ck k ck k ck ck ck k ck ck ck ck ck ck ck I 2 2 25 type of lt code gt CANOPEN SLAVE BUSPARAM DATA Ttag lt code gt typedef struct CANOPEN SLAVE BUSPARAM DATA Ttag CANOPEN SLAVE GET BUSPARAM CNF DATA T RK IK IK kk kk kk kk EZ kk Ck kk Ck Ck kk Ck k kok Ck k kk kk kk 2 kk kk kk kk kk kk kk kk kk k ck k ck k ck k ck ck ck ck ck ck ck ck ck ok sk ok ke CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 120 191 Packet Description Structure Information CANOPEN_SLAVE_PACKET_SET_BUSPARAM_REQ_T Type Request Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 OUE CANOPEN Destination Queue Handle of CANopen slave Task Process SLV Oueue ulSrc UINT32 0 2 1 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Proces
149. UINT32 0x20 Destination Queue Handle of CANopen slave Task Process QUE CANOPEN Queue SLV ulSrc UINT32 0 2 1 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x0000291A CANOPEN SLAVE SET NMT STATE REO Command ulExt UINT32 0 Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN SLAVE NODE NMT COMMAND REO DATA T ulNmt State UINT32 1 2 128 130 State requested to be set See Table 72 NMT States Table 73 CANOPEN_SLAVE_PACKET_SET_NMT_STATE_REQ_T Set NMT State Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 116 191 Pk kk kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok I I kk kk kk kk k ck k k k k k ck ck ok ck ok sk ok ke type of lt code gt CANOP EN SLAVE SET NMT STATE CNF DATA Ttag lt code gt
150. VE SEND TXPDO REQ Send TxPDO Request This packet allows to send one or more TxPDOs to a communication partner CANopen Master or Slave on the CANopen network using the Write PDO Protocol see upper part of Figure 16 CANopen PDO Protocol Application Objects Figure 16 CANopen PDO Protocol This can be done simultaneously for up to 16 TXPDOs whose numbers must be assigned to the members of array aul RecvRxPdoNumber of the request packet The 16 TxPDOs will be processed separately and for each the resulting status code success error will be stored in array aulRecvRxPdoResult of the confirmation packet Packet Structure Reference RRR RR KK KK k kk RR RR ck ck ck ck ck ck ck ck kk ke x ke x type of lt code gt CANOPEN SLAVE SEND TXPDO REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE SEND TXPDO REQ DATA Ttag CANOPEN SLAVE SEND TXPDO REO DATA T define CANOPEN SLAVE SEND TXPDO REO MAX 16 struct CANOPEN SLAVE SEND TXPDO REO DATA Ttag TLR UINT32 aulSendTxPdoNumber CANOPEN SLAVE SEND TXPDO REQ MAX type of lt code gt CANOPEN SLAVE PACKET SEND TXPDO REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SEND TXPDO REO Ttag CANOPEN SLAVE PACKET SEND TXPDO REO T struct CANOPEN SLAVE PACKET SEND TXPDO REO Ttag TLR_PACKET_HEADER_T tHead packet header CANOPEN SL
151. VE STD BUSPARAM DATA Ttag LR UINT32 ulVendorId Vendor ID LR UINT32 ulProductCode Product code LR_UINT32 ulSerialNumber Serial number LR UINT32 ulRevisionNumber Revision number LR UINT32 ulDeviceType SEED SEG CMNISIS C A TRUS DOBA 6192101010 9 97 5 Salze Oi Cloqjece 2OOG LR_UINT8 bObject2001Size f Siw MOO DE SZK A LR UINT8 bObject2002Size Quse ot Gljece 2002 i ER GINTS JeoleJec200sSazep AS Sure or Object 2003 Ib IVINS ISON TSC 2200Siwep LES EZ METEO o CTS 2200 dA LR UINT8 bObject2201Size f Saws Ht oec 2201 LR UINT8 bObject2202Size J S za Olojece 2202 LR INI Jooloect220s9uzep N Gize Oi Olojecte 2203 LR_UINT16 usNumOfRxPdo Number of receive PDOs LR_UINT16 usNumOfTxPdo Number of transmit PDOs LR_UINT32 aulReserved 2 Reserved set to zero hi struct CANOPEN SLAVE EXT BUSPARAM DATA Ttag LR UINT16 usNumOfRxPdo Number of receive PDOs LR UINT16 usNumOfTxPdo Number of transmit PDOs LR UINT32 aulReserved 9 Reserved set to zero hg BRK KK KKK k k k k k k k k k k k k k k k k KR type of lt code gt CANOPEN APS SET CONFIGURATION REO DATA Ttag lt code gt typedef struct CANOPEN APS
152. _SLAVE_ID_IN_USE Identifier already in use 0xC0430029 LR_E_CANOPEN_SLAVE_INHIBIT Service is inhibited CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Status Error Codes Overview 187 191 Definition Value Description 0xC043002A LR E CANOPEN SLAVE TX OVERRU Transmit overrun 0xC043002B LR E CANOPEN SLAVE RX OVERRU Receive overrun 0xC043002C LR_E_CANOPEN_SLAVE_ERROR_WARNING CANopen is in error warning state 0xC043002D LR_E_CANOPEN_SLAVE_RECV_PDO_REQ Request receive PDO failed 0xC043002E LR_E_CANOPEN_SLAVE_NUM_OF_RX_PDO_PARAMETER Invalid parameter for number of receive PDO 0xC043002F LR_E_CANOPEN_SLAVE_NUM_OF_TX_PDO_PARAMETER Invalid parameter for number of send PDO 0xC0430030 LR_E_CANOPEN_SLAVE_HB_CONSUMER_PARAMETER Invalid parameter for number of heartbeat consumer 0xC0430031 LR_E_CANOPEN_SLAVE_SEND_TIME_STAMP Failed to send timestamp message Table 122 Error Messages of the CANopen Slave Task 6 3 Codes of CAN DL Task See separate CAN DL Task documentation reference 5 section 5 Status Error Codes Overview 6 4 Codes of ODV3 See separate Object Dictionary V3 documentation re
153. a The input block holds the process data image received from the network whereas the output block holds data sent to the network Process data transfer through the data blocks can be synchronized by using a handshake mechanism configurable If in uncontrolled mode the protocol stack updates the process data in the input and output data image in the dual port memory for each valid bus cycle No handshake bits are evaluated and no buffers are used The application can read or write process data at any given time without obeying the synchronization mechanism otherwise carried out via handshake location This transfer mechanism is the simplest method of transferring process data between the protocol stack and the application This mode can only guarantee data consistency over a byte For the controlled buffered mode the protocol stack updates the process data in the internal input buffer for each valid bus cycle Each IO block uses handshake bits for access synchronization Input and output data block handshake operates independently from each other When the application toggles the input handshake bit the protocol stack copies the data from the internal buffer into the input data image of the dual port memory Now the application can copy data from the dual port memory and then give control back to the protocol stack by toggling the appropriate input handshake bit When the application driver toggles the output handshake bit the protocol stack cop
154. able Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 QUE_CANOPEN Destination Queue Handle of CANopen slave Task Process SLV Queue ulSrc UINT32 0 2774 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 0 See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x29AA CANOPEN_SLAVE_SET_WATCHDOG_FAIL_REQ Command ulExt UINT32 O Reserved ulRout UINT32 x Routing Information Table 106 CANOPEN_SLAVE_PACKET_SET_WATCHDOG_FAIL_REQ_T Set Watchdog Fail Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 163 191 Packet Structure Reference RK IK IK kk IK I kok kok kok kok kok kok kok kok kok kok k k kok k kk 2 22 22 kk 2 2 22 kk kk kk kk k k k k ck ck ok sk ok ke type of lt code gt CANOPEN SLAVE PACKET SET WATCHDOG FAIL CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET WATCHDOG FAIL CNF Ttag CANOPEN SLAVE PACKET SET W
155. ace Manual 0x0022 UINT16 usReserved Reserved Set to 0 0x0024 UINT32 ulHostWatchdog Host Watchdog Joint Supervision Mechanism Protocol Stack Writes Host System Reads CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 33 191 0x0028 UINT32 ulErrorCount Error Count Total Number of Detected Errors Since Power Up or Reset 0x002C UINT32 ulErrorLogind Error Log Indicator Total Number Of Entries In The Error Log Structure not supported yet 0x0030 UINT32 ulReserved 2 Reserved Set to 0 Table 21 Common Status Structure Definition Common Status Block Structure Reference typedef struct NETX COMMON STATUS BLOCK Ttag UINT32 ulCommunicationCOS UINT32 ulCommunicationState UINT32 ulCommunicationError UINT16 usVersion UINT16 usWatchdogTime UINT16 ausReserved 2 UINT32 ulHostWatchdog UINT32 ulErrorCount UINT32 ulErrorLogInd UINT32 ulReserved 2 union ETX MASTER STATUS T tMasterStatus for master implementation UINT32 aulReserved 6 otherwise reserved unStackDepended NETX COMMON STATUS BLOCK T Communication Change of State All Implementations The communication change of state register contains information about the current operating status of the communication channel and its firmware E
156. acket ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulcmd UINT32 0x2901 CANOPEN_SLAVE_REGISTER_CNF Command ulExt UINT32 O Extension reserved ulRout UINT32 x Routing Information do not change tData Structure CANOPEN SLAVE APP REGISTER CNF DATA T bReserved UINT32 0 Reserved for further use set to zero Table 53 CANOPEN_SLAVE_PACKET_APP_REGISTER_CNF_T Register Application Confirmation CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 90 191 5 2 2 CANOPEN SLAVE STARTSTOP REQ CNF Start Stop CANopen Network This packet starts or stops the communication with the CANopen network depending on the value of the ulmMode parameter If the ulMode parameter has the value 0 and the current NMT State is either Pre operational state or Operational state the NMT State will switch to Stopped state If the ulMode parameter has the value 1 and the current NMT State is either Pre operational state or Stopped state the NMT State will switch to Operational state The BUS ON BUS OFF flag is set accordingly ulMode 0 BUS OFF ulMode 1 BUS ON For more information about NMT States see section 4 4 1 NMT Slave State Machine Packet Structure Reference RK k kk ok kok kk kok kok kok kok kok kok kok kok k k kok k kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k ck ck k k ck ck ck ck ok sk
157. acket data 2 REOX SETCHW SWETCHI VALUES CNP oy define RCX_SET_HW_SWITCH_VALUES_CNF_PACKET_SIZE sizeof RCX_SET_HW_SWITCH_VALUES_CNF_T Packet Description structure RCX SET HW SWITCH VALUE CNF T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination gueue handle do not touch ulSrc UINT32 Source Queue Handle do not touch ulDestId UINT32 0 Destination End Point Identifier Not in use set to zero for compatibility reasons ulSrcId UINT32 0 2 1 Source End Point Identifier do not touch ulLen UINT32 O Packet data length in bytes ulld UINT32 0 2 1 Packet identification untouched ulSta UINT32 Error code Either TLR S OK or TLR E FAIL ulCmd UINT32 RCX_SET_HW_SWITCH_VALUES_CNF Command ulExt UINT32 0 Extension untouched ulRout UINT32 x Routing do not touch Table 114 RCX SET HW SWITCH VALUES CNF Confirmation to Set Hardware Switch Values Request CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 175 191 5 3 2 RCX SET FW PARAMETER REQ CNF Set the Value of the Firmware Parameter This packet informs the stack that a new value of the chosen firmware parameter should be set i e hardware switch value addres
158. acket header Sf n Kk KK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k k I k 2 2 2 I ck ck ck ck ck ck ck ck ck ck ck ck ck ck ok ko k Packet Description structure CANOPEN SLAVE PACKET GET IO INFO REO T Type Reguest Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle QUE_CANOPEN SLV ulSrc UINT32 0 2 1 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 0 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x292A CANOPEN_SLAVE_GET_IO_INFO_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 90 CANOPEN_SLAVE_PACKET_GET_IO_INFO_REQ_T Get I O Info Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Rele
159. ag RCX SET FW PARAMETER CNF DATA T typedef RCX SET FW PARAMETER CNF Ttag TLR PACKET HEADER T tHead packet header RCX SET FW PARAMETER CNF DATA T tData packet data RCX SET FW PARAMETER CNF T define RCX SET FW PARAMETER CNF PACKET SIZE sizeof RCX SET FW PARAMETER CNF T Packet Description structure RCX SET FW PARAMETER CNF T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination gueue handle of application task process gueue ulSrc UINT32 Source Queue Handle of PNSIF task process queue ulDestId UINT32 0 Destination End Point Identifier ulSrcId UINT32 0 2 4 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet data length in bytes N depends on the number of used switch values ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 Status ulCmd UINT32 0x00002F87 RCX_SET_FW_PARAMETER_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 118 RCX_SET_FW_PARAMETER_CNF_T Confirmation to the
160. ameters are already configured 0xC043000B LR E CANOPE SLAVE LOCAL NODE ID Invalid Node ID for CANopen slave 0xC043000C LR E CANOPEN SLAVE BAUDRATE Invalid Baudrate 0xC043000D LR E CANOPEN SLAVE 29BIT SELECTOR Invalid parameter for 29 bit selector 0x4043000F TLR I CANOPEN SLAVE ALREADY IN STATE Slave is already in requested state 0xC0430010 LR E CANOPEN SLAVE SEND EMCY Send emergency telegram failed 0xC0430011 LR E CANOPEN SLAVE INIT LIB Failed to initialize CANopen library 0xC0430012 LR E CANOPEN SLAVE ERROR PASSIVE CANopen is in error passive state 0xC0430013 LR E CANOPEN SLAVE BUS OFF CANopen is in bus off state 0xC0430014 LR_E_CANOPE SLAVE_PUT_OBJECT_DATA Failed to write object data CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Status Error Codes Ov
161. annel functions Common Status Block holds information common to all protocol stacks Extended Status Block holds protocol specific network status information This section describes a procedure how to obtain useful information for accessing the communication channel s of your netX device and to check if it is ready for correct operation Proceed as follows 1 2 Start with reading the channel information block within the system channel usually starting at address 0x0030 Then you should check the hardware assembly options of your netX device They are located within the system information block following offset 0x0010 and stored as data type UINT16 The following table explains the relationship between the offsets and the corresponding xC Ports of the netX device Offset Port 0x0010 Hardware Assembly Options for xC Port 0 0x0012 Hardware Assembly Options for xC Port 1 0x0014 Hardware Assembly Options for xC Port 2 0x0016 Hardware Assembly Options for xC Port 3 Check each of the hardware assembly options whether its value has been set to RCX HW ASSEMBLY CAN 0x0030 If true this denotes that this xCPort is suitable for running the CANopen protocol stack Otherwise this port is designed for another communication protocol In most cases xC Port 2 will be used for field bus systems while xC Port 0 and xC Port 1 are normally used for Ethernet communication CANopen Slave Protoco
162. ased Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 143 191 RK k kok kok kok kok kok kok kok kok kok kok kok kok kok k I kk kk kk kk kk kk kk kk kk kckck ck k k k k I 2 2 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE GET IO INFO CNF DATA Ttag lt code gt typedef struct CANOPEN SLAVE GET IO INFO CNF DATA Ttag CANOPEN SLAVE GET IO INFO CNF DATA T struct CANOPEN SLAVE GET IO INFO CNF DATA Ttag TLR_UINT32 ulRecvDataCnt TLR_UINT32 ulSendDataCnt 8 RK IK IK kk IK kok kok kok kok kok kok k I kk kk kk kk kk kk kk kk kk kk kk kk kk k ck k ck k ck k ck k ck k k k I 2 2 2 2 2 2 type of lt code gt CANOPEN SLAVE PACKET GET IO INFO CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET GET IO INFO CNE CANOPEN SLAVE PACKET GET IO INFO CNF T struct CANOPEN SLAVE PACKET GET IO INFO CNF Ttag TLR_PACKET_HEADER_T tHead CANOPEN SLAVE GET IO INFO CNF DATA T tData Ttag packet header PO packer cont irmarcioa datas kk k ok ok kok kok kok kok kok kok kok kok kok kok kok kok kok k k kok k kok kk kk kk kk kk k ck kk kk kk kk k ck k k k k k ok ko ke Packet Description structure CANOPEN SLAVE PACKET GET IO INFO CNF T Type Co
163. ask The CANopen Slave Task is the CANopen Slave stack implementation It is responsible for the protocol handling the communication to from CAN_DL layer and it is the counterpart of the AP Task The packets of the CANopen Slave task are described in section 5 1 2 CANOPEN APS SET CONFIGURATION REQ CNF Set Configuration CAN DL Task The CAN DL Task handles the interface of the XC CAN and is responsible for configuration events and sending and receiving of CAN Frames The CAN DL Task also provides its own API for low level programming on level 2 Data Link Layer of the OSI model of networking This is described in a separate manual namely reference 5 ODV3 Task The ODV3 task handles all SDO accesses i e acyclic accesses to the CANopen object dictionary as described in the CANopen specification section 9 5 p 79 see reference 2 CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 47 191 4 4 CANopen Basic Topics 4 4 1 NMT Slave State Machine Each NMT Slave device implements the NMT Slave state machine This state machine is displayed in Figure 7 NMT Slave State Machine below e i a Initialization Pre Operational Figure 7 NMT Slave State Machine After power on or a reset via CANOPEN SLAVE INITIALIZE REQ CNF Initialization of CANopen Slave and running through the initialization the
164. ata s KKK ok ok ok ok kok kok kok kok kok kok kok kok kok kok kok kok kok kok k 2 kk kk kk kk kk kk kk kk k ck k ck k k k k k k ok ko ke Packet Description structure CANOPEN SLAVE PACKET RECV RXPDO CNF T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 64 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x2925 CANOPEN SLAVE RECV RXPDO CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE RECV RXPDO CNF DATA T Ar ROE an Array of Results of received RxPDOs su Table 84 CANOPEN_SLAVE_PACKET_RECV_RXPDO_CNF_T Confirmation to Receive RxPDO Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10
165. c purposes There is always a send and a receive mailbox Send and receive mailboxes utilize handshake bits to synchronize these data or diagnostic packages through the mailbox There is a pair of handshake bits for both the send and receive mailbox The netX operating system rcX only uses the system mailbox The system mailbox however has a mechanism to route packets to a communication channel A channel mailbox passes packets to its own protocol stack only 3 2 4 Send Mailbox The send mailbox area is used by protocols utilizing a non cyclic data exchange mechanism Another use of the mailbox system is to provide access to the firmware running on the netX chip itself The send mailbox is used to transfer non cyclic data to the network or to the protocol stack The size is 1596 bytes for the send mailbox in the default memory layout The mailbox is accompanied by counters that hold the number of packages that can be accepted 3 2 5 Receive Mailbox The receive mailbox area is used by protocols utilizing a non cyclic data exchange mechanism Another use of the mailbox system is to provide access to the firmware running on the netX chip itself The receive mailbox is used to transfer non cyclic data from the network or from the protocol stack The size is 1596 bytes for the receive mailbox in the default memory layout The mailbox is accompanied by counters that hold the number of waiting packages for the receive mailbox CANopen Slave
166. ched ulDestId UINT32 ulAPSSOId Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched V0O0Id ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x0000291B CANOPEN_SLAVE_SET_NMT_STATE_CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change tData Structure CANOPEN_SLAVE_NODE_NMT_COMMAND_REQ_DATA_T ulNmtState UINT32 1 2 128 130 NMT State having really been set See Table 72 NMT States Table 74 CANOPEN_SLAVE_PACKET_SET_NMT_STATE_CNF_T Set NMT State Confirmation CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 117 191 5 2 9 CANOPEN SLAVE SET BUSPARAM REQ CNF Set Bus Parameters This packet can be applied for setting the bus parameters for the CANopen Slave Note Use this packet only when working with linkable object modules It is not designed for usage in the context of loadable firmware In the context of loadable firmware we recommend to use set configuration instead Note This request will be denied if the configuration lock flag is set All parameters used by this packet are also used CANOPE
167. confirmation data struct CANOPEN SLAVE INITIALIZE CNF DATA Ttag TLR_UINT32 ulReserved n Reserved fur further use RK KK IK kk kk kk I kk Ck Ck I kok k k kok kk kk Ck kok kk kk kk kk kk kk ck ck k ck k ck k ck k ck k ck ck ck ck ck ck ck ck ck ck ck kk type of code CANOPEN SLAVE PACKET INITIALIZE CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET INITIALIZE CNF Ttag CANOPEN SLAVE PACKET INITIALIZE CNF T Joos Fewewcicwis Oi task comand delers Com iejeiesicaoi Confirmation 57 struct CANOPEN_SLAVE_PACKET_INITIALIZE_CNF_Ttag TLR PACKET HEADER T tHead packet header A CANOPEN SLAVE INITIALIZE CNF DATA T tData packet confirmation data kk k k ok kok kk kok kok kok kok kok kok kok kok kok kok k kk kok k kk kk kk kk kk kk kk kk kk kk k ck k ck k ck k k k k ck ck kk Packet Description Structure Information CANOPEN SLAVE PACKET INITIALIZE CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSSOId Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL
168. ct dictionary of the CANopen slave Object 0x1018 sub index 4 if bit 6 in parameter ulCanopenFlags is set Otherwise the serial number is set to zero 7 Evaluate Revision The ulRevisionNumber parameter provides the X Number value for the revision number entry in the object DISABLED ENABLED dictionary of the CANopen slave Object 0x1018 sub index 3 if bit 7 in parameter ulCanopenFlags is set Otherwise the revision number is set to default 8 Evaluate Device Type X DISABLED ENABLED 9 Evaluate Object Size X DISABLED ENABLED 10 Evaluate PDO Count X DISABLED ENABLED 16 Send COS Synchronous No automatic transmission of TxPDOs in transmission x X Acyclic mode 0 else PDO sent automatically with start node DISABLED ENABLED and on data change with next SYNC 17 Send COS No automatic transmission of TxPDOs in transmission x X Manufacturer Spec mode 254 else PDO sent automatically with start DISABLED ENABLED node and on data change 18 Send COS Profile Spec No automatic transmission of TxPDOs in transmission x X DISABLED ENABLED mode 255 else PDO sent automatically with start node and on data change 25 Hold last state Hold last data in case of not operational else data is X X cleared 29 Extended mode flag The extended mode flag switches on and off the X X Extended Mode Table 47 Explanation of Parameter ulCanOpenFlags The following applies for filtering of 29 bit CANopen IDs only supported in Data Link Layer
169. d for future use CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 176 191 Protocol Parameter IDs provide the means of configuring the settings of a protocol stack as a whole e g the activation of features IDs and names used for identification or network address assignment settings The encoding of the protocol tag IDs is structured as follows OXPCCCCNNN where e P prefix bits 31 28 always 0x3 e CCCC protocol class bits 27 12 defined in the netX DPM Interface Manual 1 e NNN unique number bits 11 0 The following table shows the defined protocol specific Parameter IDs Protocol Parameter IDs Parameter Parameter ID Code Data Description Length PID_STATION_ADDRESS 0x30000001 4 Station address of device UINT32 PID BAUDRATE 0x30000002 4 Baud rate of device UINT32 PROFINET Name of Station String Name of Station STRING 240 Value for Explicit Device Identification UINT16 PID PN NAME OF STATION 0x30015001 240 PID ECS DEVICE IDENTIFICATION 0x30009001 4 PID_ECS_SCND_STATION_ADDRESS 0x30009002 4 Second Station Address UINT 16 Table 115 Protocol Parameter IDs Behavior of firmware while evaluating RCX_SET_FW_PARAMETER_REQ The following table shows how the firmware reacts in common error situations
170. e Red fields indicate the object cannot operate in this state 4 4 4 Events 4 4 4 1 NMT State Change Events NMT State Change Events happen every time the NMT Slave state changes For a description of the NMT Slave State Machine see section 4 4 1 NMT Slave State Machine on page 47 Various reasons may have caused this change of NMT state External request by the CANopen Master via NMT object for module control services This is the most usual case Internal request an application event initiated a module control service for instance a CANOPEN SLAVE SET NMT STATE REQ CNF Set NMT State request A hardware reset occurred The NMT State Change Event is related to the following packets of the CANopen Slave protocol stack CANOPEN SLAVE SET NMT STATE REQ CNF Set NMT State for setting the state of the NMT Slave State Machine from your application CANOPEN SLAVE NMT STATE CHANGE IND RES NMT State Change Indication for making your application aware of state changes in the NMT Slave State Machine CANOPEN SLAVE NMT COMMAND IND RES NMT Command Indication for enabling the host application to react to the requests for Module Control Services issued by the CANopen Master CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 53 191 4 4 4 2 Time Stamp Events The t
171. e 99 CANOPEN_SLAVE_PACKET_ERR_CTRL_EVENT_IND_T Error Control Event Indication CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 153 191 Packet Structure Reference RK k kok kok kok kok kok kok kok kok I kok k kk kk 2 kok k kok kk kk kk kk kk kk kk kk kk k k k ck k k ck ck I 22 22 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE PACKET NMT STATE CHANGE RES Ttag lt code gt typedef struct CANOPEN SLAVE PACKET ERR CTRL EVENT RES Ttag CANOPEN SLAVE PACKET ERR CTRL EVENT RES T SEUS CAN OE FIN STAVE PA KEE RA CTI EVER OA TLR PACKET HEADER T tHead packet header P kok kok ok ok kok ok kok kok kok kok kok kok kok kok kok kok kok kok k kk kk kk kk kk kk kok kk kk kk kk kk k k k k k ok sk ok ke Packet Description structure CANOPEN SLAVE PACKET ERR CTRL EVENT RES T Type Response Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet withi
172. e Node Guarding Protocol works as follows The NMT Master cyclically polls in order to check whether the NMT Slave is still present at the bus This polling is denominated as the guarding request Actually this is accomplished by sending a CAN remote frame to the NMT Slave The NMT Slave reacts by sending a CAN Data Frame with 1 Byte data The most significant bit is toggled every time i e it is O when it was 1 last time and vice versa Bits 0 to 6 are used to transmit the state to the NMT State This is illustrated in Figure 9 Node Guarding Protocol The time between two guarding requests of the Master is denominated as the guard time Node Guarding can take place during the following states of the slave Pre operational Operational Stopped CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 55 191 Node Guarding Protocol NMT Master NMT Slave Request Remote Frame Indication Bit 7 Bit 6 0 Confirmation Toggle bit Node State Response Request Remote Frame Indication Bit 7 Bit 6 0 Confirmation Toggle bit Response Indication SA Indication Node Guarding Life Guarding Event if guarding error Event Figure 9 Node Guarding Protocol Life Guarding Additionally the slaves try to detect possible failure of the Master If they do not receive guarding requests within an adjustable time they recognize this as failu
173. e Process Queue u eee 14 2 2 2 Meaning of Source and Destination related Parameters ssssssssssseeeeeeeees 14 2 3 Accessing the Protocol Stack via the Dual Port Memory Interface 15 2 3 1 Communication via Mailboxes eessseeesee eee nee nee enne ener inneren enne 15 2 3 2 Using Source and Destination Variables COrrecty r 16 2 3 3 Obtaining useful Information about the Communication Channel eene 20 2 4 Client Server Mechanism ee eee eee eee nene K0 KR KRK KK KKK AAR RKK KKK KAR RKK KKK 22 241 Application as Client 5 rtr Er sis na dune a ka ERR Rn PER ROS I SER ER ARTS A FRE E RH REPUESTOS 22 2 4 2 Application as Server eu Beet eier 23 3 DriudoulugM 24 3 1 Cyclic Data Input Output Data ssssseee enm emm enemies 24 3 1 1 Input Data Image hlerfeee 24 3 1 2 Process Data Output ur een ea facile revanedegn E EENE ANN a EEE 26 32 Acyclic Data MallbOX6S e nce oth ered tenes dels sie 27 3 2 1 General Structure of Messages or Packets for Non Cyclic Data Exchange men 28 32 2 Status amp Error Godes sere OE REGEM RH REIHE SER ET 3 2 3 Differences between System and Channel Mailboxes 3 2 4 Send MailboX een sn nn 3 2 5 Receive Mailbox near ann s o Save A ER En E han ia aana aaea
174. e netX firmware transition 3 c 4 Application netX N e e o Figure 5 Transition Chart Application as Server The netX firmware passes an indication packet through the mailbox The host application sends response packet to the netX firmware IND Indication lt gt Response CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 24 191 3 Dual Port Memory All data in the dual port memory is structured in blocks According to their functions these blocks use different data transfer mechanisms For example data transfer through mailboxes uses a synchronized handshake mechanism between host system and netX firmware The same is true for IO data images when a buffered handshake mode is configured Other blocks like the status block are read by the host application and use no synchronization mechanism Types of blocks in the dual port memory are outlined below e Mailbox transfer non cyclic messages or packages with a header for routing information e Data Area holds the process image for cyclic IO data or user defined data structures e Control Block is used to signal application related state to the netX firmware e Status Block holds information regarding the current network state e Change of State collection of flags that initiate execution of certain commands or signal a change of state 3 1 Cyclic Data Input Output Dat
175. ed remotely requested event driven change of date requested by application via packet Acyclic communication SDO Up and Download Server only Emergency message producer Timestamp producer consumer Functions Node guarding life guarding heartbeat 1 producer max 64 consumer netX 50 51 100 500 max 32 consumer netX 52 max 4 consumer netX 10 PDO Mapping NMT Slave SYNC protocol consumer Error behavior in state operational change to state pre operational no state change change to state stopped Baud rates 10 kBit s to 1 MBit s Automatic detection Data transport layer CAN Frames can be accessed by programming the CAN DL layer see reference 5 CAN Frame type 11 Bit 11 29 Bit layer 2 transparent Table 2 Technical Data Protocol Stack Firmware stack available for netX netX Available netX 10 yes netX 50 yes netX 51 yes since stack V3 3 1 netX 52 yes since stack V3 5 1 netX 100 netX 500 yes Table 3 Technical Data Available for netX CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 7 191 PCI DMA Features Parameter DMA Support for PCI targets yes Table 4 Technical Data PCI DMA Slot Number Features Devices Slot number supported for CIFX 50 CO CIFX 50E CO CIFX 70E CO
176. ed by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2938 CANOPEN_SLAVE_SEND_EMCY_IND Command ulExt UINT32 O Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN SLAVE SEND EMCY IND DATA T usErrorCode UINT16 Emergency Error Code see Table 68 Emergency Error Codes Variable usErrorCode abManError UINTS Area for manufacturer specific error codes Code 5 bErrorRegist UINT8 Bit mask See Table 69 Error Register er Table 70 CANOPEN SLAVE PACKET SEND EMCY IND T Send Emergency Message Indication CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 113 191 Packet Structure Reference type of lt code gt CANOPEN SLAVE PACKI END_EMCY_RES_Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SEND EMCY RES Ttag CANOPEN SLAVE PACKET SEND EMCY RES B E n struct CANOPEN SLAVE PACKET SENDLEMCY RES Ttag TLR_PACKET_HEADER_T tHead packet header vil Packet Description Structure Information CANOPEN SLAVE PACKET SEND EMCY RES T Type Response Area Variable Type Value Range Descriptio
177. ee section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2929 CANOPEN_SLAVE_SET_EVENTS_INDICATED_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 89 CANOPEN SLAVE PACKET SET EVENTS INDICATED CNF T Confirmation to Set Events Indicated Request CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 142 191 5 2 16 CANOPEN SLAVE GET IO INFO REQ CNF Get I O Info This packet can be used to retrieve the counts of received data Variable ulRecvDataCnt of confirmation packet and send data Variable ulSendDataCnt of confirmation packet in CANopen data communication Note This information is also part of the slave state see section 5 2 5 CANOPEN_SLAVE_STATE_CHANGE_IND RES Change of Task State Indication Packet Structure Reference RK KK HK ok k kok ok k kk kk kk oko kk kk I kok kok kok kok kok kok kok kok kok k I kk kk kk ok k kk kk kk kk kk kk k k ke ke type of lt code gt CANOPEN SLAVE PACKET GET IO INFO REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET GET IO INFO REO Ttag CANOPEN SLAVE PACKET GET IO INFO REO T struct CANOPEN SLAVE PACKET GET IO INFO REO Ttag TLR PACKET HEADER T tHead p
178. en Slave and needs to be handle there by your application CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 54 191 4 4 4 3 NMT Error Control Events One of the tasks of Network Management NMT is the detection of failures within the CANopen network such as absent stations no more regularly transmitting PDOs For this purpose NMT provides the three NMT Error Control Events offering different error control services based on the periodic transmission of messages The CANopen Slave protocol stack supports the following kinds of NMT Error Control Events Node Guarding Life Guarding Heartbeat It is mandatory to support one of these services However a supported service may be deactivated at rub time The NMT Error Control Events are related to the following packet of the CANopen Slave protocol stack CANOPEN_SLAVE_ERR_CTRL_EVENT_IND RES Error Control Event Indication for making your application aware of changes of the error control state within the entire CANopen network Node Guarding The concept of node guarding consists mainly of the NMT Master maintaining a database containing the expected states of all connected NMT Slave devices besides other information and comparing these with their actual states which are regularly requested from the NMT Slave devices Th
179. ency Message X X X Indication 5 2 8 CANOPEN SLAVE SET NMT STATE REQ CNF Set NMT State X X X 5 2 9 CANOPEN SLAVE SET BUSPARAM REQ CNF Set Bus Parameters 0 X 0 5 2 10 CANOPEN SLAVE SEND TIME STAMP REQ CNF Send Time Stamp x x x 5 2 11 CANOPEN_SLAVE_RECV_TIME_STAMP_IND RES Receive Time X X X Stamp Indication 5 2 12 CANOPEN SLAVE SEND TXPDO REO Send TxPDO Request x x x 5 2 13 CANOPEN_SLAVE_RECV_RXPDO_REQ CNF Receive RxPDO Request x X X 5 2 14 CANOPEN SLAVE RECV RXPDO IND RES Receive RxPDO x X X Indication 5 2 15 CANOPEN SLAVE SET EVENTS INDICATED REQ CNF Set Events X X 0 Indicated Request 5 2 16 CANOPEN SLAVE GET IO INFO REQ CNF Get I O Info X X X 5 2 17 CANOPEN SLAVE SET API PARAM REQ CNF Set API Parameter 0 X X 5 2 18 CANOPEN SLAVE N STATE CHANGE IND RES NMT State X X X Change Indication 5 2 19 CANOPEN SLAVE ERR CTRL EVENT IND RES Error Control Event x X X Indication 5 2 20 CANOPEN SLAVE NMT COMMAND IND RES NMT Command X X X Indication 5 2 21 CANOPEN SLAVE GET BUSPARAM REQ CNF Get Bus Parameters 0 X X 5 2 22 CANOPEN SLAVE SET WATCHDOG FAIL REQ CNF Set Watchdog 0 x x Fail 5 2 23 CANO
180. equired Features Parameter Maximum number of input data 2048 bytes Maximum number of output data 2048 bytes Maximum number of receive PDOs 256 Maximum number of transmit PDOs 256 Table 8 Technical Data Protocol Stack Extended Mode Other settings than default must be set via Set Configuration Packet and object dictionary configuration Concerning the extended mode also see section Standard Mode vs Extended Mode on page 68 Note SYCON net and netX configuration tool do not support the configuration of the extended mode CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 1 6 Terms Abbreviations and Definitions Term Description AP Application on top of the Stack Boot up Initial sequence of node during start up CAN Controller Area Network CAN DL CAN Data Link Layer CiA CAN in Automation CAN User Organization located in Erlangen Germany COB ID Communication Object Identifier DPM Dual Port Memory EMCY Emergency Guarding Supervision of node NMT Network Management OD Object Dictionary ODV3 Object Dictionary Version 3 PDO Process Data Object process data channel PDO Mapping Configurable process data per PDO RTR Remote transmission reguest RxPDO Receive PDO SDO Service Data Object representing an acyclic data channel SYNC Synchr
181. erview 186 191 Definition Value Description 0xC0430015 LR_E_CANOPEN_SLAVE_SET_OBJECT_DATA_VALID Failed to set object data valid 0xC0430016 LR_E_CANOPEN_SLAVE_GET_OBJECT_DATA Failed to get object data 0xC0430017 LR_E_CANOPEN_SLAVE_WRITE_PDO_REQ Failed to transmit PDO 0xC0430018 LR_E_CANOPEN_SLAVE_GUARD_ERROR Guard error detected 0xC0430019 LR_E_CANOPEN_SLAVE_INIT_BUFFER Initialization of buffer failed 0xC043001A LR_E_CANOPEN_SLAVE_DL_REQ_FAILED CAN DL request failed 0xC043001B LR_E_CANOPEN_SLAVE_INVALID_INDEX Invalid object index 0xC043001C LR E CANOPEN SLAVE INVALID SUB INDEX Invalid sub index 0xC043001D LR E CANOPEN SLAVE INVALID MAP LENGTH Invalid mapping length 0xC043001E LR E CANOPEN SLAVE INVALID PDO MODE Invalid transmission mode for PDO 0xC043001F LR E CANOPEN SLAVE INVALID PDO LENGTH Invalid length for PDO 0xC0430020 LR E CANOPEN SLAVE NO WRITE PERM No write permission for object 0xC0430021 LR E CANOPEN SLAVE NO READ PERM No read permission for object 0xC0430022 LR E CANOPEN SLAVE VALUE TOO LOW Value for object too low 0xC0430023 TLR E CANOPEN SLAVE VALUE TOO HIGH Value for object too high 0xC0430024 LR E CANOPEN SLAVE INVALID PARAMETER Invalid parameter for object 0xC0430025 LR E CANOPEN SLAVE INVALID PDO STATE Invalid PDO state 0x40430026 TLR I CANOPEN SLAVE INITIALIZE Slave is initializing 0xC0430027L LR_E_CANOPEN_SLAVE_OBJECT_SIZE Invalid size for object 0xC0430028 LR_E_CANOPEN
182. est Area Variable Type Value Range Description Head structure TLR PACKET HEADER T ulDest UINT32 Destination gueue handle of application task process queue ulSrc UINT32 Source Queue Handle of PNSIF task process queue ulDestId UINT32 0 Destination End Point Identifier ulSrcId UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 Packet data length in bytes ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 Status not used for request ulCmd UINT32 Ox2F88 RCX GET FW PARAMETER REO Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Data structure RCX SET FW PARAMETER REO DATA T ulParameterID UINT32 0 0xFFFFFFFF The number of used hardware switches Table 119 RCX_GET_FW_PARAMETER_REQ_T Get Firmware Parameter Request CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference typedef struct RCX_GET_FW_PARAMETER_CNF_DATA_Ttag LR UINT32 ulParameterID LR UINT32 ulParameterLen LR UINT8 RCX GET FW PARAMETE R CNF
183. et Structure Reference kk k k ok kk kk EEE kok kok kok kok kok k k kok k kk kk k kok I kk kk kk kk kk kk k ck k ck kckck ck k ck 22 2 2 22 2 2 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE PACKET GET BUSPARA REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET GET BUSPARAM REO Ttag CANOPEN SLAVE PACKET GET BUSPARAM REO T Structure of task command get bus parameter reguest struct CANOPEN SLAVE PACKET GET BUSPARAM REO Ttag TLR_PACKET_HEADER_T tHead packet header ir KK HK IK kk kk kk kk kk kk kk kk kk kk kk kk kk Ck kok kok k k kok k kk kk kk kk kk ck ck k ck k ck k ck k ck k ck k ck ck ck ck ck ck ck ok ck ok ck ok ke e Packet Description structure CANOPEN SLAVE PACKET GET BUSPARAM REO T Type Request Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle OUE CANOPEN SLV ulSrc UINT32 0 277 4 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process
184. etX operating system rcX The rcX has its own range of valid commands codes and differs from a communication channel Unless there is a reply packet the netX operating system returns it to the same mailbox the request packet went through Consequently the host application has to return its reply packet to the mailbox the request was received from CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 18 191 2 3 2 2 How to use ulsrc and ulsrcid Generally a netX protocol stack can be addressed through its communication channel mailbox The example below shows how a host application addresses a protocol stack running in the context of a netX chip The application is identified by a number 444 in this example The application consists of three processes identified by the numbers 11 22 and 33 These processes communicate through the channel mailbox with the AP task of the protocol stack Have a look at the following image Application 444 F o o o o a Process 22 Process 33 Channel Mainbox netX Protocol stack AP Task 1 Figure 3 Using ulSrc andulSrcId CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 19 191 Example This example applies to command messages initiated by a process in the context of the host applica
185. f AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulema UINT32 052915 CANOPEN SLAVE STATE CHANGE RES Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change Table 63 CANOPEN SLAVE PACKET STATE CHANGE RES T Change of State Response CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 5 2 6 106 191 CANOPEN_SLAVE_SEND_EMCY_REQ CNF Send Emergency Message This packet sends an emergency telegram to the CANopen network The emergency error codes have the following meaning according to the CANopen specification Error Code Meaning 00xx Error reset or no error 10xx Generic error 20xx Current 21xx Current device input side 22xx Current inside the device 23xx Current device
186. ference 4 section 6 1 Status Error Codes Object Dictionary CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Appendix 188 191 7 Appendix 7 1 List of Tables Table 1 List of Revisions eiie nee nal ales ee eal 4 Table 2 Technical Data Protocol Stack e een in nn besten reiner 6 Table 3 Technical Data Available for netX 0402424440snanennnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnannnnnnnnnnnnnannnnnnnnnnnsnannnnnnn nn 6 Table 4 Technical Data PCI DMA u eee eee eee a a ca ea e a ea a a a a are a aer e a Eea e EEEE dares EERE 7 Table 5 Technical Data Slot Number s eee eee eee eee een n n RA rennes sten etn AAA KKK PALA EKORA KKK A aan nahnat 7 Table 6 Technical Data Protocol Stack Standard Mode Default Settings cer 8 Table 7 Technical Data Protocol Stack Standard Mode Configured Settings re 8 Table 8 Technical Data Protocol Stack Extended Mode cccceceecceeeeeeeeeceeneeeeeeneeeeeeaeeeeeeeaeeeeneeeeeeaeeeseeneeeeesnieeeeneaaes
187. file present in the EDS file CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 74 191 5 The Application Interface This chapter defines the application user interface of the CANopen slave stack The application itself has to be developed as a Task according to the Hilschers Task Layer Reference Model The Application Task is named AP Task in the following sections and chapters The AP Task s process queue is keeping track of all its incoming packets and has to be addressed from the user application It provides the communication channel for the underlying CANopen slave stack Once the CANopen slave stack communication is established events received by the stack are mapped to packets that are sent to the AP Task s process queue On one hand every packet has to be evaluated in the AP Task s context and corresponding actions be executed On the other hand Initiator Services that are be requested by the AP Task itself are sent via predefined queue macros to the underlying CANopen slave stack queues via packets as well The AP Task will not route all commands to the CANopen slave task Some commands are used for internal communication between the AP and CANopen slave Task only Other requests are not possible in specific states 5 1 The CANopen APS Task To get the handle of the process queue of the CANopen APS task the Macro TLR OUE IDE
188. gInfoCount Number of diagnostic entries ulLastDiagInfo Last diagnostic entry ulMaxRecvldx Number of highest PDO mapped receive object index ulMaxSendldx Number of highest PDO mapped send object index aulAddDetail Additional detail for diagnostic entry CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 41 191 3 4 Control Block A control block is always present in both system and communication channel In some respects control and status block are used together in order to exchange information between host application and netX firmware The control block is written by the application whereas the application reads a status block Both control and status block have registers that use the Change of State mechanism see section 0 The following gives an example of the use of control and status block The host application wishes to lock the configuration settings of a communication channel to protect them against changes The application sets the Lock Configuration flag in the control block to the communication channel firmware As a result the channel firmware sets the Configuration Locked flag in the status block see below indicating that the current configuration settings cannot be deleted altered overwritten or otherwise changed The control block of a dual port memory features a watchdog function to allow the operating system running
189. hese in whole or in part using technical or mechanical methods printing photocopying or other methods to manipulate or transfer using electronic systems without prior written consent You are not permitted to make changes to copyright notices markings trademarks or ownership declarations The included diagrams do not take the patent situation into account The company names and product descriptions included in this document may be trademarks or brands of the respective owners and may be trademarked or patented Any form of further use requires the explicit consent of the respective rights owner 1 8 2 Important Notes The user manual accompanying texts and the documentation were created for the use of the products by qualified experts however errors cannot be ruled out For this reason no guarantee can be made and neither juristic responsibility for erroneous information nor any liability can be assumed Descriptions accompanying texts and documentation included in the user manual do not present a guarantee nor any information about proper use as stipulated in the contract or a warranted feature It cannot be ruled out that the user manual the accompanying texts and the documentation do not correspond exactly to the described features standards or other data of the delivered product No warranty or guarantee regarding the correctness or accuracy of the information is assumed We reserve the right to change our products and their specificati
190. ication specific event Message transmission occurs synchronized to the SYNC event but not periodically 4 4 5 6 Transmission Types There are also some other transmission types for special cases The following table introduces the complete rules that apply for the transmission types Type Cyclic Acyclic Synch Asynch RTR only 0 x x 1 240 x x 241 251 reserved 252 x x 253 x x 254 x 255 x Table 34 PDO Transmission Types 1 This value specifies exactly the number of SNC events between two transmissions of the PDO 2 Device specific application event 3 Device profile defines application event Transmission types 254 and 255 differ in the following aspect Transmission type 254 is used for device specific application events Transmission type 255 is used for application events defined in the device profile 4 4 5 7 Inhibit Time and Event Timer Additionally there are two important features that can be assigned only to TxPDOs namely as the the Inhibit Time and the Event Timer The Inhibit Time is defined as the minimum time required to elapse between two consecutive invocations of the service of a PDO If this time is set to a value significantly larger than the time need to process the synchronous PDO this feature gives acyclic or asynchronous PDOs with lower priority than the synchronous PDO better chances to be processed quickly Values are specified in units of 100 us
191. ies the data from the output data image of the dual port memory into the internal buffer From there the data is transferred to the network The protocol stack toggles the handshake bits back indicating to the application that the transfer is finished and a new data exchange cycle may start This mode guarantees data consistency over both input and output area 3 1 1 Input Data Image The input data block is used by field bus and industrial Ethernet protocols that utilize a cyclic data exchange mechanism The input data image is used to transfer cyclic data from the network CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 25 191 The default size of the input data image is 5760 byte An output and input data block may or may not be available in the dual port memory They are always available in the default memory map see the netX Dual Port Memory Manual Input Data Image Offset Type Name Description 0x2680 UINT8 abPdOInput 5760 Input Data Image Cyclic Data From The Network Table 15 Input Data Image For netX devices with 8 kByte Dual port Memory the size of the input data image is 1536 byte Input Data Image Offset Type Name Description 0x1600 UINT8 abPdOInput 1536 Input Data Image Cyclic Data From The Network Table 16 Input Data Image for ne
192. igure 15 CANopen Time Stamp Protocol below Time Stamp Protocol Time Stamp Producer Time Stamp Consumer 6 Byte TimeOfDay Indication s COB ID 256 Figure 15 CANopen Time Stamp Protocol The contents of the time stamp is divided into a milliseconds part and a days part The milliseconds part variable ulMilliseconds contains the number of milliseconds that have occurred since midnight The days part variable usDays contains the number of days that have occurred since January 1 1984 Packet Structure Reference RK k k kok kok kok kok kok kok kok kok kok kok I I kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k k A 22 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE SEND TIME STAMP REO DATA Ttag lt code gt typedef struct CANOPEN SLAVE SEND TIME STAMP REO DATA Ttag CANOPEN SLAVE SEND TIME STAMP REO DATA T struct CANOPEN SLAVE SEND TIME STAMP REO DATA Ttag TLR_UINT32 ulMilliseconds TLR_UINT16 usDays hi TE kok kok kok kok kok kok kok kok kok k kok k kok kk kk kk kk kk kk kk 2 2 2 2 2 2 2 2 2 22 2 2 2 2 2 2 2 2 2 2 22 2073 type of lt code gt CANOPEN SLAVE PACKET SEND TIME STAMP REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SEND TIME STAMP REO Ttag CANOPEN SLAVE PACKET SEND TIME STAMP REO T struct CANOPEN SLAVE
193. ime stamp service allows to send time stamps from one node CANopen Master or Slave to another one In terms of the Producer Consumer Model a CANopen Slave can act within a push model both as a producer and as a consumer In either case the data transferred between producer and consumer are the current calendar date and time divided in to a milliseconds part and a days part These are transferred within one communication object with a 6 Byte on the CANopen network The time stamp communication object is usually assigned to the COB ID 256 For details of specifying the date and time parameters see the descriptions of the packets mentioned below Time Stamp Protocol Time Stamp Producer Time Stamp Consumer 6 Byte TimeOfDay Indication s COB ID 256 The Time Stamp Event is related to the following packets of the CANopen Slave protocol stack CANOPEN SLAVE SEND TIME STAMP REQ CNF Send Time Stamp allows your application to send a time stamp according to the CANopen time stamp protocol In this case the CANopen Slave acts as a producer A time stamp event is caused at the side of the consumer s recipient s of the time stamp message CANOPEN SLAVE RECV TIME STAMP IND RES Receive Time Stamp Indication for making your application aware of the reception of a time stamp sent by the Time Stamp Producer via the Time Stamp Protocol In this case the CANopen Slave acts as a consumer Here the time stamp event occurs at the CANop
194. in order to inform the CANopen slave task that a watchdog failure has been detected The CANopen slave task stops the communication with the CANopen network After a watchdog error has been set the slave has to be reinitialized before further communication is possible Note Use this packet only when working with linkable object modules It is not designed for usage in the context of loadable firmware Note This packet is used by the AP task only and will not be routed from the user application to the CANopen slave task Packet Structure Reference RK KK HK kk ok k kok kk kk kk kk kk kk kk kk kk kk kk 2 ok k kok ok k kk kk kk kk kk kk kk kk ck ckck ck kk kk kk ck ck ck ke ke type of lt code gt CANOPEN SLAVE PACKET SET WATCHDOG FAIL REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET WATCHDOG FAIL REO Ttag CANOPEN SLAVE PACKET SET WATCHDOG FAIL REO T struct CANOPEN SLAVE PACKET SET WATCHDOG FAIL REO Ttag TLR_PACKET_HEADER_T tHead packet header Bs of RK ok ok IK ok k kk ok k kk kk ok oko kok kok k kk kk kk kk kok kok kok kok kc 2 kok k kok ok k kk kk 2 2 2 kok 2 2 22 2 2 2 2 2 2 Packet Description Structure Information CANOPEN SLAVE PACKET SET WATCHDOG FAIL REO T Type Reguest Area Vari
195. in the CAN network the available COBs are numbered from 0 to 2047 These 11 bit numbers uniquely identifying the COBs are called CAN identifiers The CAN identifier of a COB is stored together with some bits valid invalid bit remote frame support bit frame format bit as an object within the object dictionary This object mainly containing the COB s CAN identifier is also called the COB ID i e COB IDentifier However the term COB ID is also often used for the single CAN identifier related to the COB This manual also uses the term COB ID in this sense The COB ID plays an important role in CAN bus arbitration in the MAC layer It determines the priority of processing for the COB Lower values of the COB ID mean higher priority 4 4 2 1 Predefined Connection Set The designer of a CANopen network must assign the COB IDs to the various objects He has a lot of freedom to do so In order to easily setup smaller networks there is a set of recommended and good running assignments provided by the specification the predefined connection set A factory new CANopen device will work with this predefined connection set when reaching the PRE OPERATIONAL state for the first time and if no explicit changes have been stored every time it reaches this state The predefined connection set works as follows The 11 bit CAN identifiers COB IDs are separated in to a leading part of 4 bits denominated as the function code Bits 10 to 7 and the trail
196. ination Queue Handle of CANopen slave Task Process QUE_CANOPEN Queue APS ulSrc UINT32 0 2 1 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process ulSrcId UINT32 ulAPSS0Id Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unigue number generated by the Source Process of the Packet ulSta UINT32 See section 6 1 1 Codes of the CANopen APS Task ulCmd UINT32 0x2E02 CANOPEN_APS_GET_STATE_REQ Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 43 CANOPEN_APS_PCK_GET_STATE_REQ_T Get State of AP Task Request CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 76 191 Packet Structure Reference BRK KK KK kk k k k k k k k k k k k k k k k k KR type of lt code gt CANOPEN APS GET STATE CNF DATA Ttag lt code gt typedef struct CANOPEN APS GET STATE CNF DATA Ttag CANOPEN APS GET STATE CNF DATA T struct CANOPEN APS GET STATE CNF DATA Ttag TLR_UINT32 aulUnused 2 RRR KK KK
197. ing 7 bits Bits 6 to 0 which represent the Node ID holding the addressing information within the CAN network The predefined connection set supports the following communication objects 4 Receive PDOs 4 Transmit PDOs 1 SDO 1 Emergency Object and the NMT objects The following table shows which function codes and thus ranges of COB IDs are assigned to which objects within the predefined connection set Additionally it contains the index within the object dictionary where to adjust the communication parameters of that object CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 51 191 the information whether this object is a broadcast object communication to all participants on the network or a peer to peer object communication between master and slave or slave and slave Object Function code Resulting Range Index of Broadcast Peer binary notation of COB IDs communication to Peer parameters NMT 0000 0 Broadcast SYNC 0001 128 0x1005 0x1007 Broadcast EMERGENCY 0001 129 255 0x1014 0x1015 Peer to Peer TIME STAMP 0010 256 0x1012 0x1013 Broadcast PDO1 tx 0011 385 511 0x1800 Peer to Peer PDO1 rx 0100 513 639 0x1400 Peer to Peer PDO2 ix 0101 641 767 0x1801 Peer to Peer PDO2 rx 0110 769 895 0x1401 Peer to Peer PDO3 tx 0111 897 1023 0x1802 Peer to Peer PDO3 rx 1000 1025
198. ion do not change Table 111 CANOPEN SLAVE PACKET RECEIVE PDO RES T Receive PDO Response CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 170 191 5 3 Hardware Switches for the Adjustment of Slave Address and Baudrate For handling address and baud rate switches on a netX device the firmware must be enabled to evaluate the switch values from the hardware This can be done by setting a special TAG via the Tag List Editor tool In this case the values which are configured via database or packet interface will be ignored If the hardware switch function is not enabled via TAG then the firmware uses the values set either via NXD or IniBatch database or via packet interface SET_CONFIGURATION_REQ or RCX SET HW SWITCH VALUE REO See section 5 3 1 HCX SET HW SWITCH VALUES REG CNF Set the Values of the Hardware Switch Enabling and disabling Address and Baudrate Switching On database files and SET CONFIGURATION REO evaluating the switches can be activated or deactivated This information is located at the SystemFlags CCLINK APS SYS FLAG ADDRESS SWITCH 0x10 CCLINK APS SYS FLAG BAUD SWITCH 0x20 Also see section 5 1 2 CANOPEN APS SET CONFIGURATION REQ CNF Set Configuration Behavior at Start up In general the firmware
199. ion 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x292C CANOPEN SLAVE SET API PARAM REO Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE SET API PARAM REQ DATA T hApplication TLR HA Application Handle of Slave see TLR Manual NDLE pFncSendDataUp PFN CA Callback Callback for Send Data dated NOPEN _SLAVE _CALLB ACK pbSrcData UINT8 Pointer Source Data Pointer FAR ulSrcDataCnt UINT32 0 2 1 Source Data Count pFncRecvDataUp PFN_CA Callback Callback for Receive Data dated NOPEN _SLAVE _CALLB ACK pbDstData UINT8 Pointer Destination Data Pointer FAR ulDstDataCnt UINT32 0 2 1 Destination Data Count Table 92 CANOPEN SLAVE PACKET SET API PARAM REO T Set API Parameter Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 146 191 RK IK IK IK IK kk kok kok kok kok kok kok kok k kk kk kk kk kk kok kk kk kk kk I 2 2 22 2 2 2 2 2 2 22 2073 typedef struct CA OP EN SLAVE S ANDEREN UNIES ASIAN CANOP EN SLAVE SE AU N DIE JPY CN JDA IE typedef TLR_VOID TLR_HANDLE service CAN TLR HANDLI type of lt code gt CANOPE typedef struct CANOF o hApplica CAI
200. is Stopped D1 CANOPEN SLAVE CAN STATE CAN State is Not configured NOT CONFIGURED DO CANOPEN SLAVE CAN STATE UNKNOWN CAN State is unknown Table 61 Flags of ulCanState aulUnused 2 This array has been introduced only for compatibility reasons It is not used CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface ulFlags 103 191 This variable is organized as a bit field as described in the table below Bit Name Description D32 D9 Unused D8 CANOPEN_SLAVE_STATE_FLAG_CAN_STARTED CAN network has been started D7 D5 Unused D4 CANOPEN SLAVE STATE FLAG COMM ERROR Communication Error D3 CANOPEN SLAVE STATE FLAG BUS ON Bus on D2 CANOPEN SLAVE STATE FLAG COM Communication running D1 CANOPEN SLAVE STATE FLAG RUN Run DO CANOPEN_SLAVE_STATE_FLAG_RDY Ready Table 62 Bit field ulFlags ulErrorCount This field contains the total number of errors detected since power up respectively after reset The protocol stack counts all sorts of errors in this field no matter if they were network related or caused internally ulCommError This field contains the error code of the last communication error that occurred ulRunLedState This field contains the current state of the RUN LED ulErrLedState This field contains the current state of the ERR LED ulRecvDataCnt Th
201. is field contains the Received Data Count ulSendDataCnt This field contains the Send Data Count ulReserved This field is reserved for future use CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Extended Slave State Structure Reference 104 191 KKK KK KK kk k kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k I k 2 I ck ck ck ck ck ck ck ck 2 2 I 22 ck sk ok type of lt code gt CANOPEN SLAVE EXTENDED STATE Ttag lt code gt typedef struct CANOPEN SLAV E EXTENDED STATE Ttag CANOPEN SLAVE EXTENDED STATE T define CANOPEN SLAVE EXT S FLAG CAN INIT define CANOPEN SLAVE EXT S FLAG CAN UNC EID lez PEN SLAVE EXT S define CAN FLAG PASSIVE O O O O define CANOPEN_SLAVE_EXT_S BEBE p pi pi Dp FLAG BUSHOKE define CANOPEN_SLAVE_EXT_S D D LAG RX OVERFLOW define CANOPEN SLAVE EXT S define CANOPEN SLAVE U EXT S les E3 Jez LAG de FLAG TX OVI F REF LOW IND_LOST define CANO A EN SLAVE EXT S ATE FLAG WDG define CANO A EN SLAVE EXT S ATE FLAG SLAVE ERROR define CANOPEN SLAVE EXT S CTRL define CANOPEN SLAVE M EXT S NR
202. ish 2013 10 Released Public Hilscher 2011 2013 The Application Interface 91 191 Packet Description Structure Information CANOPEN SLAVE PACKET STARTSTOP REO T Type Reguest Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle of CANopen slave Task Process QUE CANOPEN Queue SLV ulSrc UINT32 0 2 1 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of VOId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x00002902 CANOPEN_SLAVE_STARTSTOP_REQ Command ulExt UINT32 0 Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN SLAVE STARTSTOP REO DATA T ulMode UINT32 Depending on this assignment communication is either started or stopped 0 Stop CANopen 1 Start CANopen Table 54 CANOPEN SLAVE PACKET STARTSTOP REO T Start Stop Communication Request CANopen Slave
203. ject2201Size UINT8 Size of object 0x2201 bobject2202Size UINT8 Size of object 0x2202 bobject2203Size UINT8 Size of object 0x2203 usNumOfRxPdo UINT16 Number of Receive PDOs 0 256 usNumOfTxPdo UINT16 Number of Transmit PDOs 0 256 aulReserved 2 UINT32 2 Reserved set to zero Table 36 Standard bus parameter structure CANOPEN_SLAVE_STD_BUSPARAM_DATA_T The ulVendorId parameter provides the value for the Vendor ID entry in the object dictionary of the CANopen slave Object 0x1018 sub index 1 if bit 4 in parameter ulCanopenFlags is set Otherwise the vendor ID is set to zero CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 70 191 The ulProductCode parameter provides the value for the product code entry in the object dictionary of the CANopen slave Object 0x1018 sub index 2 if bit 5 in parameter ulCanopenFlags is set Otherwise the product code is set to zero The ulSerialNumber parameter provides the value for the serial number entry in the object dictionary of the CANopen slave Object 0x1018 sub index 4 if bit 6 in parameter ulCanopenFlags is set Otherwise the serial number is set to zero The ulRevisionNumber parameter provides the value for the revision number entry in the object dictionary of the CANopen slave Object 0x1018 sub index 3 if bit 7 in parameter ulCanopenF lags is set Otherwise the revision numbe
204. k ck ck ck ck 22 2 2 22 2 2 2 2 2073 Packet Description structure CANOPEN SLAVE PACKET SEND TIME STAMP CNF T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet VOId inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x291F CANOPEN_SLAVE_SEND_TIME_STAMP_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 78 CANOPEN_SLAVE_PACKET_SEND_TIME_STAMP_CNF_T Confirmation to Send Time Stamp Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 125 191 5 2 11 CANOPEN SLAVE RECV TIME STAMP IND RES Receive Time Stamp Indication This indication
205. k ck k ck k ck k ck kk k ck k ck k k k k k k ok ke e CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface Packet Description 133 191 structure CANOPEN SLAVE PACKET RECV RXPDO REO T Type Reguest Area Variable Type Value Range Description Head structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 64 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 0 See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x2924 CANOPEN_SLAVE_RECV_RXPDO_REQ Command ulExt UINT32 JO Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Data structure CANOPEN SLAVE RECV RXPDO REO DATA T aulRecvRxPdoN UINT32 1 255 for each Array of numbers of RxPDOs to be received umber 16 number Table 83 CANOPEN SLAVE PACKET
206. k k k kok k 2 kok k kk kk kk kk kk kk kk kk kk kk kk kk k k k k k ck k I 22 22 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE RECV RXPDO IND DAj typedef struct CANOPEN SLAVE RECV RXPDO IND DATA 1 CANOPEN SLAVE RECV RXPDO IND DATA T define CANOPEN SLAVE RECV RXPDO IND MAX 16 struct CANOPEN SLAVE RECV RXPDO IND DATA Ttag TLR_UINT32 aulRecvRxPdoNumber CANOPEN_SLAVE IA Ttag lt code gt tag RECV RXPDO IND MAX he Kk kok kok kok kok kok kok kok kok k k kok k kk kk kk kk kk kk kk kk kk kk kk kk k k k k k k I 22 ck ck ck ck ck ck ck ck 2 2 I 2 2 type of lt code gt CANOPEN SLAVE PACKET RECV RXPDO IND Ttag lt code gt typedef struct CANOPEN SLAVE PACKET RECV RXPDO IND Ttag CANOPEN SLAVE PACKET RECV RXPDO IND T struct CANOPEN SLAVE PACKET RECV RXPDO IND Ttag TLR PACKET HEADER T tHead CANOPEN SLAVE RECV RXPDO IND DATA T tData packet header RS packet late s kok kk kk kok kok kok kok kok kok kok kok kok k kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k ck ck ck ck ck ck ck ck ok kk ke Packet Description structure CANOPEN SLAVE PACKET RECV RXPDO IND T Type Indication Area Variable Type Value Range Descri
207. k kk kk kk kk kk kk k k A A A A 22 2 2 The extended slave state is described in detail in section 3 3 2 Extended Status CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 105 191 Packet Structure Reference kk kk kok kok kok kok kok kok kok k k kok k I k kk kk kk kk kk kk kk kk kk k k k k k ck k k k k ck ck ck ck 22 22 2 2 2 2 2073 type of lt code gt CANOPEN SLAVE PACKET STATE CHANGE RES Ttag lt code gt typedef struct CANOPEN SLAVE PACKET STATE CHANGE RES Ttag CANOPEN SLAVE PACKET STATE CHANGE RES T Sstmuce CANOPENZSTAVEZBACKETZSTATRZCHANGEFRESTTEAG TLR PACKET HEADER T tHead packet header y J KCRCKCKCKCkCk kk kk kk kk kk kk kk kk kk Ck Ck Ck Ck kk kk kk kk kk kk kk kk kk c kk ck ck k ck k ck k ck k ck k ck k ck k ck k ck ck ck k ck ok ck ck ck ok ck ok ke e k f Packet Description Structure Information CANOPEN SLAVE PACKET STATE CHANGE RES T Type Response Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle of CANopen slave Task Process Oueue ulSrc UINT32 Source Queue Handle o
208. kBaud define CANOPEN SLAVE CFG BAUD 125 0x00000004L 125kBaud define CANOPEN SLAVE CFG BAUD 100 0x00000005L 100kBaud define CANOPEN SLAVE CFG BAUD 50 0x00000006L 50kBaud define CANOPEN SLAVE CFG BAUD 20 0x00000007L 20kBaud define CANOPEN SLAVE CFG BAUD 10 0x00000008L 10kBaud define CANOPEN SLAVE CFG BAUD AUTO DETECTION 0x000000FFL Auto Baud detection define CANOPEN SLAVE STD CFG DEF OBJECT SIZE 128 Default object size in std mode define CANOPEN SLAVE CFG MAX RXPDO 256 Maximum number of RxPDO rA define CANOPEN SLAVE CFG MAX TXPDO 256 Maximum number of TxPDO A struct CANOPEN SLAVE BUSPARAM DATA Ttag LR UINT32 ulSlaveNodeId Node ID LR_UINT32 ulBaudrate Baud rate sy LR_UINT32 ulCanOpenFlags CANopen flags union CANOPEN_SLAVE_STD_BUSPARAM DATA_T tStdBusParam Parameter for standard mode CANOPEN_SLAVE_EXT_BUSPARAM DATA_T tExtBusParam Parameter for extended mode uMode LR_UINT32 ul29BitCode 29Bit Code LR_UINT32 ul29BitMask 29Bit Mask Ie struct CANOPEN APS SET CONFIGURATION RE LR_UIN hg LR UIN 32 ulSystemFlags 32 ulWdgTime ANOPEN SLAVE BUSPARAM DATA T tBusParam DATA Ttag System flags A Watchdog time Bus parameter BRK KK KK kk k k k k k k k k k k k k k k k k KR V OE out cioe typedef struct CANOPI ANOPEN_APS_SET_CO
209. kk kk kk kk k ck k ck k k k k k ok ck ok ck ok ke type of lt code gt CANOPEN SLAVE PACKET RECV RXPDO RES Ttag lt code gt typedef struct CANOPEN SLAVE PACKET RECV RXPDO RES Ttag CANOPEN SLAVE PACKET RECV RXPDO RES T struct CANOPEN SLAVE PACKET RECV RXPDO RES Ttag TLR_PACKET_HEADER_T tHead packet header kok kok kok kok kok kok kok kok kok kok I I kk kk kk kk kk kk k ck k ck kk k k ck k k ck k k k A 2 2 2 2 2 2 22 273 Packet Description structure CANOPEN SLAVE PACKET RECV RXPDO RES T Type Response Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x
210. kk kk kk kk kk kk kk Ck kok k kk kk kok k kk Ck Ck kok kk kk kk kk ck ck k ck k ck k ck k ck k ck ck ck ck ck ck ck ok ck ok ck ok ke ek Packet Description structure CANOPEN SLAVE PACKET SEND TXPDO CNF T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of packet within the Destination Process Set to 0 for the alization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet d de the Source Process ulLen UINT32 64 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the rce Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2923 CANOPEN_SLAVE_SEND_TXPDO_CNF Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN_SLAVE_SEND_TXPDO_CNF_DATA_T sult aulSendTxPdoRe UINT32 Array of Results of sending TxPDOs Table 82 CANOPEN SLAVE PACKET SEND TXPDO CNF T Confirmation to Send TxPDO Request CANopen Slave Protocol API DOC111001
211. kk kk kk kk kk kk kk kk k k k k k k I 2 2 2 2 2 2 type of lt code gt CANOPEN SLAVE PACKET SET EVENTS INDICATED CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET EVENTS INDICATED CNF Ttag CANOPEN SLAVE PACKET SET EVENTS INDICATED CNF T struct CANOPEN SLAVE PACKET SET EVENTS INDICATED CNF Ttag TLR_PACKET_HEADER_T tHead packet header J KCKCKCKCKCkCk kk kk kk kk kk kk kk kk kk kk kk kk Ck kok kok kok k kk kk kok kk kk kk kk kk kk kk kk k k k k k k ok ck ok ke Packet Description structure CANOPEN SLAVE PACKET SET EVENTS INDICATED CNF T Type Confirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 O Packet Data Length in bytes ulld UINT32 0 274 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 S
212. kok kok kok kok kok k kk kk kk kk kk kk ck ck k ck k ck k ck k ck k ck k ck k ck ck ck ck ck ck ck ok ck A ke Packet Description Structure Information CANOPEN SLAVE PACKET SET BUSPARAM CNF T Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSSOId Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched V0O0Id ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes ofthe CANopen Slave Task aus UINT32 0x2907 CANOPEN_SLAVE_SET_BUSPARAM_CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change Table 76 CANOPEN_SLAVE_PACKET_SET_BUSPARAM_CNF_T Set Bus Parameter Confirmation CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 122 191 5 2 10 CANOPEN SLAVE SEND TIME STAMP REQ CNF Send Time Stamp This packet allows to send a time stamp according to the CANopen time stamp protocol if the CANopen Slave is a valid time stamp producer See F
213. l API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 21 191 3 You can find information about the corresponding communication channel 0 3 under the following addresses Offset Communication Channel 0x0050 Communication Channel 0 0x0060 Communication Channel 1 0x0070 Communication Channel 2 0x0080 Communication Channel 3 In devices which support only one communication system which is usually the case either a single field bus system or a single standard for Industrial Ethernet communication always communication channel 0 will be used In devices supporting more than one communication system you should also check the other communication channels 4 There you can find such information as the ID containing channel number and port number of the communication channel the size and the location of the handshake cells the overall number of blocks within the communication channel and the size of the channel in bytes Evaluate this information precisely in order to access the communication channel correctly The information is delivered as follows Size of Channel in Bytes Address Data Type Description 0x0050 UINT8 Channel Type COMMUNICATION must have the fixed value define RCX_CHANNEL_TYPE_COMMUNICATION 0x05 0x0051 UINT8 ID Channel Number Port Number 0x0052 UINT8 Size Position Of Handshake Cells 0x0053 UINT
214. lDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process ulSrcId UINT32 ulAPSS0Id Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unigue number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2900 CANOPEN_SLAVE_REGISTER_REQ Command ulExt UINT32 O Reserved ulRout UINT32 x Routing Information tData structure CANOPEN_SLAVE_REGISTER_REQ_DATA_T bReserved UINT32 O Reserved for further use set to zero Table 52 CANOPEN_SLAVE_PACKET_APP_REGISTER_REO_T Register Application Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 89 191 Packet Structure Reference RK IK IK kk EEE EEE kok kok kok kok kok kok kok kok kok k k kok k I kk kk kk kk kk k k k k I 2 2 22 22 I type of lt code gt CANOPEN SLAVE REGISTER CNF DATA Ttag lt code gt typedef struct CANOPEN SLAVE REGISTER CNF DATA Ttag CANOPEN SLAVE REGISTER CNF DATA T struct CANOPEN SLAVE REGISTER CNF DATA Ttag TLR_UINT8 bReserved Reserved for further use
215. lave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 5 191 1 3 System Requirements The software package has the following system requirements to its environment netX Chip as CPU hardware platform Operating system for task scheduling required 1 4 Intended Audience This manual is suitable for software developers with the following background Knowledge of the programming language C Knowledge of the use of the real time operating system rcX Knowledge of the Hilscher Task Layer Reference Model Knowledge of the CiA Work Draft 301 specification CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 1 5 Specifications 6 191 The data below applies to CANopen Slave firmware and stack version 3 6 x The firmware stack has been designed in order to meet the CiA Work Draft 301 V4 02 specification see reference 2 1 5 1 Technical Data Technical Data Features Parameter Maximum number of input data Depends on the used mode and settings See below Maximum number of output data Depends on the used mode and settings See below Maximum number of receive PDOs Depends on the used mode and settings See below Maximum number of transmit PDOs Depends on the used mode and settings See below Exchange of process data via PDO transfer synchroniz
216. lbox The application has to make sure that the packet finds its way back to the originator process 22 in the example 2 3 2 3 How to Route rcX Packets To route an rcX packet the source identifier ulSrcld and the source queues handler u Src in the packet header hold the identification of the originating process The router saves the original handle from ulSrcld and ulSrc The router uses a handle of its own choices for ulSrcld and ulSrc before it sends the packet to the receiving process That way the router can identify the corresponding reply packet and matches the handle from that packet with the one stored earlier Now the router replaces its handles with the original handles and returns the packet to the originating process CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 20 191 2 3 3 Obtaining useful Information about the Communication Channel A communication channel represents a part of the Dual Port Memory and usually consists of the following elements Output Data Image is used to transfer cyclic process data to the network normal or high priority Input Data Image is used to transfer cyclic process data from the network normal or high priority Send Mailbox is used to transfer non cyclic data to the netX Receive Mailbox is used to transfer non cyclic data from the netX Control Block allows the host system to control certain ch
217. leased Public Hilscher 2011 2013 The Application Interface Packet Structure Reference 132 191 kok kok kk kok kok kok kok kok kok kok kok k I kk kk kk kk kk kk kk kk kk kk kk kk k ck k k k k ck ck ck ck ck ck I 22 2 2 22 2073 type of lt code gt CANOPEN SLAVE RECV RXPDO R EO DATA Ttag lt code gt typedef struct CANOPEN SLAVE RECV RXPDO REO DATA tag CANOPEN SLAVE RECV RXPDO REO DATA T define CANOPEN SLAVE RECV RXPDO REQ MAX 16 struct CANOPEN SLAVE RECV RXPDO REO DATA Ttag TLR UINT32 aulRecvRxPdoNumber CANOPEN SLAVE RECV RXPDO REO MAX KKK IK IK kk kk kk I kk kk kk kk kk Ck Ck kk Ck k Ck kk kk kk kk kk kk kk kk kk kk kk ck ck k ck k ck k ck k ck ck ck ck ck ck ck ck ck ck ck ok ke type of code CANOPEN SLAVE PAC ET RECV RXPDO REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET RECV RXPDO R EO Ttag CANOPEN SLAVE PACKET RECV RXPDO R EQ T struct CANOPEN SLAVE PACKET RECV RXE DO REO Ttag TLR_PACKET_HEADER_T tHead CANOPEN SLAVE RECV RXPDO REO DATA T tData he packet header packet data B RK ok kok ok kok ok kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok kok k kk kk
218. lscher 2011 2013 The Application Interface Packet Description Structure Information CANOPEN_SLAVE_PACKET EXCHANGE DATA CNF Type Confirmation Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSS0Id Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPENSL Source End Point Identifier untouched VOId ulLen UINT32 24 279 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes ofthe CANopen Slave Task ulcmd UINT32 0x290B CANOPEN SLAVE EXCHANGE DATA CNF Command ulExt UINT32 Extension reserved ulRout UINT32 Routing Information do not change tData structure CANOPEN SLAVE EXCHANGE DATA CNF DATA T ulRecvIndex UINT32 0x2200 0x2203 Receive object index ulRecvSub UINT32 1 255 Receive object sub index Index ulRecvData UINT32 0 255 Number data byte to be read Cnt ulSendIndex UINT32 0x2000 0x2003 Send object index ulSendSub UINT32 1 255 Send object sub index Index ulSendData UINT32 0 255 Number data byte to be sent Cnt abRecvData UINT8 Receive data 255 Table 59 CANOPEN_SL
219. mands it will return the packet with an error indication A command is always even the least significant bit is zero In the response packet the command code is incremented by one indicating a confirmation to the request packet Extension The extension field ulExt is used for controlling packets that are sent in a sequenced manner The extension field indicates the first last or a packet of a sequence If sequencing is not required the extension field is not used and set to zero CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 30 191 Routing Information The ulRout field is used internally by the netX firmware only It has no meaning to a driver type application and therefore set to zero User Data Field This field contains data related to the command specified in u Cmd field Depending on the command a packet may or may not have a data field The length of the data field is given in the ulLen field 3 2 2 Status amp Error Codes The following status and error codes can be returned in ulState List of codes see manual named netX Dual Port Memory Interface 3 2 3 Differences between System and Channel Mailboxes The mailbox system on netX provides a non cyclic data transfer channel for field bus and industrial Ethernet protocols Another use of the mailbox is allowing access to the firmware running on the netX chip itself for diagnosti
220. meter Response CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 181 191 5 4 CAN DL Task If working with Loadable Firmware you can also use the functionality of the CAN DL Task for programming CAN on the level of Data Link Layer Layer 2 in OSI Layer Model The packet interface of CAN DL is described within a separate manual the CAN Data Link Packet Interface Protocol API Manual See reference 5 The following packets of CAN DL can be used without restrictions CAN_DL_CMD_DATA_REQ CAN_DL_CMD_DATA_HI_REQ CAN DL CMD DIAG REO CAN DL CMD TX ABORT REO CAN DL CMD AP REGISTER REO CAN DL CMD EVENT ACK REOQ The following packets of CAN DL will be denied as long as the Configuration Lock flag is set CAN DL CMD ENABLE RXID REQ CAN DL CMD SET EVENTS TO INDICATE REO Whether or not indications are sent to your application depends on which CAN DL events have been notified Contrary to the CANopen Slave Task the CAN DL Task also supports 29 bit CAN identifiers If it is intended to use these 29 bit CAN identifiers the application has to registered at the CAN DL Task using CAN DL CMD AP REGISTER REO with parameter ul InitMode set to 0 5 5 ODV3 Task If working with Loadable Firmware you can also use the
221. model as a producer and within a pull model both as a producer and as a consumer The Receive PDO Event is related to the following packets of the CANopen Slave protocol stack CANOPEN_SLAVE_SEND_TXPDO_REQ Send TxPDO Request for sending a TxPDO to one or more communication partner s on the CANopen network and causing a Receive PDO Event there CANOPEN_SLAVE_RECV_RXPDO_REQ CNF Receive RxPDO Request for sending an RTR frame in order to request an RxPDO from a communication partner on the CANopen network CANOPEN_SLAVE_RECV_RXPDO_IND RES Receive RxPDO Indication for informing your application about the reception of a PDO coming from another communication partner on the CANopen network The protocols of the 3 packets are illustrated at their packet descriptions As parameters the requests contain an array of up to 16 affected PDO numbers The confirmation packet contain a status code indicating whether or not the processing of the PDO has been successful In case of failure you can evaluate this status code as error code for determining the cause of the error For details of PDOs see section Process Data Objects PDO on page 61 CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 58 191 4 4 4 5 NMT Command Events NMT Command Events are used to inform the CANopen Slaves
222. n tHead Structure TLR PACKET HEADER T ulDest UINT32 QUE_CANOPEN Destination Queue Handle of CANopen slave Task Process SLV Oueue ulSrc UINT32 0 2774 Source Queue Handle of AP Task Process Queue ulDestId UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of voId the packet within the Destination Process ulSrcId UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 8 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x2939 CANOPEN SLAVE SEND EMCY RES Command ulExt UINT32 0 Reserved ulRout UINT32 x Routing Information Table 71 CANOPEN SLAVE PACKET SEND EMCY RES T Response to Send Emergency Message Indication CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 114 191 5 2 8 CANOPEN SLAVE SET NMT STATE REQ CNF Set NMT State This packet allows the host application to set the NMT state of the CANopen slave Normally the state is set by the NMT Master using the CANOPEN_SLAVE_NMT_COMMAND_IND indication but sometimes it may be necessary to control the state manually from the host application Which state is set depends on the value
223. n multiples of 1 ms in object 0x1016 of the object dictionary The Producer Heartbeat Time set to 0 indicates the Heartbeat feature is currently disabled In this case it would be mandatory to use the Node Guarding feature described above Heartbeat Protocol Heartbeat Producer Heartbeat Consumer 0 1 Request 0 7 s delay Indication I I I I Heartbeat Producer Time I 0 1 Request PLN 0 7 s delay Indication I I I I Heartbeat Consumer Time Heartbeat Event I Y Indication Figure 10 Heartbeat Protocol Each CANopen device must implement Node Guarding life guarding or the heartbeat mechanism or both If both are implemented they may not both be active at the same time It is recommended to use the heartbeat mechanism The CANOPEN SLAVE ERR CTRL EVENT IND RES Error Control Event Indication informs you whenever anode guarding or heartbeat error occurs on the CANopen network or a CANopen Slave on the network starts or stops supervision by node guarding life guarding or by heartbeat CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 57 191 4 4 4 4 Receive PDO Events The PDO service allows to send application objects synchronously or asynchronously from one node CANopen Master or Slave to another one In terms of the Producer Consumer Model a CANopen Slave can act within a push
224. n starting the stack the hardware switches are evaluated if hardware switches are enabled via the TAG The values from the hardware switches will overwrite the values which was set CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 171 191 via database or packet previously This can be avoided if the hardware switches are disabled via the Tag List Editor tool A description of the Tag List Editor tool is given in reference 3 Database No available wat for packet configuration Yes Automatic Start i No Modify configuration with RCX SET HW SWITCH VALUE REQ Wait for Application Ready Yes HW switch enabled Yes Y Get HW switch values No modify configuration Configure stack Figure 20 Start up Process CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 172 191 5 3 1 RCX SET HW SWITCH VALUES REQ CNF Set the Values of the Hardware Switch If the Host application needs to change or set the hardware switch value the RCX_SET_HW_SWITCH_VALUES_REQ packet shall be used to transmit the values to the stack These values can be a new station add
225. n the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 0 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2931 CANOPEN_SLAVE_ERR_CTRL_EVENT_RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch Table 100 CANOPEN_SLAVE_PACKET_ERR_CTRL_EVENT_RES_T Response to Error Control Event Indication CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 154 191 5 2 20 CANOPEN SLAVE NMT COMMAND IND RES NMT Command Indication The CANopen Network Management NMT within the CANopen Master provides services for initializing starting monitoring resetting and stopping CANopen Slaves These are also called the Module Control Services Each time such a service is requested a CANOPEN_SLAVE_NMT_COMMAND_IND indication is received This enables the host application to react to the requests of the CANopen Master Which action should be taken depends on the value of variable ulNmtCommand in the following manner
226. nfirmation Area Variable Type Value Range Description tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet VOId inside the Source Process ulLen UINT32 8 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes ofthe CANopen Slave Task ulCmd UINT32 0x292B CANOPEN SLAVE GET IO INFO CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE GET IO INFO CNF DATA T ulRecvDataCnt UINT32 0 277 1 Receive Data Count ulSendDataCnt UINT32 0 2 1 Send Data Count Table 91 CANOPEN_SLAVE_PACKET_GET_IO_INFO_CNF_T Confirmation to Get I O Info Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 144 191 5 2 17 CANOPEN SLAVE SET API PARAM REQ CNF Set
227. ng ee t e doe i in P e ede a oe Ed eese Exe Ro gk npe eee einen 67 Figure 15 CANopen Time Stamp Protocol s i ra eren seen a ae enn RAKA KOA AA rene te sns ten 122 Fig re 16 CANopen PDO Protocol 4 inet ponen educat recent en deseo pei intra dria ener ek rinnen 128 Figure 17 CANopen PDO Protocol ertet riter nter eie bU ner gelten pesi reati pen cene 131 Figure 18 CANopen PDO Protocol riri iret ne dene Ie ede de lene ao cda dedere Ee dein eee deeds 135 Figure 19 NMT Protocol Pr M 154 Figtire 202 Start pPEOCBSS 3 2 eum a odd she le oo Ae Rod uo susan Bon sodes 171 Figure 21 Parameter List Structure eee aa ne ea aiaiaaeo nae caaeaeeeeeeecggeaeaeaeceeseesaeaeeeeeseseeceeaeeeeeeeeneaeea 175 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Appendix 7 3 Contacts Headquarters Germany Hilscher Gesellschaft f r Systemautomation mbH Rheinstrasse 15 65795 Hattersheim Phone 49 0 6190 9907 0 Fax 49 0 6190 9907 50 E Mail info hilscher com Support Phone 49 0 6190 9907 99 E Mail de support hilscher com Subsidiaries China Hilscher Systemautomation Shanghai Co Ltd 200010 Shanghai Phone 86 0 21 6355 5161 E Mail info hilscher cn Support Phone 86 0 21 635
228. ns ulRout UINT32 x Routing do not touch tData Structure CANOPEN APS GET STATE CNF DATA T aulUnused ar Unused present only due to compatibility reasons Table 44 CANOPEN APS PCK GET STATE CNF T Get State of AP Task Confirmation CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 77 191 5 1 2 CANOPEN APS SET CONFIGURATION REQ CNF Set Configuration This service can be used by the user application in order to configure the AP task with configuration parameters formerly called warmstart parameters After this request is received the AP task will configure the CANopen Slave V3 task with the given parameters from this request and if configured starts the communication with the CANopen network The following applies Configuration parameters will be stored internally In case of any error no data will be stored at all A channel init is required to activate the parameterized data This packet does not perform any registration at the stack automatically Registering must be performed with a separate packet such as the registration packet described in the netX Dual Port Memory Manual RCX REGISTER APP REO code 0x2F10 This request will be denied if the configuration lock flag is set for more information on this topic see section 3 3 1 Common Status The bus parameter structure
229. ollowing areas for military purposes or in weapon systems for the design construction maintenance or operation of nuclear facilities in air traffic control systems air traffic or air traffic communication systems in life support systems in systems in which failures in the software could lead to personal injury or injuries leading to death We inform you that the software was not developed for use in dangerous environments requiring fail proof control mechanisms Use of the software in such an environment occurs at your own risk No liability is assumed for damages or losses due to unauthorized use 1 8 4 Export The delivered product including the technical data is subject to export or import laws as well as the associated regulations of different counters in particular those of Germany and the USA The software may not be exported to countries where this is prohibited by the United States Export Administration Act and its additional provisions You are obligated to comply with the regulations at your personal responsibility We wish to inform you that you may require permission from state authorities to export re export or import the product 1 8 5 X Registered Trademarks CANopen is a registered trademark of CAN in AUTOMATION International Users and Manufacturers Group e V CiA Erlangen All other mentioned trademarks are property of their respective legal owners CANopen Slave Protocol API DOC111001APIO5EN Revision 5
230. on Interface Packet Structure Reference 84 191 BRK KK KK kk kk kk kk kk kk kk kk kk k kk k k k k k k KR type of lt code gt CA typedef struct CANOPEN APS SI EN APS SET CONFIGURATION CNF T CANOPI struct CANOPI OPEN_APS_SET_CONFIGURATION_CNF_Ttag lt code gt ET CONFIGURATION CNF Ttag EN APS SET CONFIGURATION CNF Ttag TLR PACKET HEADER T tHead packet header BRK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k KR Packet Description Structure Information CANOPEN APS PCK SET CONFIGURATION CNF T Type Confirmation Area Variable Type Value Description Range tHead Structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle untouched ulSrc UINT32 Source Queue Handle untouched ulDestId UINT32 ulAPSSOId Destination End Point Identifier untouched ulSrcId UINT32 ulCANOPES Source End Point Identifier untouched LVTOId ulLen UINT32 0 Packet Data Length In Bytes ulld UINT32 0 2 1 Packet Identification as Unique Number ulSta UINT32 See section 6 1 1 Codes of the CANopen APS Task ulCmd UINT32 ae CANOPEN_APS_SET_CONFIGURATION_CNF Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 X Routing do not touch Table 49 CANOPEN APS PCK SET CONFIGURATION CNF T
231. on as well as related user manuals accompanying texts and documentation at all times and without advance notice without obligation to report the change Changes will be included in future manuals and do not constitute any obligations There is no entitlement to revisions of delivered documents The manual delivered with the product applies Hilscher Gesellschaft fur Systemautomation mbH is not liable under any circumstances for direct indirect incidental or follow on damage or loss of earnings resulting from the use of the information contained in this publication CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 12 191 1 8 3 Exclusion of Liability The software was produced and tested with utmost care by Hilscher Gesellschaft f r Systemautomation mbH and is made available as is No warranty can be assumed for the performance and flawlessness of the software for all usage conditions and cases and for the results produced when utilized by the user Liability for any damages that may result from the use of the hardware or software or related documents is limited to cases of intent or grossly negligent violation of significant contractual obligations Indemnity claims for the violation of significant contractual obligations are limited to damages that are foreseeable and typical for this type of contract It is strictly prohibited to use the software in the f
232. on the netX supervise the host application and vice versa The control area is always present in the dual port memory Control Block Offset Type Name Description 0x0008 UINT32 ulApplicationCOS Application Change Of State State Of The Application Program INITIALIZATION LOCK CONFIGURATION 0x000C UINT32 ulDeviceWatchdog Device Watchdog Host System Writes Protocol Stack Reads Table 27 Communication Control Block Communication Control Block Structure typedef struct NETX CONTROL BLOCK Ttag UINT32 ulApplicationCOS UINT32 ulDeviceWatchdog NETX CONTROL BLOCK T For more information concerning the control block please refer to the netX DPM Interface Manual CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 42 191 4 Getting Started 4 1 Overview about Essential Functionality You can find the most commonly used functionality of the CANopen slave API within the following sections of this document Topic Section Section Name Number Process PDO data 5 2 12 CANOPEN_SLAVE_SEND_TXPDO_REQ Send TxPDO Request transfer Input Output Emergency Handling 5 2 6 CANOPEN_SLAVE_SEND_EMCY_REQ CNF Send Emergency Message Table 28 Overview about essential Functionality Cyclic and acyclic Data Transfer and Alarm Handling 4 2
233. onization cycle of the CANopen slave TxPDO Transmit PDO Table 9 Terms Abbreviations and Definitions All variables parameters and data used in this manual have basically the LSB MSB Intel data representation This corresponds to the convention of the Microsoft C Compiler 1 7 References to Documents This document refers to the following documents 1 EN 50325 4 Specification 2 CAN in Automation e V Nuremberg CANopen Application Layer and Communication Profile CiA Public Specification 301 Version 4 2 0 2011 3 Hilscher Gesellschaft f r Systemautomation mbH Dual Port Memory Interface Manual netX based products Revision 12 English 2008 2012 4 Hilscher Gesellschaft fur Systemautomation mbH Object Dictionary Version 3 Manual 2008 2013 5 Hilscher Gesellschaft f r Systemautomation mbH CAN Data Link Packet Interface Protocol API Manual 1 0 2010 2013 Table 10 References CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Introduction 11 191 1 8 Legal Notes 1 8 1 Copyright 2008 2013 Hilscher Gesellschaft f r Systemautomation mbH All rights reserved The images photographs and texts in the accompanying material user manual accompanying texts documentation etc are protected by German and international copyright law as well as international trade and protection provisions You are not authorized to duplicate t
234. or detected FLAG WDG D7 Reserved Reserved for further use D6 CANOPEN SLAVE EXT STATE Indication has been lost FLAG IND LOST D5 CANOPEN SLAVE EXT STATE Transmit overflow detected FLAG TX OVERFLOW D4 CANOPEN_SLAVE_EXT_STATE_ Receive overflow detected FLAG_RX_OVERFLOW D3 CANOPEN_SLAVE_EXT_STATE_ CAN is in Bus off state FLAG_BUS_OFF D2 CANOPEN SLAVE EXT STATE CAN is in error passive state FLAG PASSIVE D1 CANOPEN SLAVE EXT STATE CAN is activated FLAG CAN ACTIVE DO CANOPEN SLAVE EXT STATE CAN is initialized FLAG CAN INIT Table 26 Additional Info Flags ulNodeState Internal node state of node 0 Unknown state 1 Operational state 2 Stop 128 Pre operational state 255 Initializing CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory ulBusOffEveCnt Number of Bus off events ulErrorPassiveEveCnt Number of error passive events ulRxOverflowCnt Number of receive overrun events ulTxOverflowCnt Number of transmit overrun events ulErrorWarningCnt Total count of errors and warnings ulTimeoutCnt 40 191 Each CAN message is supervised by the card to be sent during 20ms by the CAN chip If not possible because the chip for example gets no acknowledging partner on the bus this counter is incremented by one aulReserved Reserved for further use ullndLostCnt Count of lost indications ulDia
235. packet is received when the Time Stamp Producer sends a time stamp by issueing a time service TIME The time service and the time protocol are described in section 9 2 4 of CANopen document DR301 Also see Figure 15 CANopen Time Stamp Protocol in the preceding subsection The contents of the time stamp is divided into a milliseconds part and a days part The milliseconds part variable ulMilliseconds contains the number of milliseconds that have occurred since midnight The days part variable usDays contains the number of days that have occurred since January 1 1984 Packet Structure Reference KKK KK IK kk kk kk kok kok kok kok kok kok kok kok k kk kk Ck kk kok kk kk kk kk kk kk k ck k ck k ck k ck k ck k ck ck ck ck ck ok ck ck ck ok sk ok ke e type of lt code gt CANOPEN SLAVE RECV TIME STAMP IND DATA Ttag lt code gt typedef struct CANOPEN SLAVE RECV TIME STAMP IND DATA Ttag CANOPEN SLAVE RECV TIME STAMP IND DATA T struct CANOPEN SLAVE RECV TIME STAMP IND DATA Ttag TLR_UINT32 ulMilliseconds TLR_UINT16 usDays RK IK IK kk kok kok kok kok kok kok kok kok kok kok I k kk kk kk kk kk kk kk kk kk k k k k I I 2 2 2 2 2 2 type of lt code gt CANOPEN SLAVE PACKET RECV TIME STAMP IND Ttag lt code gt typedef struct CANOPEN SLAVE PACKET RECV TIME STAMP IND Ttag CANOPEN SLAVE PACKET RECV TIME STAMP IND T
236. ption tHead structure TLR PACKET HEADER T ulDest UINT32 Destination Queue Handle ulSrc UINT32 Source Queue Handle ulDestld UINT32 ulAPSSOId Destination End Point Identifier specifying the final receiver of the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulCANOPENSL Source End Point Identifier specifying the origin of the packet VOId inside the Source Process ulLen UINT32 64 Packet Data Length in bytes ulld UINT32 0 274 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2926 CANOPEN_SLAVE_RECV_RXPDO_IND Command ulExt UINT32 O Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN_SLAVE_RECV_RXPDO_IND_DATA T mber 16 number aulRecvRxPdoNu UINT32 1 255 foreach Array of numbers of received RxPDOs Table 85 CANOPEN_SLAVE_PACKET_RECV_RXPDO_IND_T Receive RxPDO Indication CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 137 191 Packet Structure Reference k kok kok kok kok kok kok kok kok kok kok kok kok k k kok kok k kk I kk kk kk kk
237. r is set to default 4 5 3 2 Handling of Process Data in Standard Mode The CANopen slave implementation V3 provides 4 objects 0x2000 0x2003 for send data and 4 objects of receive data 0x2200 0x2203 each object has up to 256 bytes of process data Standard 128 bytes minimum 0 bytes and is transferred via PDO according to the active network configuration The data of these buffers are exchanged between the AP Task and the CANopen slave Task The AP Task transfers data from the receive buffers to the DPM input image and from the DPM output image to the send buffers Mapping of Input and Output Image to Send and Receive Objects The data of the send and receive objects are mapped linearly to the input and output image of the DPM as shown in the following table DPM input image byte offset Receive object index Receive object sub index 0 2200h 01h 1 2200h 02h 127 2200h 80h 128 2201h Oth 510 2203h 7Fh 511 2203h 80h Table 37 Mapping of Input Data in case of unchanged object lengths and no netX 10 applied DPM output image byte offset Send object index Send object sub index 0 2000h 01h 1 2000h 02h 127 2000h 80h 128 2001h 01h 510 2003h 7Fh 511 2003h 80h Table 38 Mapping of Output Data in case of unchanged object lengths and no netX 10 applied CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public O
238. re read from the log the field is set to zero The error log indicator is not supported yet 3 3 1 2 Master Implementation The master contains additional structures for the administration of all slaves which are connected to the master These are not discussed here as they are not relevant for the slave 3 3 1 3 Slave Implementation The slave firmware uses only the common structure as outlined in section 3 2 5 1 of the Hilscher netX Dual Port Memory Manual CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 37 191 3 3 2 Extended Status The content of the channel specific extended status block is specific to the implementation Depending on the protocol a status area may or may not be present in the dual port memory It is always available in the default memory map see section 3 2 1 of netX Dual Port Memory Manual Note Have in mind that all offsets mentioned in this section are relative to the beginning of the common status block as the start offset of this block depends on the size and location of the preceding blocks Extended Status Block Offset Name Description Type 0x0050 UINT8 abExtendedStatus 432 Extended Status Area Protocol Stack Specific Status Area Table 24 Extended Status Block General Structure Extended Status Block Structure
239. re information see page 110 Each type of indication is associated to a bit of the bit mask contained in variable ulEventsIndicated in the following manner Type Bit Mask Mask symbolic name No numeric value NMT State 0 0x01 CANOPEN SLAVE EVENT NMT STATE CHANGE MSK Change Event Time Stamp 1 0x02 CANOPEN SLAVE EVENT TIME STAMP MSK Event Error 2 0x04 CANOPEN SLAVE EVENT ERR CTRL MSK Control Event Receive 3 0x08 CANOPEN SLAVE EVENT RECV RXPDO MSK PDO Event NMT 4 0x10 CANOPEN_SLAVE_EVENT_NMT_COMMAND_MSK Command Event Send EMCY 5 0x20 CANOPEN_SLAVE_EVENT_SEND_EMCY_MSK Event Table 87 Bit Mask ulEventsIndicated Each of these bits within the bit mask of ulEventsIndicated allows switching on when set to 1 and off when set to 0 the associated type of event indication The higher bits of ulEventsIndicated should always be set to 0 CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 139 191 The NMT State Change Events include the Module Control Services described in the CANopen Specification
240. re of the Master life guarding event This time is denominated as life time of the CANopen node It must be longer than the guard time The life time is usually specified as life time factor which is then multiplied with the guard time in order to determine the life time of the NMT Slave The guard time can be specified in object Ox100C of the object dictionary The life time factor can be adjusted in object 0x100D Both values set to O indicates the guarding feature is currently disabled In this case it would be mandatory to use the Heartbeat feature described subsequently CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 56 191 Heartbeat Alternatively there is another error control service available which avoids sending remote frames the Heartbeat Mechanism In the CANopen network there may be one Heartbeat Producer cyclically sending heartbeat requests The time between to such Heartbeat requests is denominated as the Heartbeat Producer Time There may be multiple Heartbeat Consumers within the CANopen network on which the Heartbeat signal is received and causes an indication The Heartbeat Consumer supervises these indications If in an adjustable time no such indication occurs the Heartbeat Consumer assumes the Heartbeat Producer has failed and indicates a Heartbeat event This time is denominated as Heartbeat Consumer Time It is specified i
241. red for this event previously switching to the new state will be done automatically NMT Protocol Node Start Stop State Transition NMT Master NMT Slave s Byte 0 Byte 1 Request Indication s COB ID 0 Figure 11 Node Start Stop State Transition CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 59 191 The parameters are transferred within one communication object with 2 Byte on the CANopen network The NMT communication object is always assigned to the COB ID 0 which is the COB ID with the highest priority at all The NMT Command Events are related to the following packets of the CANopen Slave protocol stack CANOPEN_SLAVE_NMT_COMMAND_IND RES NMT Command Indication for making your application aware of external requests for a state change in the NMT Slave State Machine The NMT Command Event occurs at the CANopen Slave CANOPEN SLAVE NMT STATE CHANGE IND RES NMT State Change Indication indicating a change of the state within the CANopen Slave s NMT State Machine and allowing the application to react and perform all necessary application internal changes required after the change of NMT state 4 4 4 6 Synchronization Event SYNC The Synchronization Event is used to synchronize PDO processing with a highly precise time signal This allows performing synchronous PDOs Cyclic and acyclic
242. ress or a new baud rate setting for instance In this case it is necessary that the device has already received a default configuration and is waiting for application ready or BUS_ON signal As soon application ready is set by the host application the device starts with the last received parameters This means that the hardware switch values shall be set before the application ready is set The data area of the packet contains the number of switches to service variable ulNumberOfSwitches and as many structures of type TLR_SWITCH_VALUE_T describing a single switch as corresponds to the number of switches i e the content of variable ulNumberOfSwitches The structure contains a string uniquely identifying the described switch and the switch value i e the value set on the respective hardware switch It looks like structure tSwitchValue Type TLR SWITCH VALUE T Variable Type Value Description Range abSwitchName UINT8 16 char Switch Name Identifier string Max 16 characters ulValue UINT32 0 2 1 Switch value Table 112 t SwitchValue Structure of Switch Value set Initialization behavior At the CHANNEL INIT the stack shall store the value of the hardware switch i e device address which is set by the previous RCX_SET_HW_SWITCH_VALUES_REQ packet Only with a SYSTEM_RESET the device address shall be reset and a configuration with a new RCX_SET_HW_SWITCH_VALU
243. s ulLen UINT32 80 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2906 CANOPEN SLAVE SET BUSPARAM REO Command ulExt UINT32 0 Reserved ulRout UINT32 x Routing Information tData Structure CANOPEN SLAVE SET BUSPARAM REO DATA T tBusParam CANOP Bus parameter structure see EN SLA Table 45 Bus parameter structure VE BUS CANOPEN SLAVE BUSPARAM DATA T PARAM DATA T Table 75 CANOPEN SLAVE PACKET SET BUSPARAM REO T Set Bus Parameters Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 121 191 Packet Structure Reference RK IK IK IK IK kk kok kok kok kok kok kok kok kok k 2 22 22 2 2 I kk kk kk kk kk kk kk k k k k k I 2 2 2 2 22 2073 type of lt code gt CANOPEN SLAVE PACKET SET BUSPARAM CNF Ttag lt code gt typedef struct CANOPEN SLAVE PACKET SET BUSPARAM CNF Ttag CANOPEN SLAVE PACKET SET BUSPARAM CNF T Structure of task command set bus parameter confirmation struct CANOPEN SLAVE PACKET SET BUSPARAM CNF Ttag TLR_PACKET_HEADER_T tHead packet header 7 hg RK IK IK IK IK kk kk kk kk kk kk kok kok
244. s are transmitted without any protocol overhead This allows good performance 4 4 5 1 Producer Consumer Model PDO communication follows the Producer Consumer Model Producer Consumer Model Producer Consumer Push Model Request Indication CAN Data Frame Pull Model EAT ICICLE OK OCR VO AL Request s Indication Response CAN Data Frame Figure 12 Producer Consumer Model In the Producer Consumer Model each node may send data at any time for instance in case of a pre defined event happening Each station may listen to the transmitted messages When a message is received the node decides on its own whether the message is accepted or not This offers the advantage of greater flexibility and easy establishment of event driven processing for instance compared to the Master Slave Model Data transmission is done from a device the Producer to one or more other devices the Consumer s without any confirmation non confirmed mode The broadcast mechanism of the CAN low level protocol is used to accomplish this The assignment is made via identifiers which must match between Producer and Consumer CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 62 191 4 4 5 2 Services There are two services available for dealing with PDOs The Write Service The Write Service is implemented by the packet CANOPEN_SLAVE
245. s described in the protocol specific manual Depending on the command code of the indication packet a response packet to the netX firmware may or may not be required transition 7 gt 8 Application netX o e e o e o e Figure 4 Transition Chart Application as Client A The host application sends request packets to the netX firmware O The netX firmware sends a confirmation packet in return The host application receives indication packets from the netX firmware The host application sends response packet to the netX firmware may not be required JE Request fF Confirmation INDO Indication lt gt Response CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 23 191 2 4 2 Application as Server The host application has to register with the netX firmware in order to receive indication packets Depending on the protocol stack this is done either implicit if application opens a TCP UDP socket or explicit if application wants to receive unsolicited packets Details on when and how to register for certain events is described in the protocol specific manual When an appropriate event occurs and the host application is registered to receive such a notification the netX firmware passes an indication packet through the mailbox transition 1 gt 2 The host application is expected to send a response packet back to th
246. s mandatory 0x1029 Error Behavior The following error behaviors have between implemented in the CANopen Slave V3 protocol stack Remain no change of NMT state Stopped Pre operational if operational 0x1200 Server SDO Parameter 1 0x1400 143F RxPDO Communication Parameters Up to 8 mappable objects per PDO 0x1600 163F RxPDO Mapping Up to 8 mappable objects per PDO 0x1800 183F TxPDO Communication Parameters Up to 8 mappable objects per PDO 0x1A00 1A3F TxPDO Mapping Up to 8 mappable objects per PDO Table 40 Supported Object Dictionary Entries Communication Profile present in the EDS file CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 73 191 Additionally only for the Standard Mode the following objects of the manufacturer specific profile are available Index of Object Name of Object Default Minimum Maximum not for netX 10 0x2000 Bytes in 1 128 Bytes 0 Bytes 256 Bytes 0x2001 Bytes in 2 128 Bytes 0 Bytes 256Bytes 0x2002 Bytes in 3 128 Bytes 0 Bytes 256Bytes 0x2003 Bytes in 4 128 Bytes 0 Bytes 256Bytes 0x2200 Bytes out 1 128 Bytes 0 Bytes 256Bytes 0x2201 Bytes out 2 128 Bytes 0 Bytes 256Bytes 0x2202 Bytes out 3 128 Bytes 0 Bytes 256Bytes 0x2203 Bytes out 4 128 Bytes 0 Bytes 256Bytes Table 41 Supported Object Dictionary Entries Manufacturer specific Pro
247. s ofthe CANopen Slave Task ulCmd UINT32 0x292E CANOPEN_SLAVE_NMT_STATE_CHANGE_IND Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN_SLAVE_NMT_STATE_CHANGE_IND_DATA_T ulNmtState UINT32 1 2 128 130 New NMT State see Table 72 NMT States Table 95 CANOPEN_SLAVE_PACKET_NMT_STATE_CHANGE_IND_T NMT State Change Indication CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 149 191 Packet Structure Reference RK k kok kok kok kok kok kok kok kok kok kok kok kok kok kok I kk kk kk kk kk kk kk kk kk kk kk k k k k ck ck ck ck ok ck ok sk ok ke e kf type of lt code gt CANOPEN SLAVE PACKET NMT STATE CHANGE RES Ttag lt code gt typedef struct CANOPEN SLAVE PACKET NMT STATE CHANGE RES Ttag CANOPEN SLAVE PACKET NMT STATE CHANGE RES T struct CANOPEN SLAVE PACKET NMT STATE CHANGE RES Ttag TLR_PACKET_HEADER_T tHead packet header KKK KK IK kk kok kok I I kok kok kok kok kok k kk kk kk kk kok kk kk kk kk k ck kk k ck k ck k ck k ck k k k k k I I 2 2 Packet Description structure CANOPEN SLAVE PACKET NMT
248. s or Name of Station etc The data area of the packet is defined using the TLV Tag ParameterID Length Value format One or more parameters can be set with a one packet The amount of parameter is limited by the max packet length The parameter list is simply a sequence of parameter entries each of which is aligned on a DWORD boundary There is no need for the parameters to obey to a specific sequence The Parameter Data Length entry contains the real length of the parameter The relative offset in bytes of the next entry s Parameter ID field is calculated based on the length of the previous parameter rounded up to the next DWORD address The last or the only existing parameter can optionally be padded DWORD Parameter ID boundary Parameter Data Parameter ID Parameter Data Length Parameter Data e Padding 0 3 bytes DWORD boundary Figure 21 Parameter List Structure Known Parameter IDs The following tables summarize the known Parameter ID codes and the corresponding run time configuration information For convenience reasons the Parameter ID codes are grouped as given below e 0x00000000 0x000007FF reserved e 0x00000800 0x00000FFF reserved e 0x00001000 Ox00FFFFFF reserved e 0x10000000 OX1FFFFFFF reserved e 0x20000000 Ox2FFFFFFF reserved e 0x30000000 Ox3FFFFFFF Protocol Parameter IDs e 0x40000000 Ox4FFFFFFF reserved All other Tag Type codes are reserve
249. ss queue ulDestId UINT32 0 Destination End Point Identifier ulSrcId UINT32 0 2 1 Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 20 N Packet data length in bytes N depends on the number of used switch values ulld UINT32 0 2 1 Packet identification as unique number generated by the source process of the packet ulSta UINT32 Status not used for request ulCmd UINT32 RCX_SET_HW_SWITCH_VALUES_REQ Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure RCX SET HW SWITCH VALUES REO DATA T ulNumberOfSwitches UINT32 0 10 The number of used hardware switches tSwitchValue See below The tSwitchValue structures which contain the name and value for each switch Table 113 RCX SET HW SWITCH VALUES REO T Set Hardware Switch Values Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 174 191 Packet Structure Reference typedef struct RCX_SET_HW_SWITCH_VALUES_CNF_DATA_Ttag RCX_SET_HW_SWITCH_VALUES_CNF_DATA_T typedef RCX_SET_HW_SWITCH_VALUES_CNF_Ttag TLR PACKET HEADER T tHead packet header RCX SET HW SWITCH VALUES CNF DATA T Datar jp p
250. st neess 83 Table 49 CANOPEN APS PCK SET CONFIGURATION CNF T Set Warmstart Parameter Confirmation 84 Table 50 CANopen Slave Task Process Queue o eee eee eee eee ee tt tt ESEE eE treten inne tenete sisi sn nenne nn sns sn nnne nennen 85 Table 51 Packets of CANopen Slave Protocol Stack V3 and Restrictions of Usage lt lt lt 86 Table 52 CANOPEN SLAVE PACKET APP REGISTER REO T Register Application Reguest eee 88 Table 53 CANOPEN SLAVE PACKET APP REGISTER CNF T Register Application Confirmation 89 Table 54 CANOP SLAVE PACKET STARTSTOP REO T Start Stop Communication Reguest 91 Table 55 CANOPEN SLAVE PACKET STARTSTOP CNF T Start Stop Communication Confirmation 92 Table 56 CANOPEN SLAVE PACKET INITIALIZE REO T Initialization of CANopen Slave Request 94 Table 57 CANOPEN SLAVE PACKET INITIALIZE CNF T Initialization of CANopen Slave Confirmation 95 Table 58 CANOPEN SLAVE PACKET EXCHANGE DATA REO T Exchange Data Reguest nenn 97 Table 59 CANOPEN SLAVE PACKET EXCHANGE DATA CNF T Exchange Data Confirmation usss 99 Table 60 CANOPEN SLAVE PACKET STATE CHANGE IND T Change of State Indication sssssssse 101 Table 61 Flags of ulCanState aac aod cats E EE RE EE EE EE
251. stack can be configured in different ways Only one type of configuration can be active at a certain time These are evaluated at start up in the following order SYCON net database iniBatch database via netX Configuration Tool Warmstart Reguest packet compatibility Set Configuration Reguest packet After a Restart the stack will first search for the SYCON net database files config nxd If these are found all other configuration methods will not be accepted If no SYCON net database exists but an iniBatch database exists its configuration will be used and configuration packets will be not accepted If no database is found the stack is unconfigured until the receipt of the first configuration packet In this case the firmware waits for the SET CONFIGURATION REO or WARMSTART REO packet Once one of these packets i e SET CONFIGURATION REO was received the other one i e WARMSTART REO will be rejected The host has the possibility to modify the configuration with the packet RCX_SET_HW_SWITCH_VALUE_REQ Using the hardware switches for adjusting of slave address and baudrate requires the option Application_controlled being active either when configuring using SET CONFIGURATION REO packet see CANOPEN_APS_SET_CONFIGURATION_REQ CNF Set Configuration on page 77 or in the SYCON net database file config nxd The stack will start the device with the received configuration as soon as the application ready flag is set by the host application O
252. stack has the permission to communicate on the network if cleared the permission was denied and the protocol stack will not open network connections 3 Configuration Locked RCX COMM COS CONFIG LOCKED 0 1 The Configuration Locked flag is set if the communication channel firmware has locked the configuration database against being overwritten Re initializing the channel is not allowed in this state To unlock the database the application has to clear the Lock Configuration flag in the control block see section 3 2 4 of the netX DPM Interface Manual 4 Configuration New RCX_COMM_COS_CONFIG_NEW 0 1 The Configuration New flag is set by the protocol stack to indicate that a new configuration became available which has not been activated This flag may be set together with the Restart Reguired flag 5 Restart Reguired RCX COMM COS RESTART REGUIRED 0 1 The Restart Required flag is set when the channel firmware requests to be restarted This flag is used together with the Restart Reguired Enable flag below Restarting the channel firmware may become necessary if a new configuration was downloaded from the host application or if a configuration upload via the network took place 6 Restart Required Enable RCX COMM COS RESTART REQUIRED ENABLE 0 1 The Restart Required Enable flag is used together with the Restart Required flag above If set this flag enables the execution of the Restart Reguired command in the netX firmware
253. t Identification As Unique Number ulSta UINT32 See section 6 1 1 Codes of the CANopen APS Task ulCmd UINT32 0x00002E04 CANOPEN APS SET CONFIGURATION REO Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 X Routing do not touch tData Structure CANOPEN APS SET CONFIGURATION REO DATA T ulSystemFlags UINT32 System Flags BIT 0 AUTOSTART APPLICATION CONTROLLED 0 communication with a controller after a device start is allowed without BUS ON flag but the communication will be interrupted if the BUS ON flag changes state to 0 1 communication with controller is allowed only with the BUS ON flag BIT 1 O STATUS DISABLED ENABLED Not supported yet BIT 2 IO STATUS 32 BIT Not supported yet BIT 3 Reserved for further use set to zero BIT 4 ADDRESS_SWITCH Should be set when hardware address switch is used and there is no TAG present BIT 5 BAUD_SWITCH Should be set when hardware baudrate switch is used and there is no TAG present BIT 6 31 Reserved for further use set to zero ulWdgTime UINT32 Watchdog supervision 0 Watchdog supervision deactivated 20 65535 Watchdog time in milliseconds tBusParam CANOPE Bus parameter structure N_SLAVE _BUSPAR AM_DATA _T Table 48 CANOPEN_APS_PCK_SET_CONFIGURATION_REO Set Warmstart Parameter Request CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public O Hilscher 2011 2013 The Applicati
254. t dictionary by your application or if you do not have any legacy applications Only Extended Mode allows to fully exploit the new possibilities of the CANopen Slave V3 Protocol Stack 4 5 2 Where can I switch between Standard Mode and Extended Mode If the Extended Mode Flag BIT29 of the CANopen flags in CANOPEN SLAVE BUSPARAM DATA T is set to TRUE i e set to 1 then the CANopen Slave V3 Protocol Stack is in Extended Mode If this flag is set to FALSE i e set to zero then the CANopen Slave V3 Protocol Stack is in Standard Mode For more information see Table 45 Bus parameter structure CANOPEN SLAVE BUSPARAM DATA T Let us now explain in detail the most important differences between Standard Mode and Extended Mode CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 4 5 3 Standard Mode The Standard Mode is characterized by the following features 69 191 The Standard Mode has been designed for maximum compatibility to existing applications for CANopen Slave V2 The bus parameter structure CANOPEN SLAVI E STD BUSPARAM DATA T is applied see Table 45 Bus parameter structure CANOPEN SLAVE BUSPARAM DATA T on page 78 Configuration can be done with tools System configurator SYCON net or netX Configuration Tool or by Set Configuration packet The DPM contains the content of the objects 0x2000 to 0x2003 TxP
255. t to zero BIT 1 3 Reserved for further use set to zero BIT4 up to BIT10 are only applicable in Standard Mode BIT 4 Evaluate Vendor ID DISABLED ENABLED BIT 5 Evaluate Product Code DISABLED ENABLED BIT 6 Evaluate Serial Number DISABLED ENABLED BIT 7 Evaluate Revision Number DISABLED ENABLED BIT 8 Evaluate Device Type DISABLED ENABLED BIT 9 Evaluate Object Size DISABLED ENABLED BIT 10 Evaluate PDO Count DISABLED ENABLED BIT 11 15 Reserved for further use set to zero BIT 16 Disable Send COS Synchronous Acyclic BIT 17 Disable Send COS Manufacturer Spec BIT 18 Disable Send COS Profile Spec BIT 19 24 Reserved for further use set to zero BIT 25 Hold last state BIT 26 28 Reserved for further use set to zero BIT 29 Extended Mode Flag BIT 30 32 Reserved for further use set to zero Baudrate Baud rate of CANopen connection See below Allowed values all baud rates offered in Table 46 Codes and Corresponding Baud Rates of CANopen Network Flags CANopen Flags BIT 0 29 BIT IDENTIFIER DISABLED ENABLED Not supported yet BIT 1 31 Reserved for further use set to zero Bus Parameters This item either contains the standard parameters or the extended parameters The standard parameters are described in Table 36 Standard bus parameter structure CANOPEN SLAVE STD BUSPARAM DATA T The extended parameters are described in Table 39 Extended bus parameter structure CANOPEN SLAVE EXT BUSPARAM
256. tX devices with 8 kByte Dual port Memory CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 3 1 2 Process Data Output The output data block is used by field bus and industrial Ethernet protocols that utilize a cyclic data 26 191 exchange mechanism The output data Image is used to transfer cyclic data to the network The default size of the output data image is 5760 byte An output data block may or may not be available in the dual port memory They are always available in the default memory map see netX DPM Manual Output Data Image Offset Name Description 0x1000 abPd0Output 5760 Output Data Image Cyclic Data To The Network Table 17 Output Data Image For netX devices with 8 kByte Dual port Memory the size of the output data image is 1536 byte Output Data Image Offset Name Description 0x1000 abPd0Output 1536 Output Data Image Cyclic Data To The Network Table 18 Output Data Image for netX devices with 8 kByte Dual port Memory CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 27 191 3 2 Acyclic Data Mailboxes The mailbox of each communication channel has two areas that are used for non cyclic message transfer e Send Mailbox Packet
257. te the packet This field is mandatory Source Queue Handler The ulSrc field identifies the sender of the packet In the context of the netX firmware inter task communication this field holds the identifier of the sending task Usually a driver uses this field for its own handle but it can hold any handle of the sending process Using this field is mandatory The receiving task does not evaluate this field and passes it back unchanged to the originator of the packet CANopen Slave Protocol API DOC111001APIOSEN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 29 191 Destination Identifier The ulDestld field identifies the destination of an unsolicited packet from the netX firmware to the host system It can hold any handle that helps to identify the receiver Therefore its use is mandatory for unsolicited packets The receiver of unsolicited packets has to register for this Source Identifier The ulSrcid field identifies the originator of a packet This field is used by a host application which passes a packet from an external process to an internal netX task The u Srcid field holds the handle of the external process When netX operating system returns the packet the application can identify the packet and returns it to the originating process The receiving task on the netX does not evaluate this field and passes it back unchanged For inter task communication this field is not used
258. the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2933 CANOPEN SLAVE NMT COMMAND RES Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE NMT COMMAND RES DATA T ulNmtState UINT32 Valid NMT New local NMT state State Table 103 CANOPEN_SLAVE_PACKET_NMT_COMMAND_RES_T Response to NMT Command Indication CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 158 191 5 2 21 CANOPEN SLAVE GET BUSPARAM REQ CNF Get Bus Parameters This packet can be used to retrieve the current bus parameters All parameters used by the confirmation packet are also used by the request packet CANOPEN_APS_SET_CONFIGURATION_REO CNF meaning and in the same way Set Configuration with the same For a precise description of these parameters see Table 45 Bus parameter structure CANOPEN_SLAVE_BUSPARAM_DATA_T on page 78 and the description given there Pack
259. those functions use the four parameters ulDest ulSrc ulDestId and ulSrcIa This chapter and the next one inform about how to work with these important parameters 2 2 Accessing the Protocol Stack by Programming the AP Task s Queue In general programming the AP task or the stack has to be performed according to the rules explained in the Hilscher Task Layer Reference Manual There you can also find more information about the variables discussed in the following CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Fundamentals 14 191 2 2 1 Getting the Receiver Task Handle of the Process Queue To get the handle of the process queue of the CANopen Slave Task the Macro TLR QUE IDENTIFY needs to be used It is described in detail within section 10 1 9 3 of the Hilscher Task Layer Reference Model Manual This macro delivers a pointer to the handle of the intended queue to be accessed which is returned within the third parameter phQue if you provide it with the name of the queue and an instance of your own task The correct ASCII queue name for accessing the CANopen Slave Task which you have to use as current value for the first parameter pszIdn is ASCII queue name Description QUE CANOPENSLV Name of the CANopen slave Task process queue QUE COS ODV3 Name of the CANopen slave Task ODV3 process queue
260. tion If the process 22 sends a packet through the channel mailbox to the AP task the packet header has to be filled in as follows Object Variable Numeric Explanation Name Value Destination ulDest 32 This value needs always to be set to 0x00000020 the channel Queue Handle 0x00000020 token when accessing the protocol stack via the local communication channel mailbox Source Queue ulSrc 444 Denotes the host application 444 Handle Destination ulDestId 0 In this example it is not necessary to use the destination identifier Identifier Source ulSrcId 22 Denotes the process number of the process within the host Identifier application and needs therefore to be supplied by the programmer of the host application Table 14 Using ulSrc andulSrcId For packets through the channel mailbox the application uses 32 7 0x20 Channel Token for the destination queue handler u Dest The source queue handler u Src and the source identifier ulSrcld are used to identify the originator of a packet The destination identifier u Destld can be used to address certain resources in the protocol stack It is not used in this example The source queue handler ulSrc has to be filled in Therefore its use is mandatory the use of ulSrcld is optional The netX operating system passes the request packet to the protocol stack s AP task The protocol stack then builds a reply to the packet and returns it to the mai
261. transfer from host system to firmware e Receive Mailbox Packet transfer from firmware to host system The send and receive mailbox areas are used by field bus protocols providing a non cyclic data exchange mechanism Another use of the mailbox system is to allow access to the firmware running on the netX chip itself for diagnostic and identification purposes The send mailbox is used to transfer cyclic data to the network or to the firmware The receive mailbox is used to transfer cyclic data from the network or from the firmware A send receive mailbox may or may not be available in the communication channel It depends on the function of the firmware whether or not a mailbox is needed The location of the system mailbox and the channel mailbox is described in the netX DPM Interface Manual Note Each mailbox can hold one packet at a time The netX firmware stores packets that are not retrieved by the host application in a packet queue This queue has limited space and may fill up so new packets maybe lost To avoid these deadlock situations it is strongly recommended to empty the mailbox frequently even if packets are not expected by the host application Unexpected command packets should be returned to the sender with an Unknown Command in the status field unexpected reply messages can be discarded CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 3
262. ts with one zero is not defined STRUCTURE VERSION define RCX STATUS BLOCK VERSION 0x0001 Watchdog Timeout All Implementations This field holds the configured watchdog timeout value in milliseconds The application may set its watchdog trigger interval accordingly If the application fails to copy the value from the host watchdog location to the device watchdog location the protocol stack will interrupt all network connections immediately regardless of their current state For details see section 4 13 of the netX DPM Interface Manual Host Watchdog All Implementations The protocol stack supervises the host system using the watchdog function If the application fails to copy the value from the device watchdog location section 3 2 5 of the netX DPM Interface Manual to the host watchdog location section 3 2 4 of the netX DPM Interface Manual the protocol stack assumes that the host system has some sort of problem and shuts down all network connections For details on the watchdog function refer to section 4 13 of the netX DPM Interface Manual Error Count All Implementations This field holds the total number of errors detected since power up respectively after reset The protocol stack counts all sorts of errors in this field no matter if they were network related or caused internally Error Log Indicator All Implementations The error log indicator field holds the number of entries in the internal error log If all entries a
263. ture TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle OUE CANOPEN SLV ulSrc UINT32 0 277 4 Source Queue Handle ulDestld UINT32 ulCANOPENSL Destination End Point Identifier specifying the final receiver of vold the packet within the Destination Process Set to 0 for the Initialization Packet ulSrcld UINT32 ulAPSSOId Source End Point Identifier specifying the origin of the packet inside the Source Process ulLen UINT32 4 Packet Data Length in bytes ulld UINT32 0 2 1 Packet Identification as unique number generated by the Source Process of the Packet ulSta UINT32 O See section 6 2 Codes of the CANopen Slave Task ulCmd UINT32 0x2928 CANOPEN SLAVE SET EVENTS INDICATED REO Command ulExt UINT32 0 Extension not in use set to zero for compatibility reasons ulRout UINT32 x Routing do not touch tData structure CANOPEN SLAVE SET EVENTS INDICATED REO DATA T ulEventsIndicated UINT32 Bit mask Indicated events Table 88 CANOPEN_SLAVE_PACKET_SET_EVENTS_INDICATED_REQ_T Set Events Indicated Request CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 141 191 Packet Structure Reference RK KK IK kk IK I kok kok kok I EZ k kk kk kk kk I kk kk
264. twork and task related issues In some respects status and control block are used together in order to exchange information between host application and netX firmware The application reads a status block whereas the control block is written by the application Both status and control block have registers that use the Change of State mechanism see also section 2 2 1 of the netX Dual Port Memory manual 3 3 1 Common Status The Common Status Block contains information that is the same for all communication channels The start offset of this block depends on the size and location of the preceding blocks The status block is always present in the dual port memory 3 3 1 1 All Implementations The structure outlined below is common to all protocol stacks Common Status Structure Definition Common Status Offset Type Name Description 0x0010 UINT32 ulCommunicationCOS Communication Change of State READY RUN RESET REQUIRED NEW CONFIG AVAILABLE CONFIG LOCKED 0x0014 UINT32 ulCommunicationState Communication State NOT CONFIGURED STOP IDLE OPERATE 0x0018 UINT32 ulCommunicationError Communication Error Unique Error Number According to Protocol Stack 0x001C UINT16 usVersion Version Version Number of this Diagnosis Structure 0x001E UINT16 usWatchdogTime Watchdog Timeout Configured Watchdog Time 0x0020 UINT16 usHandshakeMode Handshake Mode Process Data Transfer Mode see netX DPM Interf
265. ur further use set to zero n RK KK HK kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk ok kok kok k kk ke kk kc ko k 2 2 2 kk kc kc k kc k k kk kk ck kk kk ke ke type of lt code gt CANOPEN SLAVE PACKET INITIALIZE REO Ttag lt code gt typedef struct CANOPEN SLAVE PACKET INITIALIZE REQ Ttag CANOPEN SLAVE PACKET INITIALIZE REQ T Structure of task command delete configuration request struct CANOPEN SLAVE PACKET INITIALIZE REQ Ttag TLR_PACKET_HEADER_T tHead packet header 2 CANOPEN SLAVE INITIALIZE REQ DATA T tData packet request data l i a KKK KK kk kok kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk kk k k k k ck ck ck ck ck ck ck ck ck ckckck ck sk CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 The Application Interface 94 191 Packet Description Structure Information CANOPEN SLAVE PACKET INITIALIZE REQ T Type Reguest Area Variable Type Value Range Description tHead Structure TLR PACKET HEADER T ulDest UINT32 0x20 Destination Queue Handle of CANopen slave Task Process OUE CANOPEN Queue SLV ulSrc UINT32
266. very time the status changes the netX protocol stack toggles the netX Change of State Command flag in the netX communication flags register see section 3 2 2 1 of the netX DPM Interface Manual The application then has to toggle the netX Change of State Acknowledge flag back acknowledging the new state see section 3 2 2 2 of the netX DPM Interface Manual ulCommunicationCOS netX writes Host reads Table 22 Communication State of Change pa Configuration Locked RCX COMM COS CONFIG LOCKED CANopen Slave Protocol API DOC111001APIO5EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Dual Port Memory 34 191 Communication Change of State Flags netX System gt Application Bit Definition Description 0 Ready RCX_COMM_COS_READY 0 1 The Ready flag is set as soon as the protocol stack is started properly Then the protocol stack is awaiting a configuration As soon as the protocol stack is configured properly the Running flag is set too 1 Running RCX COMM COS RUN 0 1 The Running flag is set when the protocol stack has been configured properly Then the protocol stack is awaiting a network connection Now both the Ready flag and the Running flag are set 2 Bus On RCX COMM COS BUS ON 0 1 The Bus On flag is set to indicate to the host system whether or not the protocol stack has the permission to open network connections If set the protocol
267. ys the internal structure of the tasks which together represent the CANopen Slave Stack System Area Handshake Area Channel Area C MBX MBX Channel pm Out In DPM Out In C In E E E E m E E E E u opvaTask Task opveTask pm CANopen Slave Task CANopen Slave Task Task Function Interface I TL n Packet Interface CAN_DL Task 1 uus A xC PE XC CAN Figure 6 Internal Structure of CANopen Slave V3 Firmware The dual port memory is used for exchange of information data and packets Configuration and IO data will be transferred using this way CANopen Slave Protocol API DOC111001API05EN Revision 5 English 2013 10 Released Public Hilscher 2011 2013 Getting Started 46 191 The user application only accesses the task located in the highest layer namely the AP task which constitutes the application interface of the CANopen Slave stack In detail the various tasks have the following functionality and responsibilities AP Task The AP Task provides the interface to the user application and the control of the stack It also completely handles the Dual Port Memory interface of the communication channel In detail it is responsible for the following Handling the communication channels DPM interface Configuration of the protocol stack IO Process data exchange Channel mailboxes Watchdog supervision Handling of applications packets Send Receive packets CANopen Slave T
Download Pdf Manuals
Related Search
Related Contents
GreenStar AutoTrac & Parallel Tracking Samsung ML-1710P Bruksanvisning Manual - Stanford Research Systems Copyright © All rights reserved.
Failed to retrieve file