Global

Members

(constant) AccessType :string

Description:
  • CANopen access types.

    The access rights for a particular object. The viewpoint is from the network into the CANopen device.

Source:
See:
  • CiA301 "Access usage" (§7.4.5)
Properties:
Name Type Description
READ_WRITE string

Read and write access.

WRITE_ONLY string

Write only access.

READ_ONLY string

Read only access.

CONSTANT string

Read only access. Contents should not change after initialization.

CANopen access types.

The access rights for a particular object. The viewpoint is from the network into the CANopen device.

Type:
  • string

(constant) DataType :number

Description:
  • CANopen data types.

    The static data types are placed in the object dictionary at their specified index for definition purposes only. Simple types may be mapped to an RPDO as a way to define space for data that is not being used by this CANopen device.

Source:
See:
  • CiA301 "Data type entry usage" (§7.4.7)
Properties:
Name Type Description
BOOLEAN number

Boolean value (bool).

INTEGER8 number

8-bit signed integer (int8_t).

INTEGER16 number

16-bit signed integer (int16_t).

INTEGER32 number

32-bit signed integer (int32_t).

UNSIGNED8 number

8-bit unsigned integer (uint8_t).

UNSIGNED16 number

16-bit unsigned integer (uint16_t).

UNSIGNED32 number

32-bit unsigned integer (uint32_t).

REAL32 number

32-bit floating point (float).

VISIBLE_STRING number

Null terminated c-string.

OCTET_STRING number

Raw character buffer.

UNICODE_STRING number

Unicode string.

TIME_OF_DAY number

Time since January 1, 1984.

TIME_DIFFERENCE number

Time difference.

DOMAIN number

Data of variable length.

REAL64 number

64-bit floating point (double)

INTEGER24 number

24-bit signed integer.

INTEGER40 number

40-bit signed integer.

INTEGER48 number

48-bit signed integer.

INTEGER56 number

56-bit signed integer.

INTEGER64 number

64-bit signed integer (int64_t).

UNSIGNED24 number

24-bit unsigned integer.

UNSIGNED40 number

40-bit unsigned integer.

UNSIGNED48 number

48-bit unsigned integer.

UNSIGNED56 number

56-bit unsigned integer.

UNSIGNED64 number

64-bit unsigned integer (uint64_t)

PDO_PARAMETER number

PDO parameter record.

PDO_MAPPING number

PDO mapping parameter record.

SDO_PARAMETER number

SDO parameter record.

IDENTITY number

Identity record.

CANopen data types.

The static data types are placed in the object dictionary at their specified index for definition purposes only. Simple types may be mapped to an RPDO as a way to define space for data that is not being used by this CANopen device.

Type:
  • number

(constant) EmcyCode :number

Description:
  • CANopen emergency error codes.

Source:
See:
  • CiA301 "Emergency object (EMCY)" (§7.2.7)
Properties:
Name Type Description
CAN_OVERRUN number

CAN overrun (objects lost).

BUS_PASSIVE number

CAN in error passive mode.

HEARTBEAT number

Life guard or heartbeat error.

BUS_OFF_RECOVERED number

CAN recovered from bus off.

CAN_ID_COLLISION number

CAN-ID collision.

PDO_LENGTH number

PDO not processed due to length error.

PDO_LENGTH_EXCEEDED number

PDO length exceeded.

DAM_MPDO number

DAM MPDO not processed, destination object not available.

SYNC_LENGTH number

Unexpected SYNC data length.

RPDO_TIMEOUT number

RPDO timed out.

TIME_LENGTH number

Unexpected TIME data length.

CANopen emergency error codes.

Type:
  • number

(constant) EmcyType :number

Description:
  • CANopen emergency error code classes.

Source:
See:
  • CiA301 "Emergency object (EMCY)" (§7.2.7)
Properties:
Name Type Description
ERROR_RESET number

Error reset or no error.

GENERIC_ERROR number

Generic error.

CURRENT_GENERAL number

Current error.

CURRENT_INPUT number

Current error, CANopen device input side.

CURRENT_INTERNAL number

Current error inside the CANopen device.

CURRENT_OUTPUT number

Current error, CANopen device output side.

