Interpreterkommandos zum Zugriff auf das "eigene" CANopen-Objekt-Dictionary (OBD)

(nur für bestimmte Terminals mit geeignetem CAN-Transceiver)

Dieses Dokument beschreibt, wie einzelne Werte im "eigenen" Object-Dictionary ("OBD" per Interpreterkommando gelesen und geschrieben werden können.

Hinweis:


Inhalt

Siehe auch (Links zu anderen Dokumenten) :



Elementarer OBD-Zugriff mit einer Interpreterfunktion des Terminals

Bei Geräten mit CANopen (seit 2004) können einzelne Werte im eigenen Objekt-Dictionary Interpreterkommando gelesen oder geschrieben werden.
Die folgende Beschreibung bezieht sich nur auf den Display-Interpreter.
Bei Geräten mit der neueren Script-Sprache (die nicht interpretiert, sondern compiliert wird) sind seit Juli 2013 ähnliche Funktionen verfügbar. Diesen muss allerdings der Prefix 'cop.' (für 'CANopen') vorangestellt werden, um den Namensraum des Compilers nicht zu 'verseuchen' (namespace pollution).

Syntax:
obd( < index >.< subindex> [ , datentyp ] )
Beispiele:
@X = obd(0x6000.1)
obd(0x6200.1, U8) = X+1

Im Gegensatz zur ähnlichen Funktion "sdo" braucht hier i.A. kein Datentyp angegeben werden, denn die Datentypen des eigenen Objekt-Dictionaries sind der Terminal-Firmware (bis auf wenige Sonderfälle) bekannt.

Wenn der Aufruf einer "obd"-Funktion fehlschlägt, wird der Wert von "obd.coperr" auf einen Fehlercode vom CANopen-Protokoll-Stack gesetzt. Details zu den Fehlercodes des CANopen-Protokoll-Stacks finden Sie im nächsten Kapitel.

Siehe auch: 'Variablen'-Objekte im OD des programmierbaren Terminals (Index 0x4001 bis 0x4009) .

zurück zur Übersicht


CANopen-"kernel"-Fehlercodes

If the CANopen protocol stack detects an error (while accessing the own -local- object dictionary), the interpreter saves the error code as "obd.coperr". It can be read like a variable. Some of these error codes are shown below. The full set of error codes can be found in the CANopen slave documentation by SysTec.

Error Symbol Hex value Meaning / Remarks
kCopSuccessful 0x0000 no error/successful run
kCopIllegalInstance 0x0001 the called instance does not exist
kCopInvalidInstanceParam 0x0002  ?
kCopNoFreeInstance 0x0003 AddInstance was called but no free instance is available
kCopWrongSignature 0x0004 wrong signature while writing to object 0x1010 or 0x1011
kCopUnsupportedBtrTable 0x0005 unsupported baudrate table was configured with LSS service
kCopUnsupportedBtrIndex 0x0006 unsupported baudrate index was configured with LSS service
kCopInvalidNodeId 0x0007 CANopen was initialized with an invalid NodeId
kCopNoResource 0x0008 resource could not be created (Windows, PxROS, ...)
kCopInvalidParam 0x0009 generic error code for an invalid param
kCopCdrvNoMsg 0x0010 no CAN message was received
kCopCdrvMsgHigh 0x0011 CAN message with high priority was received
kCopCdrvMsgLow 0x0012 CAN message with low priority was received
kCopCdrvInitError 0x0013
kCopCdrvNoFreeChannel 0x0014 CAN controller has not a free channel

...

kCopCobNoFreeEntry 0x0020 no free entry in RX- or TX-COB table
kCopCobAlreadyExist 0x0021 COB-ID already exists in RX- resp. TX-COB table
kCopCobIllegalHdl 0x0022 illegal handle for a COB was assigned
kCopCobIllegalCanId 0x0023 COB-ID is not allowed (like 0x000 is reserved for NMT, ...)
kCopCobInvalidCanId 0x0024 COB-ID is switched off
kCopCobCdrvStateSet 0x0025 at least one bit of CAN driver state is set
kCopCobNoFreeEntryHighBuf 0x0026 no free entry in high priotity RX- or TX-COB table
kCopCobOwnId 0x0027 COB-ID already exists in own module which calls CobDefine() or CobCheck()
kCopCobWrongCobType 0x0028 e.g. a COB which was definded as Rx-Message should be sent
kCopObdIllegalPart 0x0030 unknown OD part
kCopObdIndexNotExist 0x0031 object index does not exist in OD
kCopObdSubindexNotExist 0x0032 subindex does not exist in object index
kCopObdReadViolation 0x0033 read access to a write-only object
kCopObdWriteViolation 0x0034 write access to a read-only object
kCopObdAccessViolation 0x0035 access not allowed
kCopObdUnknownObjectType 0x0036 object type not defined/known
kCopObdVarEntryNotExist 0x0037 object does not contain VarEntry structure
kCopObdValueToLow 0x0038 value to write to an object is to low
kCopObdValueToHigh 0x0039 value to write to an object is to high
kCopObdValueLengthError 0x003A value to write is to long or to short
kCopObdIllegalFloat 0x003B illegal float variable
kCopObdWrongOdBuilderKey 0x003F OD was generated with demo version of tool ODBuilder
kCopNmtUnknownCommand 0x0040 unknown NMT command
kCopNmtLifeguardVsHeartbeat 0x0041 one of life guarding or heartbeat was configured
but the other one is already configured
kCopNmtBootupNotPossible 0x0042 bootup message can not be sent in this NMT state
kCopNmtHbcWrongCfg 0x0043 configuration of Heartbeat Consumer was wrong
kCopNmtmSlaveNodeExist 0x0044 NMT slave node can not be added because it does already exist
kCopNmtmNoFreeSlaveEntry 0x0045 no free entry to add a new NMT slave node
kCopNmtmSlaveEntryNotExist 0x0046 NMT slave node was never added
kCopNmtStateError 0x0047 error has occured during NMT state machine
kCopNmtmInvalidSlaveNodeId 0x0048
kCopSdocInitError 0x0050 initialising or changing parameter not successful
kCopSdocInvalidParam 0x0051 one of the function parameters is invalid
kCopSdocClientNotExist 0x0052 selected SDO client does not exist
kCopSdocBusy 0x0053 SDO client is already busy
kCopSdocTransferError 0x0054 an error occured during SDO transfer
kCopSdocWrongMultiplexor 0x0055 an SDO response was received with wrong multiplexor
kCopSdocEntryAlreadyDefined 0x0056 client entry is already defined
kCopSdocNoFreeEntry 0x0057 no free client entry found in SDO server table
kCopSdocConfigOrder 0x0058
kCopSdosInitError 0x0060 initialising or changing parameter not successful
kCopSdosServerNotExist 0x0061 selected SDO server does not exist
kCopSdosBusy 0x0062 SDO server is already busy
kCopSdosSizeMismatch 0x0063
kCopSdosNoFreeEntry 0x0064 no free server entry found in SDO server table
kCopSdosEntryAlreadyDefined 0x0065 server entry is already defined
kCopSdosConfigOrder 0x0066
kCopSdosWrongDlc 0x0067
kCopSdosWrongCcs 0x0068
kCopPdoNotExist 0x0070 selected PDO does not exist
kCopPdoLengthExceeded 0x0071 length of PDO mapping exceedes 64 bis
kCopPdoGranularityMismatch

0x0072 configured PDO granularity is not equal to supported granularity
kCopPdoInitError 0x0073 error during initialisation of PDO module
kCopPdoErrorPdoEncode 0x0074 error during encoding a PDO
kCopPdoErrorPdoDecode 0x0075 error during decoding a PDO
kCopPdoErrorSend 0x0076 error during sending a PDO
kCopPdoErrorSyncWin

0x0077 the SYNC window runs out
during sending SYNC-PDOs
kCopPdoErrorMapp 0x0078 invalid PDO mapping
kCopPdoVarNotFound 0x0079 variable was not found in function PdoSignalVar()
kCopPdoErrorEmcyPdoLen 0x007A the length of a received PDO is unequal to the expected value
kCopPdoWriteConstObject 0x007B constant object can not be written
kCopPdoErrorRxEventTimer 0x007C If an RPDO is configured with Event Timer,
but PDO is not received after this time,
CcmCbError() will be called with this error code.

...

zurück zur Übersicht


zurück zur Übersicht


Datei: ..?..\uptwin1\help\obdcm_49.htm
Autor: W.Büscher, MKT Systemtechnik
Letzte Änderung: 2014-12-01 (ISO8601, YYYY-MM-DD)

zurück zur Übersicht