Home

Software Manual - SYS TEC electronic GmbH

image

Contents

1. 2222240u004244n nn 20 Example of an OD with 2 SRDOS nn 8 L 1077e_08 SYS TEC electronic GmbH 2015 References References 1 EN 50325 5 2010 Industrial communications subsystem based on ISO 11898 CAN for controller device interfaces Part 5 Functional safety communication based on EN 50325 4 2 CANopen User Manual Software Manual L 1020 SYS TEC electronic GmbH 3 CANopen Object Dictionary Software Manual L 1024 SYS TEC electronic GmbH 4 CAN Driver Software Manual L 1023 SYS TEC electronic GmbH Introduction This manual is an extension of the CANopen User Manual L 1020 and describes the application layer of the SRDO module Section 1 provides some basic terms of the Safety Framework Section 2 explains the implementation and describes the user functions user interfaces and data structures L 1077e_08 SYS TEC electronic GmbH 2015 1 Basics CANopen Safety 1 Basics CANopen Safety The CiA Draft Standard Proposal 304 CANopen Framework for Safety Relevant Communication defines the CANopen Protocol extensions for the integration of safety related devices in CANopen networks The protocol allows for using safety targeted devices and non safety targeted devices in one CANopen network Safety functions are realized via specific communication objects the SRDOs safety related data objects With the CANopen Safety Protocol it is possible to directly
2. Clarified description of safe state D Kr ger Fixed and clarified description of D Kr ger safe state L 1077e_08 SYS TEC electronic GmbH 2015 This manual includes descriptions for copyrighted products that are not explicitly indicated as such The absence of the trademark symbol does not infer that a product is not protected Additionally registered patents and trademarks are similarly not expressly indicated in this manual The information in this document has been carefully checked and is believed to be entirely reliable However SYS TEC electronic GmbH assumes no responsibility for any inaccuracies SYS TEC electronic GmbH neither guarantees nor accepts any liability whatsoever for consequential damages resulting from the use of this manual or its associated product SYS TEC electronic GmbH reserves the right to alter the information contained herein without prior notification and does not accept responsibility for any damages which might result Additionally SYS TEC electronic GmbH neither guarantees nor assumes any liability for damages arising from the improper usage or improper installation of the hardware or software SYS TEC electronic GmbH further reserves the right to alter the layout and or design of the hardware without prior notification and accepts no liability for doing so Copyright 2015 SYS TEC electronic GmbH All rights including those of translation reprint b
3. CCM_DECL_INSTANCE_HDL Parameter CCM_DECL_INSTANCE_HDL Instance handle Return kCopSuccessful The function was executed without error All other return codes are reserved Description The function is called by the SRDO module when a GFG message is received tCopKernel PUBLIC AppGfcEvent CCM DECL INSTANCE HDL process information according to the application for example change to intrinsically safe state return kCopSuccessful This function is not called if the configuration SRDO_USE_GFC is set to FALSE L 1077e_08 SYS TEC electronic GmbH 2015 Extension of the CANopen user layer 2 9 4 Function AppProgMonEvent Syntax include lt cop h gt tCopKernel PUBLIC AppProgMonEvent CCM_DECL_INSTANCE_HDL_ tProgMonEvent Event_p Parameter CCM_DECL_INSTANCE_HDL Instance handle Event_p Event of the executed program code kSrdoPMEvSctChecked SCT of a SRDO was tested kSrdoPMEvSctNotCheckedItIsTx SCT of a SRDO was not tested because it is a send SRDO kSrdoPMEvSctNotCheckedItIsInvalid SCT of a SRDO was not tested because is is switched off kSrdoPMEvSctNotCheckedNotOperational SCT of a SRDO was not tested because the node is not in OPERATIONAL kSrdoPMEvSrdoError found faulty SRDO send and receive SRDO kSrdoPMEvSrdoReceived a SRDO was received kSrdoPMEvSrdoTransmitted a SRDO has been sent Return
4. Evaluation of exceptions that can occur due to programming errors e g accesses to protected memory accesses to unaligned addresses etc The extension package SO 1059 already provides the following options for safety tests in the software Calculating CRC over SRDO configuration Sending of SRDOs over two CAN messages with the plain and bitwise inverted data Monitoring the Safety Cycle Time SCT and Safety Related Validation Time SRVT as well as the bitwise inverted data for received SRDOs If an error occurs the software must always go into a safe mode for the switching outputs so that no living beings can be injured or other machines destroyed It is recommended to coordinate the structure of the hardware with the certification body before starting with the implementation L 1077e_08 SYS TEC electronic GmbH 2015 10 Extension of the CANopen user layer 2 Extension of the CANopen user layer This section explains the extension of the SYS TEC CANopen Stack user layer described in L 1020 Moreover it provides details about the data structures and API functions of the SYS TEC electronic GmbH specific implementation of the CANopen standard CiA DS 304 in the following called SRDO module The description contains the syntax of the functions the parameter the return value and explanations about the usage Section 2 13 explains the meaning of the return codes and the supported abort codes 2 1 Limitations of the
5. kCopSrdoLengtExceeded kCopSrdoNotHandledInApp Description The function was executed without error The SRDO chosen does not exist The configured SRDO granularity is not supported The SRDO configuration is faulty time configuration SCT SRVT The SRDO configuration is faulty COB Ids The SRDO configuration is faulty CRC The action is not allowed in this NMT state faulty SRDO The action was tried with a configuration The action was tried with a switched off SRDO It was tried to send a receive SRDO The CAN Identifier is not valid The CAN Identifier is already being used The two CAN meassages of a SRDO have been received in the wrong order The SCT of a receive SRDO was exceeded The SRVT of a receive SRDO was exceeded At least on of the two received CAN Identifier of a SRDO is faulty At least on of the two received CAN message lenghts of the SRDO is faulty The mapping of a SRDO is faulty The data of the CAN messages of a SRDO is not inverse The length of the SRDO chosen Mapping exceeds 64 Bit The SRDO error reported to the application was not processed correctly L 1077e_08 SYS TEC electronic GmbH 2015 24 Reference environment TMDX570LS20SMDK 3 Reference environment TMDX570LS20SMDK Texas Instruments provide the development board TMDX570LS20SMDK It serves as a reference environment for our safety extension For the handling of projects in our extension there a
6. kCopSuccessful The function was executed without error All other return codes are reserved Description The function is called by the SRDO module when certain program steps are processed The application can setup a logical monitoring of the program run This function is not called if in the configuration file copcfg h the Define SRDO_USE_PROGMONITOR is set to FALSE L 1077e_08 SYS TEC electronic GmbH 2015 2 Extension of the CANopen user layer tCopKernel PUBLIC AppProgMonEvent CCM DECL INSTANCE HDL tProgMonEvent Event p switch Event pi case kSrdoPMEvSctChecked s called for each Rx SRDO wPMonValue_g kPMonSctChecked break case kSrdoPMEvSctNotCheckedItIsTx s called for each Rx SRDO wPMonValue_g kPMonSctNotCheckedItIsTx break case kSrdoPMEvSctNotCheckedItIsInvalid s called for each switched off SRDO wPMonValue_g kPMonSctNotCheckedItIsInvalid break case kSrdoPMEvSctNotCheckedNotOperational is called once for all SRDO wPMonValue_g kPMonSctNotCheckedNotOperational break case kSrdoPMEvSrdoError is called for faulty SRDO wPMonValue_g kPMonSrdoError break case kSrdoPMEvSrdoReceived is called for each received SRDO wPMonValue_g kPMonSrdoReceived break case kSrdoPMEvSrdoTransmitted is called for each sent SRDO wPMonValue_g kPMonSrdoTransmitted break default break return kCopSuccessful L 1077e_08
7. 2 10 Object directory Various safety related entries of the object directory are described in chapter 1 2 10 1 Macros for safety objects There are special macros for the different SRDO entries for the realisation in the CANopen Software Those are described in this chapter Please Note The OD builder at the time of this note version V1 19 can not generate the specific macros for the SRDOs Therefore you should not use this tool for the creation of the object directory Please read the chapter 2 2 Further information about the object directory is described in document L 1024 CANopen Object Directory Software Manual OBD_CREATE_SRDO_GFC_PARAM The macro OBD_CREATE_SRDO_GFC_PARAM is used to create entry Global Fail Safe Command Parameter Index 0x1300 The macro does not have parameters OBD_CREATE_SRDO_COMMU ind num dir sct srvt cob1 cob2 and OBD_BEGIN_SRDO_MAPP ind num cnt OBD_SUBINDEX_SRDO_MAPP ind sub num name val OBD_END_SRDO_MAPP ind The macro OBD_CREATE_SRDO_ COMMU is used to define the communication parameter of the SRDO Macros OBD_xxx_SRDO_MAPP are used to define the mapping parameters of a SRDO An entry of a SRDO always starts with the macro OBD_BEGIN_SRDO_MAPP The different subindex entries are defined by macro OBD_SUBINDEX_SRDO_MAPP The entry ends with OBD_END_SRDO_MAPP Since there is always the communication parameter and the mapping parameter that correspond to one SRDO it is i
8. SYS TEC electronic GmbH 2015 Extension of the CANopen user layer 2 9 5 Function AppCbNmtEvent This function is called by the CANopen Stack when the NMT Statemachine is running and must contain different event calls of the SRDO module kNmtEvResetCommunication Notify variable fields by calling CcmStaticDefineSrdoVarFields for static mapping Initialisation of the SRDO communication parameter by calling CemWriteObject with the respective parameters define all SRDOs in static SRDO modul CemStaticDefineSrdoVarFields 0x1301 amp SrdoNormalData m_abSrdoData 0 amp SrdolnversData m abSrdoData 0 if Ret kCopSuccessful Ret Ret write information direction into OD CemWriteObject 0x1301 1 amp bDirection 1 Ret kCopSuccessful if set configuration valid bTemp 0xA5 Ret if CemWriteObject Ret kCopSuccessful kNmtEvEnterPreOperational Ox13FE 0 amp bTemp 1 SRDO may not be processed anymore save NMT status to evaluate this in the main loop bSrdoState kNotOperational kNmtEvEnterOperational read the actual SRDO parameter by calling CcmGetSrdoParameter SRDO must be processed save NMT status to evaluate this in the main loop CemGetSrdoParam 0x1301 amp SrdoCommuParam bSrdoState kEnterOperational L 1077e_08 SYS TEC electronic GmbH 2015 4 Extension of the CANopen user layer
9. linked or mapped with bitwise inverted data of the SRDO Return kCopSuccessful The function was executed without error For more return codes see 2 12 1 Function SrdoStaticDefineVarField Description This function defines the variable fields for a SRDO The application only modifies the variables via those variable fields When sending a SRDO those data bytes are copied from the variable field into the two CAN messages When receiving a SRDO the data bytes of the CAN messages are directly copied into the variable fields The function checks if the specified variable fields are conform with the variables to which the mapping in the OD points This function represents the API function for SrdoStaticDefineVarFields and calls it L 1077e_08 SYS TEC electronic GmbH 2015 27 Extension of the CANopen user layer 2 8 8 Function CcmCalcSrdoCrc Syntax include lt srdo h gt tCopKernel PUBLIC CcmCalcSrdoCre MCO_DECL_INSTANCE_PTR_ WORD wCommulndex_p WORD pwCrc_p Parameter MCO_DECL_INSTANCE_PTR Pointer to the instance wCommulndex_p Index object contains the communication parameters of the SRDO in the object directory pwCrc_p Pointer to a WORD variable to return the 16 bit CRC in the calling function Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function calculates the checksum CRC over a SRDO and returns it t
10. wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function writes the status of a SRDO For setup and usage of the status see chapter 2 5 3 L 1077e_08 SYS TEC electronic GmbH 2015 18 Extension of the CANopen user layer 2 11 11 Function SrdoGetCommuParam Syntax include lt srdo h gt tCopKernel PUBLIC SrdoGetCommuParam MCO_DECL_INSTANCE_PTR_ WORD wSrdoCommulndex_p tSrdoCommuParam pSrdoCommuParam_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory pSrdoCommuParam_p Pointer to the structure in which the function copies the values for the Information Direction and SCT Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function reads the parameters of a SRDO that are necessary in the application Those are Information Direction and SCT See associated API function See associated API Function CcmGetSrdoParam L 1077e_08 SYS TEC electronic GmbH 2015 19 Extension of the CANopen user layer 2 11 12 Function SrdoGetMappParam Syntax include lt srdo h gt tCopKernel PUBLIC SrdoGetMappParam MCO_DECL_INSTANC
11. Pointer to a variable in which the function provides the communication index of the faulty SRDO in case of a faulty configuration Return kCopSuccessful The function was executed without error For more return codes see 2 11 7 Function SrdoCheckConfig Description The function calculates the checksum CRC for all going SRDO also deactivated SRDOs with direction 0 and compares them to the one configured in the OD If it identifies an error it sends back the error and the communication index of the faulty SRDO This function represents the API function for SrdoCheckConfig and calls it It is necessary to call this function as part of the diagnosis periodically in the diagnostic test interval If an error is detected and the entry Configuration Valid Index Ox13FE is valid OxA5 then has to be changed in the safe state Please note The function SrdoCheckConfig is called with the value OxA5 by the SRDO module when the entry Configuration Valid is written Index Ox13FE in the object directory L 1077e_08 SYS TEC electronic GmbH 2015 21 Extension of the CANopen user layer 2 8 3 Function CcmSendGfc Syntax include lt cop h gt tCopKernel PUBLIC CcmSendGfc CCM_DECL_INSTANCE_HDL Parameter CCM_DECL_INSTANCE_HDL Instance handle Return kCopSuccessful The function was executed without error For more return codes see 2 11 8 Function SrdoSendGfc Description The function sends a GFC messag
12. be linked or mapped to the bitwise inverted data of the SRDO Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist kCopSrdoErrorMapp The mapping of a SRDO is faulty kCopSrdoLengtExceeded The length of the SRDO chosen Mapping exceeds 64 Bit L 1077e_08 SYS TEC electronic GmbH 2015 22 Extension of the CANopen user layer Description This function defines variable fields for a SRDO The application only changes the variables via those variable fields When sending a SRDO those data byetes are copied from the variable field into the two CAN messages When receiving a SRDO the data bytes of the CAN messages are directly copied into the variable fields The function verifies if the stated variable fields correspond with the variables to which the mapping points in the OD L 1077e_08 SYS TEC electronic GmbH 2015 23 Extension of the CANopen user layer 2 13 Extended CANopen Return codes The CANopen Return codes are defined in file errordef h Error code kCopSuccessful kCopSrdoNotExist kCopSrdoGranularityMismatch kCopSrdoCfgTimingError kCopSrdoCfgldError kCopSrdoCfgCrcError kCopSrdoNmtError kCopSrdolnvalidCfg kCopSrdolnvalid kCopSrdoRxT xConflict kCopSrdolllegalCanld kCopSrdoCanldAlreadyInUse kCopSrdoNotInOrder kCopSrdoSctTimeout kCopSrdoSrvtTimeout kCopSrdoCanldNotValid kCopSrdoDicNotValid kCopSrdoErrorMapp kCopSrdoDataError
13. elle Le WEE 13 Grdof endCie innis i 16 SrdoSetState rana a u 18 SrdoStaticDefineVarFields 22 Function SrdoCalcSrdoCrc cccccccccceceeeeeeeeeees 21 E DOE 6 7 8 22 16 Installation GA NOPEN An e 25 Limitations hardware cccccccseeeeeeeeees 11 Limitations software 11 E Lei te Eee hte eae ho ee oo 5 MONITO EE 16 NMT event 12 OBD_BEGIN_SRDO_CRC 006 6 OBD_BEGIN_SRDO_MAPP 00 5 OBD_CREATE_SRDO_CFG_VALID 6 OBD_CREATE_SRDO_COMMU 5 OBD_CREATE_SRDO_GFC_PARAM 5 OBD_END_SRDO_CRC 0 000000008e 6 OBD_END_SRDO_MAPP n aanaaannnnnnnnnnn1nne 5 OBD_SUBINDEX_SRDO_CRQC 6 OBD_SUBINDEX_SRDO_MAPP 5 Object dhctonanm a 5 Ee le EE 15 reference enviropnment 25 Restrictions static mappimg 17 Return codes iin eieaa 24 Safety CPU einion tenrian e 9 SONGING EE 15 software siruchure 12 SRDO Intttaltzation ee 9 FOCGIVING MEET 29 lune EE 19 transmission eaneeeenneeeeneeneeneneeenenne 19 29 Transmission onneennoennnonnnnennnennrsnnne 13 SRDOSTO EE 17 static MAPPING unnnnnnneeennener nennen 17 Structure LGrdolnttbaram 9 tSrdoMappParam uu ns en 26 TMDX570LS20SMDK saiiisseeeerrrreerrrrre 25 Watchd g 2 2 REENERT 10 L 1077e_08 SYS TEC electronic GmbH 2015 33 Suggestions for Improvements Document CiA 304 Safety Frame
14. m_bNormalDig1 0x2000 1 BYTE m_bNormalDig2 0x2000 2 BYTE m_bNormalDig3 0x2000 3 BYTE m_bNormalDig4 0x2000 4 0x2001 1 WORD m w NormalDig1 x i 0x2001 2 WORD m w NormalDig2 0x2001 3 0x2001 4 CAN ID bitw ise inverted data 0x2100 1 0x2100 2 BYTE m_binversDig1 BYTE m_binversDig2 BYTE m_binversDig3 0x2100 3 0x2100 4 0x2101 1 BYTE m_binversDig4 WORD m w InversDig1 0x2101 2 WORD m_w InversDig2 0x2101 3 0x2101 4 CAN ID Figure Figure of variable fields The relation of SRDO variables in the application to data in the OD or to data in the CAN message is created via function CcmStaticDefineSrdoVarField The application must provide two times 8 connected data bytes maximum for each SRDO which means without fill bytes gt Struct Alignment 1 In this manual these data packages are called variable fields of a SRDO Mapping the variable fields in the OD takes place in the application by calling function CcmDefineVarTab or through macro OBD_SUBINDEX_RAM_EXTVAR see L 1024 in the OD To use the static SRDO mapping file SRDOSTC C must be mounted instead of file SRDO C Moreover define SRDO_USE_STATIC_MAPPING must be set to TRUE within file CopCfg h Restriction For CPUs that do not support uneven accesses to data types larger BYTE a mixed mapping of BYTE and WORD is not possible e g for example BYTE WORD BYTE But the following mapping is possible BY
15. sssseeseenenennennnnnneeeseeee 29 CANopen saiety 26 CAhopen stack 26 ROEE e tec atnectd iets 19 GemProcess 02 nennen nn 14 Certification eiio kaani ea nennen 9 aE AD a o AEE E T 21 Code Composer Gtdo 27 CGonfiouratton ecseeceeeesseeeeesesneeeeeeeaes 13 SRDO_ALLOW_GAPS_IN_OD 13 SRDO_CHECK_SRVT_BEFORE_1STRX Se ae Decca HE ebe eee ote 14 SRDO_GRANULARITY nenne 13 SRDO_USE_DUMMY_MAPPING 13 GbRDO USE GE 14 SRDO_USE_PROGMONITOR 14 SRDO_USE_STATIC_MAPPING 13 CR 21 Debuggimg ken 29 Function AppGicEvent A 1 AppProgMonEvent AAA 2 iere ne 31 App rdotvenmt 29 CemtCheckSrdoCorfig gt 21 ComDefineVarTab 17 CcmGetSrdoParam en 25 CcmGetSrdoState en 23 ComlnitCANOpen 244 nen 19 CemProcess 22240444 nennen 19 CemSendGife 222244444snnneennnennnnen 22 ComSetSrdoState en 24 CcmStaticDefineSrdoVarField 17 CcmStaticDefineSrdoVarFields 27 CobProcessReceiveQueue n 14 SrdoAddlnstance sssssseeeeeennnnee nennen 10 GrdoChecktConfig en 15 SrdoDeletelnstance 11 SrdoGetCommuParam 19 SrdoGetMappParam ssseeeeceeeeeeeeeeen 20 Grdotettaie nen 17 Stasi Aes teeta eee 9 SrdONmtE vent ccceeeeeeeseseteeeeeeeeees 12 Grdobrocess n ss sssnnsiieenseeseeenrnnnrnneeeeeee 14
16. wSrdoCommulndex_p Parameter CCM _DECL_INSTANCE_HDL_ Instance handle wSrdoCommulndex_p Object index of the communication parameter of the SRDO in the object directory Return kCopSuccessful The function was executed without error For more return codes see 2 11 5 Function SrdoSend Description The functions sends a SRDO specified via the communication index or it sends all SRDO if 0x0000 is specified as communication index Before a SRDO sends CAN messages all bits of the data are checked in terms of correct inverting If at least one bit is not correct inverted all CAN messages of a SRDO are not sent and the callback function APPSrdoError is called L 1077e_08 SYS TEC electronic GmbH 2015 19 Extension of the CANopen user layer CemSendSrdo SrdoSend SrdoSendintern SrdoSend SrdoEncodeNormal operational es Bes y SrdoEncodelnvers SrdoCheckData yes SrdoSearchT abEntry no data valid CdrvWriteMsg msg1 CdrvWriteMsg msg2 em gt AppSrdoEvent SrdoSendintern return return Figure 9 Principle for sending SRDOs AppSrdoError L 1077e_08 SYS TEC electronic GmbH 2015 20 Extension of the CANopen user layer 2 8 2 Function CcmCheckSrdoConfig Syntax include lt cop h gt tCopKernelPUBLIC CcmCheckSrdoConfig CCM_DECL_INSTANCE_HDL_ WORD pwCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instance handle pwCommulndex_p
17. Debug Session Mg demo_srdo_actor fe C C Attach to Local Application E Main Debugger E Target Ey Source 5 Common Generic Debugger Options Cortex R4 Disassembly Style Options TMS570LS20216SZWT Flash Settings Flash Settings E Enable Programming to OTP Memory Crystal Frequency MHz 16 0 Erase Options Entire Flash Necessary Sectors Only for Program Load Selected Sectors Only BankO m D L 1077e_08 SYS TEC electronic GmbH 2015 30 Glossary 4 Glossary BOM Bill of Material CAN Controller Area Network according to ISO 11898 1 2003 and ISO 11898 2 2003 CCM CANopen Controlling Module CiA CAN in Automation e V COB Communication Object CPU Central Processing Unit CRC Cyclic redundancy check DIN Deutsches Institut f r Normung e V DLL Data Link Layer layer 2 according to OSI model EDS Electronic Data Sheet EEPROM Electrically Erasable Programmable Read Only Memory EN European Norm EUC Equipment under control e V eingetragener Verein GFC Global Fail Command according to EN 50325 5 2010 GmbH Gesellschaft mit beschr nkter Haftung GND Ground HW Hardware ID Identifier IEC International Electro technical Commission IEEE Institute of Electrical and Electronics Engineers UC Input Output ISM Industrial Scientific and Medical ISO International Organization for Standardization JTAG J
18. E PTR Pointer to the instance Return kCopSuccessful The function was executed without error Further return codes of the standard CANopen are possible Description The function sends a GFC message It will not be available if the configuration SRDO_USE_GFC is set to FALSE See also the related API Function CcemSendGfc L 1077e_08 SYS TEC electronic GmbH 2015 16 Extension of the CANopen user layer 2 11 9 Function SrdoGetState Syntax include lt srdo h gt tCopKernel PUBLIC SrdoGetState MCO_DECL_INSTANCE_PTR_ BYTE pSrdoState_p WORD wSrdoCommulndex_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance pSrdoState_p Pointer to which the function copies the status wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function reads the status of a SRDO For setup and usage of the status see chapter 2 5 3 See associated API function Function CcmGetSrdoParam L 1077e_08 SYS TEC electronic GmbH 2015 17 Extension of the CANopen user layer 2 11 10 Function SrdoSetState Syntax include lt srdo h gt tCopKernel PUBLIC SrdoSetState MCO_DECL_INSTANCE_PTR_ BYTE SrdoState_p WORD wSrdoCommulndex_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance SrdoState_p Status to be set
19. EC electronic GmbH 2015 6 Basics CANopen Safety 1 4 Predefined Connection Set For the SRDO the Predefined Connection Set of CiA DS301 is extended as follows Broadcast objects Object Function COB ID Index in the code object directory GFC 0000 0x001 0x1300 Table 7 Extension Broadcast Predefined Connection Set Peer to Peer Objects Object Function COB ID plan data bitwise Index in the object code inverted data directory SRDO messages SRDO 0010 0x101 Ox13F 0x102 0x140 0x1301 0x1340 Node ID 1 32 tx SRDO 0010 0x141 0x17F 0x142 0x180 0x1301 0x1340 Node ID 33 rx 64 Table 8 Extension Peer to Peer Predefined Connection Set L 1077e_08 SYS TEC electronic GmbH 2015 Basics CANopen Safety 1 5 Overview safety targeted entries in the object directory Index Name Object Data type Attributes type 0x1300 GFC parameter var u8 rw 0x1301 1 SRDO communication record SRDO rw parameter parameter 0x1340 64 SRDO communication record SRDO rw parameter parameter 0x1341 Reserved 0x1380 Reserved 0x1381 1 SRDO mapping array u32 rw parameter 0x13C0 64 SRDO mapping array u32 rw parameter 0x13C1 reserved Ox13FD reserved Ox13FE Configuration Valid var u8 rw Ox13FF Safety Configuration array u16 rw C
20. E_PTR_ WORD wSrdoCommulndex_p tSrdoMappParam pSrdoMappParam_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance wSrdoCommulndex_p Object index that contains communication parameters of the SRDO in the object directory pSrdoCommuParam_p Pointer to the structure in which the function copies the values for the Number Of Mapped Objects and the Variable pointer Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The function reads the mapping parameters of a SRDO that are necessary in the application Thos are Number of Mapped Objects and the Pointers to the mapped variables See associated API Function CcmGetSrdoParam L 1077e_08 SYS TEC electronic GmbH 2015 20 Extension of the CANopen user layer 2 11 13 Function SrdoCalcSrdoCrc Syntax include lt srdo h gt tCopKernel PUBLIC SrdoCalcSrdoCrc MCO_DECL_INSTANCE_PTR_ WORD wCommulndex_p tSrdoTabEntry MEM pSrdoEntry_p WORD pwCrc_p Parameter MCO_DECL_INSTANCE_PTR Pointer to instance wCommulndex_p Object index which contains the communication parameters of the SRDO in the object directory pSrdoEntry_p Must always be passed with 0 pwCrc_p Pointer to a WORD variable for receiving 16 Bit CRC within the calling function Return kCopSuccessful The function was executed without error kCopSrdoNotExist The SRDO chosen does not exist Description The functio
21. Functions in the application 22 eee cece eee e ence eee etree ane eee sete tennessee eee eaaeeeeeeeenaaeeeeeene 29 2 9 1 Function AppGrdotvent 29 2 9 2 legt lee ee TE EN 2 9 3 Function deeg GE 1 2 9 4 Function Appbroghontvenmt A 2 2 9 5 Function AppCbhmitvent A 4 El WE ele et EE 5 2 10 1 Macros for safety objects AAA 5 2 10 2 Advice for MAG a een Daher Steele en 7 2 11 Function descriptions of the SRDO module nennen 9 2 11 1 Viet el te EE 9 2 11 2 Function SrdoAddlnstance sssssssseeeenenesseeennnensttttrnnnntttnnnnnntntnnnnnnrtrn rannen neen 10 2 11 3 Function Grdoeleielnstance 11 2 11 4 Function GrdohlmtEvent saan irsinin E EA E A E 12 2 11 5 Function SrdoSend oeseri a EEE ESNA E AA 13 2 11 6 Function Grdobrorcess eenaa e Rra AE EEEE e ES Esa 14 2 11 7 Function SGrdoChecktonftg nn 15 2 11 8 Function Grdofend te 16 2 11 9 Function SrdoGetStat soest ae raa EE 17 2 11 10 Function GrdofeiGtate e e r RE E EEEE A EE R a a 18 2 11 11 Function GrdoGetCommubaram 19 2 11 12 Function SrdoGetMappParam sssesseessessssesesisssrrnssrnrrrrrssrrrsssrrnssrnnnrnnssrnns 20 2 11 13 Function GrdotCalcef rdotec 21 2 12 Function descriptions of the SRDOSTC module nenn 22 2 12 1 Function GrdoGtaitceftnevartielde nenet ernrnnnnrnnnnnnnnn nenn 22 2 13 Extended CANopen Return codes eesseeseeeessesesiisssirrssrntsttrssrristsrrnsstnntttnntsrnnsssrnnnnna 24 L 1077e_08 SYS TEC electronic GmbH 2015 List of Content
22. MU as the second parameter to the macro OBD_BEGIN_SRDO_MAPP also as second parameter and to the macro OBD_SUBINDEX_SRDO_MAPP as the third parameter The subsequent SRDO always gets the number increased by one The number for the communication parameters of a SRDO is always the same number as the corresponding mapping parameters Please regard that the absolute count of SRDOs must match the define SRDO_MAX_SRDO_IN_OBBD in the file obdcfg h Are the SRDOs in the object dictionary created with gaps then the define SRDO_ALLOW_GAPS_IN_OD in the file copcfg h must set to TRUE With gaps is meant that for example SRDO1 and SRDO3 are created in the OD but not SRDO2 In this case the number of SRDO1 would be 0 and SRDO3 would get the serial number 1 A definite assignment of communication index and sequential number is then no longer possible In order that the CANopen stack still can find the corresponding SRDO the stack must implement a different search algorithm which can lead to a higher running time Therefore please avoid such gaps in the object dictionary L 1077e_08 SYS TEC electronic GmbH 2015 7 Extension of the CANopen user layer communication OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRD
23. OK If this is not the case it is relevant to safety The application must react If the state is correct the status is set to SRDO was edited The state must also be checked for the application in the main loop It must always be in state SRDO was edited because otherwise it would indicate that the SRDO in function AppSrdoEvent was not edited This would be safety critical With the implementation of the SRDO module we follow the philosophy that the change from safe state to operating state is performed only with the successful reception of the SRDOs If an error appears during runtime the application is in charge of switching the associated safety function to the safe state 2 5 4 Logical monitoring of program run of the SRDO module A logical monitoring of the program run is integrated in the SRDO module Function AppProgMonEvent is called with the respective Event for different program steps The actual realization of the program run monitor takes place in the application function that is called L 1077e_08 SYS TEC electronic GmbH 2015 16 Extension of the CANopen user layer 2 6 Function of the SRDOSTC module The SRDOSTC module replaces the SRDO module for static SRDO mapping With the static SRDP mapping the SRDOs are already mapped in the OD The mapping cannot be modified by the application or the SDO Thus fewer CODE memory is needed TSRDO 1 CANopen application CANopen OD plain data BYTE
24. O_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 0x1381 OBD_SUBINDEX_SRDO_MAPP 24138 OBD_SUBINDEX_SRDO_MAPP OBD SUBINDEX SRDO MAPP N OBD_END SRDO_MAPP 0x1381 ere Saree aan 0x1392 OBD SUBINDEX_ SRDO MAPP p OBD_ SUBINDEX SRDO MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD SUBINDEX_ SRDO MAPP 0x1382 OBD_ _ SUBINDEX SRDO MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_ SRDO_MAPP 0x1382 OBD SUBINDEX SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD_SUBINDEX_SRDO_MAPP 0x1382 OBD SUBINDEX_ SRDO MAPP 0x1382 OBD END SRDO MAPP 0x1382 OBD_ CREATE SRDO CFG VALID OBD BEGIN SRDO CRC SRDO MAX SRDO IN OBD OBD SUBINDEX_ SRDO _ CRC 1 ene SRDO_ Ee OBD SUBINDEX SRDO_CRC 2 crc SRDO 2 OBD END SRDO CRC Figure 10 Example of an OD with 2 SRDOs 0 0 0x101 0x102 0x103 0x104 normall 0x20000108 inverti 0x21000108 normal2 0x20010110 invert2 0x21010110 normal3 0x20010210 Ber 0x21010210 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 equential number normali 0x00000000 inverti 0x00000000 normal2 0x00000000 invert2 0x00000000 normal3 0x00000000 invert3 0x00000000 normal4 0x00000000 invert4 0x00000000 norma
25. SYS TED SO 1059 SRDO Add on module CANopen Source Code Add on for CiA 304 Safety Framework Software Manual L 1077e_08 Edition September 2015 SYS TEC electronic GmbH Am Windrad 2 08468 Heinsdorfergrund Germany Telefon 49 3765 38600 0 Fax 49 3765 38600 4100 Web www systec electronic com Mail info systec electronic com System House for Distributed Automation Status Changes Status released Date Version Section Changes Editor V8 all Spelling and grammar some D Kruger rewording 1 6 Replaced admission office by D Kr ger certification body 1 Replaced DIN EN 50325 5 2009 D Kr ger by EN 50325 5 2010 All Replaced Safety relevant by D Kr ger Safety related according to EN 50325 5 2010 2 8 1 1 gt Changed section number D Kr ger 2 8 2 1 1 1 Replaced distance by interval 2 10 2 Added note regarding N Hehlke SRDO_MAX_SRDO_IN_OBD 10 09 2015 1 German text translated into R Dietzsch V8 English in Figure 1 and Figure 2 German text translated into English in Figure 6 German text translated into R Dietzsch English in Figure 8 Replaced normal data by plain R Dietzsch data and replaced inverted data by bitwise inverted data 28 09 2015 Clarified description of macro D Kruger v8 SRDO_GRANULARITY Replace security by safety D Kr ger R Dietzsch Inserted section References D Kr ger
26. TE BYTE WORD L 1077e_08 SYS TEC electronic GmbH 2015 17 Extension of the CANopen user layer 2 7 General program run START Initializing the CANopen Stack CemlnitCANOpen Srdolnit SrdoAddinstance processing the NMT state machine CcmConnectToNet SrdoNmtEvent CcmProcess SrdoProcess ke A AppSrdoEvent J Amm Srdo received Operational yes AppSrdoError no yes no AppGfcEvent JAppProgMonEvent y Refresh time exceeded CcmSendSrdo safety cycle exceeded program monitor OK yes CcmCheckSrdoConfig safety stopp Figure 8 General program run L 1077e_08 SYS TEC electronic GmbH 2015 18 Extension of the CANopen user layer 2 8 Extension of the CCM layer File CCMMAIN C is extended for the integration of the SRDO module The SRDO module must be activated in file COPCFG H via define CCM MODULE INTEGRATION Therefore constant CCM MODULE SRDO must be added If the SRDO module is activated function CeminitCANOpen executes the initialization of the SRDO module The appropriate SRDO function is also called in function CcmProcess In the following user functions of the SRDO module are described 2 8 1 Function ComSendSrdo Syntax include lt cop h gt tCopKernel PUBLIC CcmSendSrdo CCM_DECL_INSTANCE_HDL_ WORD
27. UNSIGEND16 to Index 0x2100 Subindex3 bitwise inverted data 3 0x20010108 UNSIGEND8 to Index 0x2001 Subindex1 plain data 4 0x21010108 UNSIGEND8 to Index 0x2101 Subindex1 bitwise inverted data 5 0x20010208 UNSIGEND8 to Index 0x2001 Subindex2 plain data 6 0x21010208 UNSIGEND8 to Index 0x2101 Subindex2 bitwise inverted data 7 0x20020620 REAL32 to Index 0x2002 Subindex6 plain data 8 0x21020620 REAL32 to Index 0x2102 Subindex6 bitwise inverted data Table 4 Exemplary Mapping Table for the first SRDO 1 1 3 CRC of aSRDO To check the validity of the parameters of a SRDO a CRC is calculated via the safety related data of each SRDO It is filed to Index Ox13FF in the object directory The number of the subindex complies with the number of the SRDO The following parameters go into the CRC Communication parameter a 1 Byte Information Direction b 2 Byte Refresh Time SCT c 1 Byte SRVT d 4 Byte COB ID 1 e 4 Byte COB ID 2 Mapping parameter f 1 Byte Subindex 0 g1 1 Byte Subindex h1 4 Byte Mapping data g128 1 Byte Subindex h128 4 Byte Mapping data The following polynom is used G x X18 X12 X5 1 The start value for the CRC is 0x0000 L 1077e_08 SYS TEC electronic GmbH 2015 5 Basics CANopen Safety 1 2 Configuration Valid To make an entire SRDO configuration valid a flag must be set to Index 0x13FE in the object dictionary This flag is automatically set to an inval
28. after the SRVT L 1077e_08 SYS TEC electronic GmbH 2015 14 Extension of the CANopen user layer 2 5 Function of the SRDO module The SRDO module takes over the SRDO processing for dynamic SRDO mapping this means the mapping can be modified by the application or by the SDO during runtime Module SRDOSTC supports the static SRDO mapping For each SRDO a structure with all relevant data is generated to accelerate the SRDO processing Those structures are summarized in tables The SRDO tables are part of the object directory Each SRDO uses variables that must be created by the application beforehand During the mapping addresses in the SRDO are directed to the corresponding variables This means that there must be a variable for each mappable object Therefore when defining the object directory in file objdict h macro OBD_SUBINDEX_RAM_USERDEF or OBD_SUBINDEX_RAM_USERDEF_RG must be used for the respective object The SRDO module checks the chosen parameters for each modification of the mapping If the object does not exist or if it does not have a variable of the application an error is reported 2 5 1 Sending SRDOs SRDOs are directly sent from the application Therefore function CemSrdoSend is used The Refresh Time is monitored in the application because only the application can assure that the plain and bitwise inverted data are consistent before the CAN messages of a SRDO are sent It is important that the first
29. al sequence of the CAN telegrams of a SRDO is compared to an expected value Afterwards the user data is verified If errors are detected the application is in charge of switching the associated safety function to the safe state e g the associated actuator The safe state is to be defined in dependence from the application by the device manufacturer and or user Features of SRDOs CAN identifier SCT SRVT mapping are stored in the object directory and checked for validity by a CRC 16 bit cyclic redundant check L 1077e_08 SYS TEC electronic GmbH 2015 2 Basics CANopen Safety 1 1 1 Communication parameters of a SRDO The communication parameters of a SRDO define the transmission features and the COB IDs of a SRDO The communication parameters of a SRDO are entries in the object directory Index 0x1301 0x1340 They can be read and if allowed modified via the CAN bus by using service data objects SDO Index Subindex Object data Meaning 0x1301 O Number of the following entries 1 Information Definition if the SRDO is switched off 0 a Direction TSRDO 1 ora RSRDO 2 2 Refresh Time Interval between two transmissions of a SCT SRDO 3 SRVT Interval between the two CAN messages of a SRDO 4 Transmission Type of transmission of the SRDO fix 254 Type 5 COB ID 1 CAN identifier for plain data 6 COB ID 2 CAN identifier for bitwise inverted data Table 1 Communic
30. ance Syntax include lt srdo h gt tCopKernel PUBLIC SrdoAddinstance MCO_DECL_PTR_INSTANCE_PTR_ tSrdolnitParam MEM plnitParam_p Parameter MCO_DECL_PTR_INSTANCE_PTR_ Pointer to the instance pointer pInitParam_p Pointer to the parameter structure for initializing the SRDO module instance Return kCopSuccessful The function was executed without error kCopSrdoGranularityMismatch The configured SRDO granularity is not supported Further return codes of the standard CANopen are possible Description This function adds a new instance to the SRDO module Therefore define COP_MAX_INSTANCES must be larger than 1 If there is no free entry available in the instance table the functions sends back an error The SRDO tables for this instance are initialized Chapter 2 11 1 contains the setup of the parameter structure tSrdolnitParam L 1077e_08 SYS TEC electronic GmbH 2015 10 Extension of the CANopen user layer 2 11 3 Function SrdoDeletelnstance Syntax include lt srdo h gt tCopKernel PUBLIC SrdoDeletelnstance MCO_DECL_INSTANCE_PTR Parameter MCO_DECL_INSTANCE_PTR Pointer to the instance Return kCopSuccessful The function was executed without error Further return codes of the standard CANopen are possible Description This function deletes all generated communication objects of the stated instance and marks it aS unused L 1077e_08 SYS TEC electronic GmbH 2015 11 Extensi
31. ation parameters for the first SRDO Information Direction Subindex 1 The Information Direction is used to determine if the SRDO is switched off or if it is used as send or receive SRDO The following values are possible Value Meaning 0x00 the SRDO is switched off 0x01 the SRDO is switched on as send SRDO 0x02 the SRDO is switched on as receiver SRDO 0x03 OxFF reserved Table 2 Information Direction of a SRDO Refresh Time SCT Subindex 2 The Refresh Time SCT sets the interval in milliseconds between two transmissions of a SRDO that is the interval between the first CAN messages of a SRDO For send SRDOs the parameter is the interval between two transmissions of the SRDO For receiver SRDOs this is the maximum time allowed between two transmissions of the SRDO for the SRDO to be valid L 1077e_08 SYS TEC electronic GmbH 2015 3 Basics CANopen Safety SRDO SRDO SRDO A A A A A refresh ime refresh ime refresh ime Fra SCT exceeded SCT SCT Figure 1 SCT principle SRVT Subindex 3 The SRVT sets the maximum interval between the two CAN messages of a receiver SRDO which is the time between the message with plain data and the message with bitwise inverted data Send SRDOs are directly sent one after another The specification is given in milliseconds SRDO SRDO SRDO SRDO N N N N N SRVT SRVT SRVT SRVT SRVT exceeded Figure 2 SRVT princ
32. ble Description The function sends one SRDO that is stated via communication index or all SRDOs when 0x0000 is stated as communication index See also the related API Function CcmSendSrdo L 1077e_08 SYS TEC electronic GmbH 2015 13 Extension of the CANopen user layer 2 11 6 Function SrdoProcess Syntax include lt srdo h gt tCopKernel PUBLIC SrdoProcess MCO_DECL_INSTANCE_PTR Parameter MCO_DECL_INSTANCE PTR Pointer to the instance Return kCopSuccessful The function was executed without error kCopSrdoNotHandledinApp The SRDO error reported to the application was not processed correctly Further return codes of the standard CANopen are possible Description The function is called instead of function CobProcessReceiveQueue It works on receiving CAN messages from the CANopen stack Receive SRDOs is given a preferential treatment In addition this function checks the SCT of all receiving SRDOs If the SCT is expired but received none of the two CAN messages of the SRDOs then the function AppSrdoError is called with the error code kCopSrdoSctTimeout Is the constant SRDO_CHECK_SRVT_BEFORE_1STRX set to TRUE this function checks the SRVT of all SRDOs If only one of the two CAN messages was received and the SRVT has expired then the function AppSrdoError is called with the error code kCopSrdoSrvtTimeout This function is called cyclically Variations in terms of the timing of the SRDOs depend o
33. cluded with this package Therefore it is protected by a unique license key which has to be entered on installation process Thie lirenee_kew ie valid for one wear after nurchasinn the nradurt and ie license key Enter the purchased license key and press Next In the following dialog select the demo projects Also select the software package SO 1059 from the CANopen extensions L 1077e_08 SYS TEC electronic GmbH 2015 25 Reference environment TMDX570LS20SMDK Setup CANopen Source Code V5 50 l Select Components Which components should be installed Select the components you want to install clear the components you do not want to install Click Next when you are ready to continue Custom installation Manuals deutsch Manuals english E CANopen Extensions S 1059 Extension for safety communication according to DS 304 5 1066 Extension for MPDO according to DS 301 E S 1074 Extension for dynamic Object Dictionary E S 1078 Extension for SDO Gateway 75 1081 Extension for DS 402 Current selection requires at least 14 5 MB of disk space l lt Back Gancel Follow any prompts in the setup After installing the extension of SO 877 SO 1059 will automatically be installed You need to enter another license key for SO 1059 r jB Setup CANopen Safety V5 50 Personal Information License Key a Thank you for purchasing t
34. connect safety targeted sensors and actuators A safety targeted control e g PLC safety monitor is not needed This enables the realization of logically comparable safety chains as in usual wired technology e g the emergency power off switch directly affects the safety relay The CiA 304 standard is superseded by EN 50325 5 2010 1 1 SRDO Safety Related Data Object The SRDO communication follows the producer consumer principle This means that there is a SRDO producer and one or several SRDO consumers A SRDO consists of two CAN telegrams The following rules apply to the generation of a SRDO 1 The CAN identifier of the two CAN telegrams differ at least in two bit locations The CAN identifier of the CAN telegram with plain data is always odd numbered The CAN identifier of the CAN telegram with bitwise inverted data is always the subsequent even value 2 The data oft two CAN telegrams is redundant But the data of the second CAN telegram is inverted bit by bit 3 A SRDO is transferred periodically whereas the interval between two SRDOs is determined by the SCT safeguard cycle time 4 The interval between the two CAN telegrams of a SRDO may not exceed the SRVT safety related object validation time 5 The order of the two CAN telegrams of a SRDO must be maintained Firstly the actual data is transferred and secondly the bitwise inverted data is transferred The receiver checks the validity of a SRDO The time and logic
35. e It will be not available if the configuration of SRDO_USE_GFC is set to FALSE This function represents the API function for Function SrdoSendGfc and calls it The following SRDO must be transferred by the application via function CcmSendSrdo L 1077e_08 SYS TEC electronic GmbH 2015 22 Extension of the CANopen user layer 2 8 4 Function CcmGetSrdoState Syntax include lt cop h gt tCopKernel PUBLIC CcmGetSrdoState CCM_DECL_INSTANCE_HDL_ BYTE pSrdoState_p WORD wSrdoCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instance handle pSrdoState_p Pointer to which the functions copies the status wSrdoCommulndex_p Object index which contains communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error For more return codes see 2 11 9 Function SrdoGetState Description The function reads the status of a SRDO For setup and usage of the status please see 2 5 3 L 1077e_08 SYS TEC electronic GmbH 2015 23 Extension of the CANopen user layer 2 8 5 Function CcmSetSrdoState Syntax include lt cop h gt tCopKernel PUBLIC CcmSetSrdoState CCM_DECL_INSTANCE_HDL_ BYTE SrdoState_p WORD wSrdoCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instance handle SrdoState_p status to be set wSrdoCommulndex_p Object index which contains communication parameters of the SRDO in the object directory Return kCopSucc
36. e must be used SRDO_USE_DUMMY_MAPPING Value range FALSE TRUE Default FALSE Meaning When using the dynamic SRDO mapping dummy objects can be mapped if this macro is defined to TRUE This allows for Receive SRDOs not having to implement any variable in the OD if these variables are not important for a CANopen node SRDO_GRANULARITY Value range 8 16 32 64 Default 8 Meaning This define determines the smallest resolution in bits of the application objects mapped to an SRDO The value 8 means that the smallest data size of an application object is 8 bit Hence up to eight application objects containing the plain data and eight application objects containing the bitwise inverted data may be mapped to an SRDO The value 16 means that the smallest data size of an application object is 16 bit Hence half the number of application objects may be mapped to an SRDO up to four application objects containing the plain data and four application objects containing the bitwise inverted data SRDO_ALLOW_GAPS_IN_OD Value range FALSE TRUE Default FALSE Meaning This define is used to optimize the code requirements in SRDO module If the SRDOs in the object directory sequentially implemented without gaps then this define can be left to FALSE In this case the SRDOs for the checks are referenced more quickly Are there some SRDOs missed in the object directory e g only SRDO2 with communication index 0x1301 is going to be impleme
37. essful The function was executed without error For more return codes see 2 11 10 Function SrdoSetState Description The function writes the status of a SRDO For setup and usage of the status please see 2 5 3 L 1077e_08 SYS TEC electronic GmbH 2015 24 Extension of the CANopen user layer 2 8 6 Function CcmGetSrdoParam Syntax include lt cop h gt tCopKernel PUBLIC CcmGetSrdoParam CCM_DECL_INSTANCE_HDL_ WORD wSrdoCommulndex_p tSrdoCommuParam pSrdoCommuParam_p tSrdoMappParam pSrdoMappParam_p Parameter CCM_DECL_INSTANCE_HDL_ Instance handle wSrdoCommulndex_p Object index which contains communication parameters of the SRDO in the object directory pSrdoCommuParam_p Pointer to the structure in which the function copies the values for nformation Direction and SCT pSrdoMappParam_p Pointer to the structure in which the function copies the values for Number of Mapped Objects and the pointers to the mapped variables Return kCopSuccessful The function was executed without error For more return codes see 2 11 11 Function SrdoGetCommuParam and 2 11 12 Function SrdoGetMappParam Description The function reads the parameters of a SRDO needed in the application Those are the communication parameters nformation Direction and SCT as well as the mapping parameters Number of Mapped Objects and the pointer to the mapped variables The function only completes the structures if the tran
38. hEntry variables Defined PathEntry variables gt cop C systec cop New Remove L 1077e_08 SYS TEC electronic GmbH 2015 27 Reference environment TMDX570LS20SMDK Confirm your entry with OK Now import the project from the menu File gt Import Select in the following dialog under CCS the line Existing CCS CCE Eclipse Projects and confirm with Next E ve Import Select Imports existing CCS CCE Eclipse projects t kb d into workspace Select an import source type filter text amp General amp C C a E CC Eg Existing CCS CCE Eclipse Projects L Legacy CCSv3 3 Projects Managed Build Macros amp cvs Lo Team In the following dialog select over Browse the path to the demo and then click Finish r ve Import CCS Eclipse Projects Select Existing CCS Eclipse Project Select a directory to search for existing CCS Eclipse projects 7 a Select search directory C systec cop target TMDX570L520SMDK no_os CodeComposerStudio demo_srdo_actor Select archive file Browse Discovered projects Idi demo_srdo_actor C systec cop target TMDX570LS20SMDK no_os CodeComposerStudio demo_srdo_actor Select All Deselect All m Ir Refresh E Copy projects into workspace oO A Io Di n x f Finish Cancel If all these steps have been carried out without pr
39. hardware The usage of the SRDO module requires a CAN controller for which the chronological sequence of CAN messages on the CAN bus can be determined Currently the SRDO module is adjusted to the SJA1000 CAN controller of the company Phillips More CAN controllers will follow The number of high prioritized buffer entries of the CAN controller in file obdcfg h must be set to the minimum number of receive and send SRDO 2 2 Limitations of the software The SRDO module can only be operated with a particular configuration of the CAN driver To do this please put in the file copcfg h the following defines to the following values CDRV_USE_HIGHBUFF TRUE CDRV_USE_BASIC_CAN TRUE CDRV_USE_IDVALID TRUE The number of high priority buffer entries of the CAN controller in the file obdcfg h is set at least to the number of receive and send SRDOs To ensure safety you can increase this number The OD Builder up to version V1 19 of the date of this notice can not be used to create object directory with SRDOs because the index objects between 0x1300 and Ox13FF use special macros not support by this version of the OD Builder If the number of SRDOs needs to be increased copy the corresponding objects in the file obdict h and adjust the object index resp the subindex see also chapter 2 10 1 and 2 10 2 If other objects needs to be extended or added you can create them in a temporary directory with the OD Builder and copy amp paste them to the act
40. he_SYS TEC CANopen Extension Package for Safety communication This setup assistant is going to install the latest version of the CANopen Safety software on your computer Please follow the l instructions given to proceed with the installation process E IMPORTANT This software is subject to any license terms presented electronically during installation and or any printed terms included with this package Therefore it is protected by a unique license key which has to be entered on installation process This lirenee_kew ie valid for one wear after nurchasinn the nradurt and ie license key 3 3 Import of the safety demo in Code Composer Studio When the installation of the CANopen stack and the safety expansion is completed you will find in C systec copltarget TMDX570LS20SMDK no_os Code Composer Studio demo_srdo_actor the demo for the actuator on the TMS570LS Development Kit Please make sure that the files ccsproject cdtbuild cdtproject and project are not set to hidden in the directory Otherwise the project can not be imported to the Code Composer Studio Please remove the attribute hidden when it should be set Now start the Code Composer Studio You will be prompted to create a workspace Close this dialog by entering a directory of your choice L 1077e_08 SYS TEC electronic GmbH 2015 26 Reference environment TMDX570LS20SMDK In Code Composer Studio call up the menu Window g
41. hecksum Table 9 SRDO entries in the object directory L 1077e_08 SYS TEC electronic GmbH 2015 Basics CANopen Safety 1 6 Certification The software package SO 1059 is an expansion pack for the CANopen Source Code SO 877 It cannot be certified as a single unit The certification requires a self contained unit with all the necessary software components Therefore the manufacturer of the device is always responsible for the certification The necessities for certification depend on the safety integrity level which shall be achieved SIL 3 for example has higher necessary requirements than SIL2 For SIL3 certification the hardware needs to be designed with two channels see Figure 3 and Figure 4 Lower requirements can be built with a single channel see Figure 5 For this purpose the use of a Safety CPU e g TMS570LS by Texas Instruments is recommended om Sensor Actuator Figure 3 two channel hardware with CPU Ge Sensor Actuator Figure 4 two channel hardware with two CPU s cpu Sensor Actuator Figure 5 single channel hardware with Safety CPU 1 SIL Safety Integrity Level L 1077e_08 SYS TEC electronic GmbH 2015 9 Basics CANopen Safety Furthermore the implementation of additional safety checks in the software is recommended These are listed below Repeated calculation of a CRC on the program memory Repeated testing of the RAM used Use of Watchdog
42. id configuration for every write access that is done to a safety related SRDO parameter After completing the configuration this flag must be set to a valid configuration Value Meaning OxA5 the configuration is valid Other values the configuration is invalid Table 5 Configuration Valid General procedure of a configuration 1 Writing all safety related parameters and the checksums 2 Reading back all safety related parameters and the checksums and comparison with the written parameters 3 Setting the configuration to valid This flag must be checked periodically by the application in the safety cycle time As long as this flag is not valid the safe state must not be left 1 3 Global Fail Safe Command GFC To increase the response time in safety targeted systems a GFC is defined that consists of a high priority CAN telegram CAN identifier 1 The GFC does not contain data and can be used by all participants Afterwards the initiating participant must send the corresponding SRDO The usage of GFC is optional It is event triggered and not safety related because there is no time monitoring For the GFC the entry Global Fail Safe Command parameter to Index 0x1300 is included in the object directory The following values are possible Value Description 0x00 GFC is not supported 0x01 GFC is supported Other values reserved Table 6 Global Fail Safe Command GFC L 1077e_08 SYS T
43. iple Transmission Type Subindex 4 The Transmission Type sets the character of a SRDO transmission Only value 254 is valid This implies an asynchronous transfer see CiA DS301 COB IDs CAN identifier Subindex 5 and 6 COB IDs 1 and 2 support the identification and definition of the priority of a SRDO for bus accesses There may only be one sender producer for each CAN message but several receivers consumers Values between 0x101 0x180 are acceptable One SRDO always consists of two sequenced COB Ids whereas COB ID 1 is uneven and COB ID 2 is the subsequent ID Modifying the values is only possible if the SRDO is switched off which means subindex 1 Information Direction is set to 0 Bit 31 11 Bit 10 0 reserved 0 CAN Identifier Table 3 Set up of a COB ID for a SRDO L 1077e_08 SYS TEC electronic GmbH 2015 4 Basics CANopen Safety 1 1 2 Mapping parameter of a SRDO Mapping parameters describe the data content of a SRDO Mapping parameters are entries in the object directory Index 0x1381 0x13C0 One mapping entry is structured such as the mapping of a PDO see L 1020 But for the SRDO mapping one entry is always generated for plain data and followed by a corresponding entry for bitwise inverted data Index Sub Object data Meaning index 0x1381 O 8 Number of mapped entries 1 0x20000310 UNSIGEND16 to Index 0x2000 Subindex3 plain data 2 0x21000310
44. l5 0x00000000 invert5 0x00000000 normal6 0x00000000 invert6 0x00000000 normal7 0x00000000 invert7 0x00000000 normal8 0x00000000 invert8 0x00000000 L 1077e_08 SYS TEC electronic GmbH 2015 Extension of the CANopen user layer 2 11 Function descriptions of the SRDO module 2 11 1 Function Srdolnit Syntax include lt srdo h gt tCopKernel PUBLIC Srdolnit MCO_DECL_PTR_INSTANCE_PTR_ tSrdolnitParam MEM plnitParam_p Parameter MCO_DECL_PTR_INSTANCE_PTR_ Pointer to the instance pointer pInitParam_p Pointer to the parameter structure for initializing the SRDO module instance Return kCopSuccessful The function was executed without error kCopSrdoGranularityMismatch The configured SRDO granularity is not supported Further return codes of the standard CANopen are not possible Description The function deletes the instance table and initializes the first instance by using function SrdoAddInstance The parameter structure tSrdolnitParam contains the parameters for initializing the instance and is setup as follows typedef struct if COP MAN INSTANCES gt 1 void MEM m ObdInstance void MEM m CobInstance void MEM m CdrvInstance endif tSrdoTabParam m SrdoTabParam BYTE m bGranularity BYTE MEM m pbSrdoConfigValid tSrdoInitParam L 1077e_08 SYS TEC electronic GmbH 2015 9 Extension of the CANopen user layer 2 11 2 Function SrdoAddInst
45. mportant that for both the continuous numbers of the SRDO are set correctly ind Object index of tne SRDO to be defined 0x1301 to 0x1340 and 0x1381 to 0x13C0 for the mapping num Continuous number from 0 to 63 for the corresponding entry in the table The first always gets assigned the continuous number 0 The following entries always get the next larger number of the previous entry For example if the SRDOs 0x1301 0x1302 and 0x1305 are generated the SRDO 0x1301 gets a 0 the 01302 a 1 and the 0x1305 a 2 dir Information direction of the SRDO The value corresponds with the index 0x1301 to 0x1340 Subindex 1 L 1077e_08 SYS TEC electronic GmbH 2015 5 Extension of the CANopen user layer sct srvt cob1 cob2 cnt sub name val Refresh Time SCT of the SRDO The value corresponds with index 0x1301 to 0x1340 Subindex 2 SRVT of the SRDO The value corresponds with index 0x1301 to 0x1340 Subindex 3 COB ID 1 of the SRDO this means CAN ldentifier of the message that contains plain data The value corresponds with index 0x1301 to 0x1340 Subindex 5 COB ID 2 of the SRDO this means CAN ldentifier of the message that contains bitwise inverted data The value corresponds with index 0x1301 to 0x1340 Subindex 6 Number of mapping entries of the SRDO The value corresponds with the object entry 0x1381 to 0x13C0 Subindex 0 Subindex of the mapping entry that is to be defined Object name Default value fo
46. n calculates the checksum CRC CRC over a SRDO and returns it to the calling function The calculation is done also when the SRDO is turned off There is no comparison to the accuracy of the CRC The application can use this functionality via the API function CcmCalcSrdoCrc to update the CRC of a SRDOs when the configuring of a SRDOs on the application must be set new dynamically e g changing the COB ID depending on the node ID L 1077e_08 SYS TEC electronic GmbH 2015 21 Extension of the CANopen user layer 2 12 Function descriptions of the SRDOSTC module The following functions of the SRDO module are also implemented in the SRDOSTC module Their meanings and syntax can be taken from 2 11 Srdolnit SrdoAddinstance SrdoDeletelnstance SrdoNmtEvent SrdoSend SrdoProcess SrdoCheckConfig SrdoSendGfc SrdoGetState SrdoSetState SrdoGetCommuParam 2 12 1 Function SrdoStaticDefineVarFields Syntax include lt srdo h gt tCopKernel PUBLIC SrdoStaticDefineVarFields MCO_DECL_INSTANCE_PTR_ WORD wCommulndex_p void MEM pNormalData_p void MEM pInversData_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance wCommulndex_p Communication index of the SRDO in the OD whose variables shall not be defined pNormalData_p Pointer to a coherent variable field that shall be linked or mapped to the plain data of the SRDO pInversData_p Pointer to a coherent variable field that shall
47. n this function The function SrdoProcess is called automatically by CcmProcess from CcmMain c once the SRDO is enabled in CCM_MODUL_INTEGRATION L 1077e_08 SYS TEC electronic GmbH 2015 14 Extension of the CANopen user layer 2 11 7 Function SrdoCheckConfig Syntax include lt srdo h gt tCopKernel PUBLIC SrdoCheckConfig MCO_DECL_INSTANCE_PTR_ WORD pwCommulndex_p Parameter MCO_DECL_INSTANCE_PTR Pointer to the instance pwCommulndex_p Pointer to a variable in which the function stores the communication index of the faulty SRDO in case of faulty configuration Return kCopSuccessful The function was executed without error kCopSrdoCfgCrcError The SRDO configuration is faulty CRC Description The function calculates the check sum over all SRDO also deactivated SRDOs with Direction 0 and compares them to the check sum that is configured in the OD If it detects an error it sends back an error and the corresponding communication index of the faulty SRDO The function is called by the SRDO module upon writing the entry Configuration Valid Index 0x13FE in the object directory with value OxA5 See also the related API function Function CcmCheckSrdoConfig L 1077e_08 SYS TEC electronic GmbH 2015 15 Extension of the CANopen user layer 2 11 8 Function SrdoSendGfc Syntax include lt srdo h gt tCopKernel PUBLIC SrdoSendGfec MCO_DECL_INSTANCE_PTR Parameter MCO_DECL_INSTANC
48. nted but SRDO1 with index 0x1301 is missing or SRDO1 and SRDOS is going to be implemented but SRDO2 is missing then this define must be set to TRUE In this case the SRDOs are referenced by a search algorithm from which a higher runtime of the software results See also chapter 2 10 2 L 1077e_08 SYS TEC electronic GmbH 2015 13 Extension of the CANopen user layer SRDO_USE_GFC Value range Default Meaning FALSE TRUE FALSE If the GFC message is not needed in a project then the API functions CcmSendGfc and SrdoSendGfc and the object 0x1300 can be omitted for reasons of optimization In this case the Define SRDO_USE_GFC must be set to FALSE SRDO_USE_PROGMONITOR Value range Default Meaning FALSE TRUE FALSE Is a project of the Program Monitor not needed then it can be removed for reasons of program code optimization by set this define to FALSE The callback function AppProgMonEvent is not called in this case SRDO_CHECK_SRVT_BEFORE_1STRX Value range Default Meaning FALSE TRUE FALSE Should the SRVT also be monitored as the SCT cyclically by calling the SrdoProcess function if only one of the two CAN messages of a SRDOs was received then this constant must be set to TRUE Is this constant set to FALSE then an error is detected at the earliest when the second CAN message was received after the SRVT or after the SCT has expired With TRUE an error is detected immediately
49. o the calling function The calculation is done also when the SRDO is turned off There is no comparison to the accuracy of the CRC The application can use this function to update the CRC of a SRDOs if the configuration of SRDOs needs to be dynamically set new over the application eg changing the COB ID depending on the node ID This function represents the API function SrdoCalcSrdoCre and calls it Note The validity check of the CRC that is the calculation of the CRC over the configuration data of a SRDO and comparison with the associated CRC in the index Ox13FF is made in the function CcmCheckSrdoConfig Example WORD wTestCrc Ret CcmCalcSrdoCrc 0x1301 amp wTestCrc if Ret kCopSuccessful goto Exit PRINTF1 Calculated CRC of SRDO1 0x 04X n wTestCrc L 1077e_08 SYS TEC electronic GmbH 2015 28 Extension of the CANopen user layer 2 9 Functions in the application Function of the application that are called by the SRDO module as callback function are called directly and not via function pointer as for the rest in CANopen Consequently those functions must be available in the application and may not be renamed 2 9 1 Function AppSrdoEvent Syntax include lt cop h gt tCopKernel PUBLIC AppSrdoEvent CCM_DECL_INSTANCE_HDL_ WORD wSrdoCommulndex_p Parameter CCM_DECL_INSTANCE_HDL_ Instance handle wCommulndex_p Communication index of the SRDO in the OD Return kCopSucces
50. oblems the project can be re created L 1077e_08 SYS TEC electronic GmbH 2015 28 Reference environment TMDX570LS20SMDK 3 4 Debugging the Demo on the hardware Now connect the TMS570 Development Kit to the PC Just use the included USB cable and plug it on the top board into the USB mini jack labeled XDS100V2 Now Windows search for the device drivers of the Development Kit These device drivers were installed with the installation of the Texas Instruments CD After installing the device driver you can connect the power supply to the Development Kit In the scope of delivery of the Development Kit is a 12V power supply included Connect it to the jack on the top board next to the USB mini jack With right click on the project on the left side in the window in Code Composer Studio you can now choose from the context menu Debug As gt Debug Session On the very first time you must select the type of CPU choose TMS570LS20216SZWT After confirming the Code Composer programs the demo into the flash of the microcontroller and stops in the main function Inthe Debug window you can now control the program execution with the symbols Console Search Debug 23 Se gt v 3 ca CG e ry PF EY TO e demo_srdo_actor Debug Texas Instruments XDS100v2 USB Emulator_0 CortexR4 Project Debug Session 8 Device g Thread main Suspended 0 main at ex_srdo_actr c 370 0x00007510 1 _c int00 at sys_startup c 619 0x000108f8
51. of a SRDO have been received in the wrong order kCopSrdoDataError The data of the CAN messages of a SRDO is not inverse More error codes are possible from the CDRV module Return kCopSuccessful The function was executed without error All other return codes are reserved L 1077e_08 SYS TEC electronic GmbH 2015 31 Extension of the CANopen user layer Description The function is called by the SRDO module if the transmission of a SRDO is incorrect receiving or sending The status of the SRDO must be taken care of in the function according to chapter 2 5 3 tCopKernel PUBLIC AppSrdoError CCM DECL INSTANCE HDL_ WORD wSrdoCommulndex_p tCopKernel ErrorCode p BYTE bSrdoState tCopKernel Ret Ret CcmGetSrdoState amp bSrdoState wSrdoCommulndex_p if Ret kCopSuccessful if bSrdoState amp 0x30 0x10 process information according to the application for example switch outputs of SRDO off Status SRDO bearbeitet on set bSrdoState 0x30 toggle Bit 6 and 7 bSrdoState 0xC0 else Safety Critical Error Ret CcmSetSrdoState bSrdoState wSrdoCommulndex_p if Ret kCopSuccessful return kCopSuccessful L 1077e_08 SYS TEC electronic GmbH 2015 32 Extension of the CANopen user layer 2 9 3 Function AppGfcEvent Syntax include lt cop h gt tCopKernel PUBLIC AppGfcEvent
52. oint Test Action Group kiB Kilobyte LSB Least Significant Bit MiB Mega byte ms Millisecond MSB Most Significant Bit nc not connected NMT Network Management NSR Non safety related OD Object Dictionary OS Operating System OSI Open Systems Interconnection model according to ISO 7498 1 PCB Printed Circuit Board PDF Portable Document Format PDO Process Data Object PhL Physical Layer layer 1 according to OSI model PHY Physical layer in OSI model RAM Random Access Memory ro read only ROM Read Only Memory RPDO Receive PDO RSRDO Receive safety related data object according to EN 50325 5 2010 RT Real Time RTC Real Time Clock L 1077e_08 SYS TEC electronic GmbH 2015 31 Glossary rw RX SCL SCT SDO sec SIL SR SRAM SRDO SRVT SW tbd TPDO TSRDO TTL TX u a UART UTC read write Receive Safety Communication Layer Safeguard Cycle Time according to EN 50325 5 2010 Service Data Object Seconds Safety integrity level Safety related Static RAM Safety related data object according to EN 50325 5 2010 Safety related validation time according to EN 50325 5 2010 Software to be defined Transmit PDO Transmit safety related data object according to EN 50325 5 2010 Transistor Transistor Logic Transmit unter anderem Universal Asynchronous Receiver Transmitter Coordinated Universal Time L 1077e_08 SYS TEC electronic GmbH 2015 32 Index 5 Index Callback function
53. on of the CANopen user layer 2 11 4 Function SrdoNmtEvent Syntax include lt srdo h gt tCopKernel PUBLIC SrdoNmtEvent MCO_DECL_INSTANCE_PTR_ tNmtEvent NmtEvent_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance NmtEvent_p a NMT event that occurred see L 1020 Return kCopSuccessful The function was executed without error Further return codes of the standard CANopen are possible Description The function processes a NMT event which was triggered via the NMT State Machine An event induces a change of the NMT node status For each node status the execution of the SRDO module is controlled L 1077e_08 SYS TEC electronic GmbH 2015 12 Extension of the CANopen user layer 2 11 5 Function SrdoSend Syntax include lt srdo h gt tCopKernel PUBLIC SrdoSend MCO_DECL_INSTANCE_PTR_ WORD wSrdoCommulndex_p Parameter MCO_DECL_INSTANCE_PTR_ Pointer to the instance wSrdoCommulndex_p Object index of the communication parameters of the SRDO in the object directory Return kCopSuccessful The function was executed without error kCopSrdoNmtError The action is not allowed in this NMT state kCopSrdolnvalidCfg The action was tried with a faulty SRDO configuration kCopSrdoNotExist The SRDO chosen does not exist kCopSrdoRxT xConflict It was tried to send a receive SRDO kCopSrdolnvalid The action was tried with a switched off SRDO More return codes of the standard CANopen are possi
54. r the mapping data that must be accepted after Reset OBD_CREATE_SRDO_CFG_VALID The macro OBD_CREATE_SRDO_CFG_VALID is used to generate the entry Configuration Valid Index Ox13FE The macro does not have parameters OBD_BEGIN SRDO_ CRC cnt OBD_SUBINDEX_SRDO_CRC sub name OBD_END SRDO_ CRC The macros are used to define the object entries Safety Configuration Checksum Index Ox13FF cnt sub name Number of CRC table entries If the indexes 0x1301 to 0x1340 contain gaps CRC entries must be defined The nth SRDO corresponds with the nth subindex of the CRC Subindex of the CRC entry that is to be defined Object name L 1077e_08 SYS TEC electronic GmbH 2015 6 Extension of the CANopen user layer 2 10 2 Advice for macros Please note the objects in the object dictionary have to be created in ascending order otherwise the CANopen Stack is not able to detect the objects in the OD This means that the following macros must always be applied in the order listed below Macros for communication and mapping parameters can occur multiple times depending on how many SRDOs should be applied OBD_CREATE_SRDO_GFC_PARAM OBD_CREATE_SRDO_COMMW OBD_BEGIN_SRDO_MAPP OBD_CREATE_SRDO_CFG_VALID OBD_BEGIN_SRDO_CRC If several SRDOs are created in one OD it must be taken care that each SRDO has a consecutive number starting with 0 This number must be transferred to the macro OBD_CREATE_SRDO_COM
55. re several things to consider This chapter describes all these things to help you get started with the project and the hardware 3 1 Installation of the development environment With the development kit TMDX570LS20SMDK you have received a CD with the Code Composer Studio development environment The safety demo was created and tested with version V4 2 3 Install the development software of this CD and continue with the installation of the CANopen software 3 2 Installation of the CANopen software The CANopen stack SO 877 must be installed first Start the installation from the SYS TEC electronic product CD autorun menu The version of the CANopen stack must necessarily be greater than or equal to V5 51 In an earlier version the project for the TMS570LS does not exist After the welcome screen accepting the license agreement and enter the user information you will see the following dialog box for entering the license key of our CANopen stack r 5 Setup CANopen Source Code V5 50 Personal Information License Key Q Thank you for purchasing the SYS TEC CANopen Protocol Stack Source Code This setup assistant is going to install the latest version of the CANopen Source Code software on your computer Please follow the instructions given to proceed with the installation process IMPORTANT This software is subject to any license terms presented electronically during installation and or any printed terms in
56. roadcast photomechanical or similar reproduction and storage or processing in computer systems in whole or in part are reserved No reproduction may occur without the express written consent from SYS TEC electronic GmbH contacts Direct Your local distributor Address SYS TEC electronic GmbH Am Windrad 2 D 08468 Heinsdorfergrund GERMANY Ordering 49 3765 38600 2110 information info systec electronic com Please find a list of our distributors under Technical 49 3765 38600 2140 support support systec electronic com www systec electronic com distributors Fax 49 3765 38600 4100 Website http Awww systec electronic com 8t Edition September 2015 L 1077e_08 SYS TEC electronic GmbH 2015 List of Contents Refere Neeson n O EE SEENEN ENEE 1 Ipttog UH EEA S a en EE A E AE A E EE A A 1 1 Basics CANopen Safety unnnensnnnseennnnnnnnnennnnnnnnnnnnnnnnnnnennnennnnnnnannnnnnnnnn nennen nnaman nnmnnn nnana 2 1 1 SRDO Safety Related Data Oblect nn 2 1 1 1 Communication parameters of a GD 3 1 1 2 Mapping parameter of a GD 5 1 1 3 KEE gengen a Ee ehe nee era Eesen 5 L Gonfiguration Valid 2 meta lH en 6 1 3 Global Fail Safe Command GFC ssssssssssssnnnsssersrrrnnsttrtnssstttnnnnnstttnnnnnntttn nannt rrn tanner ennn nn a 6 1 4 Predefined Connection Gei 7 1 5 Overview safety targeted entries in the object directory seeessesssriesssserrressrr
57. rsssnssrsens 8 TG E e e E E E A T A E A E A T A E AA Belin T 9 2 Extension of the CANopen user layer uunusnnnunnanannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnannnnnnnnnnnnn nn 11 2 1 Limitations of the bardware cee saeeeecaacaaaaaaeaaecaeceeeeeeeeeeeeeeess 11 2 2 Limitations of the software sssssessenerneerssrnsssssttsstttttttttntnntntnnnnnnnnnnnnannnnatnnnntnnnnnnn nnn 11 297 Boltware stratia esaa N AS a ed hi EAEN duds 12 2 4 Configuration of the soiiware 13 2 5 Function of the SRDO module 15 2 5 1 Sending SRDOS sista nun ee EE SE ea 15 2 5 2 Receiving SRDOS isoina sui ne ra in 15 2 5 3 Sending and receipt signaling of SRDOS nenn 16 2 5 4 Logical monitoring of program run of the SRDO module ee 16 2 6 Function of the SRDOSTC module seasan iA ea EEN E 17 2 7 General program run 18 2 8 Extension of the COM aver 19 2 8 1 Function CemSendSrdo rees asieran a Ee aR EEEE EEE EnA ANSNI ia 19 2 8 2 Function CGemCheckfrdortC ong 21 2 8 3 F nction GEmSendGfci mern an ee nennen en erR a 22 2 8 4 Function CcmGetSrdoState cccccccceccseesseeeeeecseeaaeeeeeeseceeaeeeeeeseeneaeeeeeesesaas 23 2 8 5 Function CcmSetSrdoState 0 ccccccccccesessceceeeseeeeaeeeeeseseeaeeeeeeeeesaeeeeesseeaas 24 2 8 6 Function CGemGetGrdobaram nn nareen nnna 25 2 8 7 Function CemStaticDefineSrdoVarFields cccessccceeessesnceeeeeeesensaeeeeeeseenaas 27 2 8 8 Function CemealeSrdo Cre oeoa a ae Rairi E ENE a T 28 2 9
58. s 3 Reference environment TMDX570LS20SMDK uz2us4n20annnnnnannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nn 25 3 1 Installation of the development environment A 25 3 2 Installation of the CANopen software 25 3 3 Import of the safety demo in Code Composer Studio nennen 26 3 4 Debugging the Demo on the hardware AAA 29 EI El E EN MINOX A E A E N NE EAE E E N E T E N A T 33 L 1077e_08 SYS TEC electronic GmbH 2015 List of Figures and Tables Table 1 Table 2 Table 3 Table 4 Table 5 Table 6 Table 7 Table 8 Table 9 Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Communication parameters for the first SRDO 3 Information Direction of a GD 3 Set up of a COB ID for a GD 4 Exemplary Mapping Table for the first SRDO 5 e Me EI Wald ums ee une oes 6 Global Fail Safe Command OGEC nennen 6 Extension Broadcast Predefined Connection Set 7 Extension Peer to Peer Predefined Connection Set 7 SRDO entries in the object directory 8 SST ERD 4 SRVI Principles ee este 4 two channel hardware with CPU 9 two channel hardware with two CPU S sssssesseseseenrneenn 9 single channel hardware with Safety CPU 9 General software structure uennssnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 12 Figure of variable fields ernennen 17 General program run 18 Principle for sending SRDOS
59. sending must be held up by 0 5ms Node ID after switching into the node state OPERATIONAL The change of the node state is communicated to the application in function AppCbNmtEvent 2 5 2 Receiving SRDOs Function SrdoProcess is in charge of receiving SRDOs This function must be called cyclically which is realized for function CemProcess L 1077e_08 SYS TEC electronic GmbH 2015 15 Extension of the CANopen user layer 2 5 3 Sending and receipt signaling of SRDOs The sending and receipt is signaled to the application via two different ways One the one hand via the callback function of the application AppSrdoEvent and AppSrdoError and on the other hand via the state of a SRDO that is to be polled by the application It is read with CcmSrdoGetState and written with CcmSrdoSetState The state of a SRDO is bit coded in the following way TX SRDO xx00 xxxxb Sending was ok xx01l xxxxb Sending was incorrect xxll xxxxb SRDO was edited RX SRDO xx00 xxxxb Receipt was ok xx0l xxxxb Receipt was incorrect xxll xxxxb SRDO was edited SRDO ERROR 00xx xxxxb Reset value Olxx xxxxb Value prior to calling AppSrdoError 10xx xxxxb AppSrdoError must set this value The application must follow both ways Example for the receipt of a SRDO The SRDO module sets the state to receipt OK Afterwards the SRDO module calls function AppSrdoEvent This function checks if the state is set to receipt
60. sferred pointer is not the null pointer Structure tSrdoMappParam only exists for dynamic mapping This function represents the APl function for Function SrdoGetCommuParam and the Function SrdoGetMappParam and calls them L 1077e_08 SYS TEC electronic GmbH 2015 25 Extension of the CANopen user layer Structure tSrdoCommuParam is set up as follows typedef struct BYTE m bDirection direction of SRDO 0 invalid 1 Tx 2 Rx WORD m wSct refresh time SCT tSrdoCommuParam Structure tSrdoMappParam is set up as follows typedef struct BYTE m bNoOfMappedObjects Number of mapped objects void MEM m apMappedVariable SRDO_MAX MAPPENTRIES array of pointers to the mapped variables tSrdoMappParam L 1077e_08 SYS TEC electronic GmbH 2015 26 Extension of the CANopen user layer 2 8 7 Function CcmStaticDefineSrdoVarFields The function only is available for static SRDO mapping Syntax include lt cop h gt tCopKernel PUBLIC CcmStaticDefineSrdoVarFields CCM_DECL_INSTANCE_HDL _ WORD wCommulndex_p void MEM pNormalData_p void MEM pInversData_p Parameter CCM_DECL_INSTANCE_HDL_ Instance handle wCommulndex_p Communication index of the SRDO in the OD for which variables shall be defined pNormalData_p Pointer to connected variable field which shall be linked or mapped with plain data of SRDO pInversData_p Pointer to a connected variable field which shall be
61. sful The function was executed without error All other return codes are reserved Description The function is called by the SRDO module if the transmission of a SRDO is accurate receiving or sending The status of the SRDO must be taken care of in the function according to chapter 2 5 3 L 1077e_08 SYS TEC electronic GmbH 2015 29 Extension of the CANopen user layer tCopKernel PUBLIC AppSrdoEvent CCM DECL INSTANCE HDL WORD wSrdoCommulndex_p BYTE bSrdoState tCopKernel Ret Ret CcmGetSrdoState amp bSrdoState wSrdoCommulndex_p if Ret kCopSuccessful if bSrdoState amp 0x30 0x00 safety error application specific processing e g changing digital analog outputs Ret CcmSetSrdoState bSrdoState 0x30 wSrdoCommulndex_p if Ret kCopSuccessful return kCopSuccessful L 1077e_08 SYS TEC electronic GmbH 2015 30 Extension of the CANopen user layer 2 9 2 Function AppSrdoError Syntax include lt cop h gt tCopKernel PUBLIC AppSrdoError CCM_DECL_INSTANCE_HDL_ WORD wSrdoCommulndex_p tCopKernel ErrorCode_p Parameter CCM_DECL_INSTANCE_HDL_ Instance handle wCommulndex_p Communication index of the SRDO in the OD ErrorCode_p Error code of the SRDO kCopSrdoSctTimeout The SCT of a receive SRDO was exceeded kCopSrdoSrvtTimeout The SRVT of a receive SRDO was exceeded kCopSrdoNotInOrder The two CAN meassages
62. t Preferences Expand the menu on the left part of the window click General gt Workspace gt Linked Resources In the right window use the New button to create a new entry name cop and location C systec cop Please pay attention to the case sensitive At the end the dialog should look at as follows r ve Preferences type filter text General Appearance Compare Patch Content Types Editors Keys Perspectives Search Startup and Shutdown Web Browser Welcome Workspace Build Order Linked Resources Local History C C ccs Help Install Undate Linked Resources ga yY v Zu m V Enable linked resources Path variables specify locations in the file system may be specified relative to these path variables Defined path variables amp CCS_C2000_5_2_10_CG_ROOT C Program CCS_C2000_6_0_1_CG_ROOT C Program F gt CCS_TMS470_4_6_4_CG_ROOT C Program amp CCS_TMS470_4_9 0_CG_ROOT C Program In the left part of the window change to C C gt PathEntry Variables Add tehere also a new entry with the button New and named it cop and add it to C systec cop r e Preferences type filter text General a C C Appearance Build Console Code Formatter Debug Editor File Types Indexer Make Managed Build Parser PathEntry Variables ccs Help Install Update Run Debug Team m PathEntry Variables Py x Pat
63. ual file objdict h L 1077e_08 SYS TEC electronic GmbH 2015 11 Extension of the CANopen user layer 2 3 Software structure The SRDO module is integrated in the stack in parallel to the existing modules such as PDO or SDO Application CCM Main CCM DfPdo CCM Obj Instance table SRDO SDOS SDOC LSS HBP HBC NMT CCM Xxx Instance table O BD Q OB CDRV Figure 6 General software structure The implementation contains two different SRDO modules application layer CCM layer CANopen Stack layer CAN driver layer SRDO C This module contains the services to define and transmit SRDOs SRDOSTC C This module provides the same services as SRDO C but it concerns the realization of static SRDO mapping CCMSRDO C User interface of the SRDO module L 1077e_08 SYS TEC electronic GmbH 2015 12 Extension of the CANopen user layer 2 4 Configuration of the software The software configuration is the same as in the standard CANopen stack also with the copcfg h file For SRDOs there are a few defines that are explained below Lack of these defines in the file copcfg h activate their default settings SRDO_USE_STATIC_MAPPING Value range FALSE TRUE Default FALSE Meaning If TRUE static mapping is used instead of dynamic mapping of the SRDOs The mapping then cannot be changed neither via SDO nor by the application during the runtime Instead of SRDO C SRDOSTC C fil
64. vi Texas Instruments XDS100v2 USB Emulator_0 CortexR4 17 18 07 p Texas Instruments XDS100v2 USB Emulator_0 CortexR4 CIO 17 18 07 Do you want to stop debugging then simply change the perspective back to C C Click in the upper right part of the Code Composer Studio on the icon next to debug The following Contex Menu C C will be offered ei Fy 5 Debug a Fig C C E Other f Now you are back to the Project Explorer of the Code Composer Studio The programming of the firmware in the flash takes a long time first the entire flash is erased Therefore you should change the debug options so that only the flash sectors will be erased which are used by the application Click with the right mouse button on the project and select the context menu Debug As gt Debug In the next dialog switch on the right side of the window click the tab sheet Target Select the line TMS570LS20216SZWT Flash Settings Now you can find the Erase Options on the right side Selct Necessary Sectors Only and press Apply L 1077e_08 SYS TEC electronic GmbH 2015 29 Reference environment TMDX570LS20SMDK Le e Debug Create manage and run configurations Edit the launch configuration settings Changes will take effect on the next launch CB xe e Name demo_srdo_actor type filter text fe C C Local Application fe C C Postmortem debugger DVT Control e Non Project Debug Session Ki Project
65. work Document number L 1077e_08 Edition September 2015 How would you improve this manual Have you found any mistake in this manual Page Sent in by Customer number Name Company Address Please submit to SYS TEC electronic GmbH Am Windrad 2 D 08468 Heinsdorfergrund GERMANY Fax 49 0 3765 38600 4100 L 1077e_08 SYS TEC electronic GmbH 2015 Suggestions for Improvements Sys TEC SYS TEC electronic GmbH 2015 Best Nr L 1077e_08 Printed in Germany

Download Pdf Manuals

image

Related Search

Related Contents

    Product Manual    

Copyright © All rights reserved.
Failed to retrieve file