Interpreter commands to access the "own" CANopen object dictionary

(only available for certain terminals with CANopen transfer protocols)

This document describes how to read and write values in the terminal's "own" object dictionary (OBD), using an interpreter command.
Note:

Contents

See also:



Basic OBD read/write access using an interpreter function

Programmable terminals with CANopen protocol (since 2004) can access their "own" object dictionary with an interpreter command, similar as the access to a remote object dictionary (OBD) through a service data channel (SDO).
The following explanation applies only to the display interpreter.
For devices with the newer script language (which uses a compiler, not an interpreter), similar commands/function may be available, but they must be prefixed by 'cop.' (short for 'CANopen') to avoid namespace pollution.

Syntax:
obd( < index >.< subindex> [ , data type ] )
Examples:
@X = obd(0x6000.1, U8) : rem READ a value from the own OBD
obd(0x6200.1, U8)= X+1 : rem WRITE a value to the own OBD

In contrast to the similar "sdo"-access, you don't have to specify the data type (except for a few special cases), because the terminal firmware (usually) knows the data types in its own object dictionary.

If an obd-access function fails, the value of "obd.coperr" may be set to an error code which is specific to the CANopen-implementation used in the terminal. More on that in the next chapter.

See also: 'Variable' objects in the terminal's OD (Index 0x4001 to 0x4009) .

back to top


CANopen "kernel" error codes

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.

...

back to top


back to top


File: ..?..\uptwin1\help\obdcm_01.htm
Author: W.Büscher, MKT Systemtechnik
Last modified: 2007-08-24 (ISO8601, YYYY-MM-DD)

back to top