Supported platforms: CODESYS 2.3, CODESYS 3.5

 

List of CANopen Library's Data Types

 

CANopenDataUnion (UNION)

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

pData

POINTER TO ANY

Pointer to data, used when data length is over 4 bytes.

Data

DWORD

Data, used when data length is 4 bytes or less.

 

 

CANopenDefPDO (STRUCT)

Name of the Member

Data Type

Description

Count

WORD

The amount of the PDOs.

pPDO

POINTER TO CANopenPDO

Pointer to the CANopenPDO struct array.

 

CANopenDev (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

NodeID

BYTE

The device's identification number in the CAN bus.

DrvNbr

BYTE

CAN channel number
(0=CAN1, 1=CAN2...)

Protocols

POINTER TO CANopenProtocolEntry

Pointer to first used protocol

 

Next

DWORD

Pointer to next CANopen device

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

NodeID

BYTE

The device's identification number in the CAN bus.

itfCanChannel

CANVXD_API.ICANVXD

CAN channel interface

pProtocols

POINTER TO CANopenProtocolEntry

Pointer to first used protocol

pNext

POINTER TO CANopenDev

Pointer to next CANopen device

 

 

CANopenDomain (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

data

DWORD

Pointer to data buffer.

FileSize

DWORD

The reserved buffer size.

DataSize

DWORD

The used buffer size.

pFileName

DWORD

Pointer to the file name.

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

pData

POINTER TO ANY

Pointer to data buffer.

FileSize

DWORD

Reserved buffer size.

DataSize

DWORD

Used buffer size.

pFileName

POINTER TO ANY

Pointer to the file name.

 

 

CANopenEMCYObject (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

ErrorCode

WORD

EMCY Error-code by DS301.

Message bytes 0,1 [0..7]

Details

WORD

EMCY Manufacturer specific error field. Message bytes 3,4 [0..7]

Details2

DWORD

EMCY Manufacturer specific error field.

Message bytes 5,6,7 [0..7]

ErrorRegisterMask

BYTE

Active bits for 1001h index.

Byte 2 in EMCYmessage

Prev

DWORD

Pointer to previous CANopenEMCYObject for internal use

Next

DWORD

Pointer to next CANopenEMCYObject for internal use

StateChangeTime

TIME

Time when EMCY state has changed. After sending this is zero

Active

BOOL

EMCY object activity status

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

ErrorCode

WORD

EMCY Error-code by DS301.

Message bytes 0,1 [0..7]

Details

WORD

EMCY Manufacturer specific error field. Message bytes 3,4 [0..7]

Details2

DWORD

EMCY Manufacturer specific error field.

Message bytes 5,6,7 [0..7]

ErrorRegisterMask

BYTE

Active bits for 1001h index.

Byte 2 in EMCYmessage

pPrev

POINTER TO CANopenEMCYObject

Pointer to previous CANopenEMCYObject for internal use

pNext

POINTER TO CANopenEMCYObject

Pointer to next CANopenEMCYObject for internal use

StateChangeTime

TIME

Time when EMCY state has changed. After sending this is zero

Active

BOOL

EMCY object activity status

 

 

CANopenEMCYProtocol (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

ErrorRegister

BYTE

Error register: OD index 1001h

ActiveEmcyCodes

POINTER TO CANopenEMCYObject

A list of active EMCY codes: OD index 1003h

PassiveEmcyCodes

POINTER TO CANopenEMCYObject

The latest cleared but not sent Clear EMCY

COBID

DWORD

COB-ID of the EMCY object: OD index 1014h

InhibitTime

TIME

Inhibit time from OD index 1015h in milliseconds

InhibitTimeValue

WORD

OD index 1015h:

EMCY inhibit time in *100us

LastTransmission

TIME

Last EMCY transmission time

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

ErrorRegister

BYTE

Error register: OD index 1001h

pActiveEmcyCodes

POINTER TO CANopenEMCYObject

A list of active EMCY codes: OD index 1003h

pPassiveEmcyCodes

POINTER TO CANopenEMCYObject

The latest cleared but not sent Clear EMCY

COBID

DWORD

COB-ID of the EMCY object: OD index 1014h

InhibitTime

TIME

Inhibit time from OD index 1015h in milliseconds

InhibitTimeValue

WORD

OD index 1015h:

EMCY inhibit time in *100us

LastTransmission

TIME

Last EMCY transmission time

 

 

 

CANopenErrors (ENUM)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Value

CANopenNoError

INT

0

CANopenErrorODFull

INT

-1400

CANopenErrorODTooShortToOrder

INT

-1399

CANopenErrorSubIndexNotExist

INT

-1398

CANopenErrorTypedefMissing

INT

-1397

CANopenErrorIndexZero

INT

-1396

CANopenErrorIndexNotExist

INT

-1395

CANopenErrorTypedefIsNotTypedef

INT

-1394

CANopenErrorDefstructMissing

INT

-1393

CANopenErrorTypedefIsNotDefstruct

INT

-1392

CANopenErrorNoOdLineFound

INT

-1391

CANopenErrorSuccess

INT

1

CANopenErrorFailure

INT

2

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Value

CANopenNoError

INT

0

CANopenErrorODFull

INT

-1400

CANopenErrorODTooShortToOrder

INT

-1399

CANopenErrorSubIndexNotExist

INT

-1398

CANopenErrorTypedefMissing

INT

-1397

CANopenErrorIndexZero

INT

-1396

CANopenErrorIndexNotExist

INT

-1395

CANopenErrorTypedefIsNotTypedef

INT

-1394

CANopenErrorDefstructMissing

INT

-1393

CANopenErrorTypedefIsNotDefstruct

INT

-1392

CANopenErrorNoOdLineFound

INT

-1391

CANopenErrorInputError

INT

-1390

CANopenErrorInterfaceError

INT

-1389

CANopenErrorProtocolDataMissing

INT

-1388

CANopenErrorRPDOTimeout

INT

-1387

 

 

 

CANopenHeartBeatConsumer (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

Data

POINTER TO CANopenHeartBeat

Pointer to the first heartbeat producer

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

pHeartbeatProducer

POINTER TO CANopenHeartBeatProducer

Pointer to the first heartbeat producer

 

 

 

CANopenNMT (STRUCT)

Name of the Member

Data Type

Description

NmtState

BYTE

Current NMT state of the device:
0 = initializing
4 = stopped
5 = operational
127 = pre-operational

HeartBeat

TON

Heartbeat timer that defines the time interval between the heartbeats.

StateChanged

BOOL

CANopen device state has changed according to an NMT command from CAN bus. This flag is TRUE one program cycle.

ResetStateChangedFlag

BOOL

Reset StateChanged flag in next program cycle.

OldState

BYTE

NMT state before the NMT command

LastNmtCommand

BYTE

Latest NMT command value. If multiple NMT commands are received on one program cycle, latest is seen in this variable.

 

 

CANopenObjectCode (ENUM)

Name of the Member

Data Type

Value

Description

OD_NULL

INT

0

A dictionary entry with no data fields

OD_CANopenDomain

INT

2

Large variable amount of data e.g.

executable program code

OD_DEFTYPE

INT

5

Denotes a type definition such as a Boolean, UNSIGNED16, float and so on

OD_DEFSTRUCT

INT

6

Defines a new record type e.g. the PDOMapping structure at 21h

OD_VAR

INT

7

A single value such as an UNSIGNED8, Boolean, float, Integer16, visible string etc.

OD_ARRAY

INT

8

A multiple data field object where each data field is a simple variable of the SAME basic data type e.g. array of UNSIGNED16 etc. Sub-index 0 is of UNSIGNED8 and therefore not part of the ARRAY data

OD_RECORD

INT

9

A multiple data field object where the data fields may be any combination of simple variables. Sub-index 0 is of UNSIGNED8 and therefore not part of the RECORD data

OD_EPEC

INT

10

Sub-index 0 is part of the OD_EPEC data.

The table above is according to DS-301. For more information refer to CiA standard DS-301 (Version 4.02).

CANopenOD (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

InOrder

BOOL

Indicates if the OD is organized by index numbers.

NextFree

BYTE

The line number of the next free OD line.

EntryCount

WORD

The amount of the OD lines.

OD

POINTER TO  CANopenOD_ENTRY

The pointer to OD.

AdditionalData

DWORD

Reserved

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

InOrder

BOOL

Indicates if the OD is organized by index numbers.

NextFree

BYTE

The line number of the next free OD line.

EntryCount

WORD

The amount of the OD lines.

pODEntry

POINTER TO  CANopenOD_ENTRY

The pointer to OD entry array

pAdditionalData

POINTER TO ANY

Pointer to any additional data.

 

 

 

CANopenOD_ENTRY (STRUCT)

The index information in OD.

 

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

index

WORD

The index number.

ObjectCode

CANopenObjectCode

The index type.

NumOfSubids

BYTE

The amount of sub-indexes.

TypeSpec

WORD

Index where the type is specified ie. 0005h=U8

Used if ObjectCode is VAR, ARRAY or RECORD.

(complete list of the types can be found in CiA standard DS-301 (Version 4.02))

ObjectAccess

BYTE

See global constant variables.

sub0data

BYTE

The data of object's subindex 0 when the data type is ARRAY, RECORD or DEFSTRUCT.

pIndexData

DWORD

If the data type is

  • VAR, ARRAY or RECORD, the value is pointer to data

  • DEFTYPE, the value defines the bit amount

  • DOMAIN, the value is pointer to data in CANopenDomain (STRUCT)

  • DEFSTRUCT, the value is pointer to an array that defines for example the PDO Communication Parameter Record according to CiA DS-301 (table 41.).

CallBackPOU

WORD

POU index of callback POU.

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

Index

WORD

OD index number.

ObjectCode

CANopenObjectCode

The index type.

NumOfSubids

BYTE

The amount of sub-indexes.

TypeSpec

WORD

Index where the type is specified ie. 0005h=U8

Used if ObjectCode is VAR, ARRAY or RECORD.

(complete list of the types can be found in CiA standard DS-301 (Version 4.02))

ObjectAccess

BYTE

Object access flags.

See global constant variables.

Sub0data

BYTE

The data of object's subindex 0 when the data type is ARRAY, RECORD or DEFSTRUCT.

IndexData

CANopenDataUnion

Index data

itfSDOHandler

ICANopenSDOHandler

Interface to additional SDO handler

 

 

 

CANopenODSubServices (ENUM)

Defines possible additional services for OD.

 

Name of the Member

Value

Description

NoSubServices

0

No subservices

Save

1

OD save functionality

 

CANopenPDOType (ENUM)

Name of the Member

Value

Description

ReceivePDO

0

PDO type is receive PDO

TransmitPDO

1

PDO type is transmit PDO

 

CANopenProtocolEntry (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

Data

DWORD

Pointer to protocol data

pDevice

DWORD

Pointer to the device that owns the protocol

Update

WORD

Index of the update POU

Init

WORD

Index of the init POU

ProtocolType

CANopenProtocolType

See the following table (CANopenProtocolType (ENUM)).

Next

DWORD

Pointer to next protocol entry

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

pData

POINTER TO ANY

Pointer to protocol data

pDevice

POINTER TO CANopenDev

Pointer to the device that owns the protocol

itfProtocol

ICANopenProtocol

Interface for protocol initialization and update

ProtocolType

CANopenProtocolType

See the following table (CANopenProtocolType (ENUM)).

pNext

POINTER TO CANopenProtocolEntry

Pointer to next protocol entry

 

 

CANopenProtocolType (ENUM)

Name of the Member

Value

NoProtocol

0

OD

1

NMT

2

SSDO

3

CSDO

4

RPDO

5

TPDO

6

SYNC

7

EMCY

8

HBCons

9

DevErrors

10

IndexSave

11

NodeGuard

12

 

CANopenSSDO (STRUCT)

CODESYS 2.3CODESYS 2.3

Name of the Member

Data Type

Description

SDO_DL_IN_PRG

BOOL

SDO transfer in progress

Toggle

BYTE

Normal transfer toggle mask

MUXinfo

DWORD

MUX = index*100h + subindex, for example 100900h

post

CANopenSDOTransferPhase

Transfer phase, see CANopenSDOTransferPhase

pData

DWORD

Pointer to the data to be transferred

unitsize

DWORD

(Sub)index size in bits

SDO_Parameters

 ARRAY [0..1] OF DWORD

Receive and transmit COB-IDs. Data of index 1200h, for example 16#601,16#581 when node-ID is 1

timeout

TON

SDO timeout timer

SDOCallbackReturn

DWORD

Abort code

 

 

CODESYS 3.5CODESYS 3.5

Name of the Member

Data Type

Description

SDOTransmissionActive

BOOL

SDO transmission in progress

Toggle

BYTE

Normal transfer toggle mask

MUXinfo

DWORD

MUX = index*100h + subindex, for example 100900h

Post

CANopenSDOTransferPhase

SDO transfer phase

 

0 = SDO Download indication. Beginning of SDO data transfer to OD index, data is unchanged.

  

1 =  SDO Download end.

 Data is transferred to index. Data content is the new data.

 

2 = SDO Upload indication.

 Beginning of SDO data upload from OD index, the requested data is not sent yet.

 

3 = SDO Upload end.

 Data is transferred from index to the CAN bus

 

See the following table CANopenSDOTransferPhase (ENUM).

pData

POINTER TO ANY

Pointer to the data to be transferred

Unitsize

DWORD

(Sub)index size in bits

SDO_Parameters

 ARRAY [0..1] OF DWORD

Receive and transmit COB-IDs. Data of index 1200h, for example 16#601,16#581 when node-ID is 1

Timeout

TON

SDO timeout timer

SDOCallbackReturn

DWORD

Return value from additional SDO handler

 

 

CANopenSDOTransferPhase (ENUM)

Name of the Member

Value

Description

SDO_DL_Ind

0

Beginning of SDO data transfer to OD index, data is unchanged.

SDO_DL_End

1

Data is transferred to index. Data content is the new data.

SDO_UPL_Ind

2

Beginning of SDO data upload from OD index, the requested data is not sent yet.

SDO_UPL_End

3

Data is transferred from index to the CAN bus.

 

CANopenSYNC (STRUCT)

Name of the Member

Data Type

Description

COBID

DWORD

Message ID

Count

BYTE

The amount of received SYNC messages

 

 

 

 

Source file Topic000214.htm

Last updated 21-Feb-2025