CANopen Slave Protocol Stack 
Version 7.04.00
Loading...
Searching...
No Matches
cos406.h File Reference

Detailed Description

The purpose of encoders is to detect positions of any kind of machine tools. Encoders detect positions and transmit the position values across the CANopen network. Optionally the encoder may provide speed, acceleration, and jerk values. The encoder may receive configuration information via SDO, e.g. conversion parameters for calculating an - to the application adapted - position value. In the NMT state operational, the position value may be transmitted by synchronous PDO. Additionally, the encoders may transmit asynchronously a PDO scheduled by the elapsing of the event timer.

The CANopen device profile defines two encoder classes, a standard device class 1 (C1) and an extended device class 2 (C2). The standard device C1 specifies basic functionality, which shall be provided by each device. The C2 extended device provides a variety of features with mandatory and optional functions. The mandatory functions of both, C1 and C2, are necessary to ensure non-manufacturer specific operations of a device.

By defining mandatory device characteristics in C1, basic network and encoder operation is guaranteed. By defining extended C2, a degree of defined flexibility may be built in. By leaving hooks for optional and manufacturer-specific functionality, the device developer will not be constrained to an out-of-date standard.

Object dictionary

The module adds the following objects to the object dictionary:

Index Description Function / Variable Configuration Symbol
6000h Operating parameters Cos406_Idx6000() -
6001h Measuring units per revolution Cos406_Idx6001() COS_DS406
6002h Total measuring range in measuring units Cos406_Idx6002() -
6003h Preset value Cos406_Idx6003() -
6004h Position value ulIdx6004_PosValueG -
6005h Linear encoder measuring step settings Cos406_Idx6005() -
6030h Speed value Cos406_Idx6030() -
6040h Acceleration value Cos406_Idx6040() -
6050h Jerk value Cos406_Idx6050() -
6200h Cyclic timer Cos406_Idx6200() -
6500h Operating status Cos406_Idx6500() -
6501h Single-turn resolution / measuring step Cos406_Idx6501() -
6502h Number of distinguishable revolutions Cos406_Idx6502() -
6503h Alarms Cos406_Idx6503() -
6504h Supported alarms Cos406_Idx6504() DS406_SUPPORTED_ALARMS
6505h Warnings Cos406_Idx6505() -
6506h Supported warnings Cos406_Idx6506() DS406_SUPPORTED_WARNINGS
6507h Profile and software version Cos406_Idx6507() DS406_PROFILE_VERSION
6508h Operating time Cos406_Idx6508() -
6509h Offset value Cos406_Idx6509() -
650Ah Module identification Cos406_Idx650A() -
650Bh Serial number Cos406_Idx650B() -
Include dependency graph for cos406.h:

Macros

#define DS406_PROFILE_VERSION   0x0400
#define DS406_SUPPORTED_ALARMS   0x0001
#define DS406_SUPPORTED_WARNINGS   0x0002
#define DS406_RESOLUTION_SINGLE_TURN   16384
#define MAN_OFFSET_VALUE   0x00000000
#define MAN_MINPOS_VALUE   0x00000000
#define MAN_MAXPOS_VALUE   0x00003FFF
#define COS_DS406_VERSION_MAJOR   4
#define COS_DS406_VERSION_MINOR   0

Enumerations

enum  DS406_WARN_e

Functions

void Cos406_SetEncoderValue (uint32_t ulSgTurnV, uint32_t ulMtTurnV, uint32_t ulTimeDiffV)

Enumeration Type Documentation

◆ DS406_WARN_e

Warnings.

Warnings indicate that tolerance for certain internal parameters of the encoder have been exceeded. This warning will be used for Object 6505.

Enumerator
eWARN_FE 

Frequency exceeded.

eWARN_LCR 

Light control reserve reached.

eWARN_CPU_WS 

CPU watchdog status reset generated.

eWARN_OTLW 

Operating time limit warning.

eWARN_BC 

Battery charge too low.

eWARN_RP 

Reference point not reached.

eWARN_MSW1 

Manufacturer-specific warning 1.

eWARN_MSW2 

Manufacturer-specific warning 2.

eWARN_MSW3 

Manufacturer-specific warning 3.

eWARN_MSW4 

Manufacturer-specific warning 4.

Function Documentation

◆ Cos406_SetEncoderValue()

void Cos406_SetEncoderValue ( uint32_t ulSgTurnV,
uint32_t ulMtTurnV,
uint32_t ulTimeDiffV )
Parameters
[in]ulSgTurnVcurrent single turn value
[in]ulMtTurnVcurrent multi turn value
[in]ulTimeDiffVtime difference between current values and last values

This function passes the encoder values to the device profile CiA 406. The value for time difference is given in multiples of 1 ns.