VOLTAGE_GENERAL number

Voltage error.

VOLTAGE_MAINS number

Voltage error, mains.

VOLTAGE_INTERNAL number

Voltage error inside the CANopen device.

VOLTAGE_OUTPUT number

Voltage error, CANopen device output side.

TEMPERATURE_GENERAL number

Temperature error.

TEMPERATURE_AMBIENT number

Temperature error, ambient.

TEMPERATURE_DEVICE number

Temperature error, CANopen device.

HARDWARE number

CANopen device hardware error.

SOFTWARE_GENERAL number

CANopen device software error.

SOFTWARE_INTERNAL number

Internal software error.

SOFTWARE_USER number

User software error.

SOFTWARE_DATA number

Data set error.

MODULES number

Additional modules error.

MONITORING number

Monitoring error.

COMMUNICATION number

Monitoring error, communication.

PROTOCOL number

Monitoring error, protocol.

EXTERNAL number

External error.

ADDITIONAL_FUNCTIONS number

Additional functions error.

DEVICE_SPECIFIC number

CANopen device specific error.

CANopen emergency error code classes.

Type:
  • number

(constant) LssMode :number

Description:
  • CANopen LSS modes.

Source:
See:
  • CiA305 "Switch Mode Global" (§3.9.1)
Properties:
Name Type Description
OPERATION number

Only the switch mode service is available.

CONFIGURATION number

All LSS services are available.

CANopen LSS modes.

Type:
  • number

(constant) NmtState :number

Description:
  • NMT internal states.

Source:
See:
  • CiA301 "NMT states" (§7.3.2.2)
Properties:
Name Type Description
INITIALIZING number

The CANopen device's parameters are set to their power-on values.

PRE_OPERATIONAL number

Communication via SDOs is possible, but PDO communication is not allowed. PDO configuration may be performed by the application.

OPERATIONAL number

All communication objects are active. Access to certain aspects of the application may be limited.

STOPPED number

No communication except for node guarding and heartbeat.

NMT internal states.

Type:
  • number

(constant) ObjectType :number

Description:
  • CANopen object types.

Source:
See:
  • CiA301 "Object code usage" (§7.4.3)
Properties:
Name Type Description
NULL number

An object with no data fields.

DOMAIN number

Large variable amount of data, e.g. executable program code.

DEFTYPE number

Denotes a type definition such as BOOLEAN, UNSIGNED16, etc.

DEFSTRUCT number

Defines a new record type, e.g. PDO mapping structure.

VAR number

A single value such as an UNSIGNED8, INTEGER16, etc.

ARRAY number

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

RECORD number

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

CANopen object types.

Type:
  • number

Methods

calculateCrc(data) → {number}

Description:
  • Calculates a CRC16 on a block of data.

Source:
Parameters:
Name Type Description
data Buffer

data block.

Returns:

crc value.

Type
number

dateToTime(date) → {object}

Description:
  • Deconstruct a Date object into a CANopen timestamp.

Source:
Since:
  • 6.0.0
Parameters:
Name Type Description
date Date

Date object.

Returns:

CANopen timestamp { days, ms }

Type
object

rawToType(raw, type, scaleFactoropt) → {number|bigint|string|Date}

Description:
  • Convert a Buffer to a value based on type.

Source:
Parameters:
Name Type Attributes Default Description
raw Buffer

data to convert.

type DataType | string

how to interpret the data.

scaleFactor number <optional>
1

optional multiplier for numeric types.

Returns:

converted data.

Type
number | bigint | string | Date

timeToDate(days, ms) → {Date}

Description:
  • Construct a Date object from a CANopen timestamp.

Source:
Since:
  • 6.0.0
Parameters:
Name Type Description
days number

days since Jan 1, 1984

ms number

milliseconds since midnight.

Returns:

converted Date.

Type
Date

typeToRaw(value, type, scaleFactoropt) → {Buffer}

Description:
  • Convert a value to a Buffer based on type.

Source:
Parameters:
Name Type Attributes Default Description
value number | bigint | string | Date

data to convert.

type DataType | string

how to interpret the data.

scaleFactor number <optional>
1

optional multiplier for numeric types.

Returns:

converted Buffer.

Type
Buffer