CANopen Slave Documentation
Version 7.00.02
Loading...
Searching...
No Matches
cos410.h File Reference

Detailed Description

An inclinometer or tilting sensor measures the inclination. There are one-axis and two-axes sensor devices. The measured values are provided by means of pre-defined PDO services (CANopen CC and CANopen FD), by means of SDO services (CANopen CC) respectively USDO services (CANopen FD).

Device classes

The CiA 410 specification supports different device classes. The device classes can be configured by means of the symbols COS_DS410_DT_INTEGER16, COS_DS410_DT_INTEGER32 and COS_DS410_TWO_AXIS.

Class Description Configuration Symbol
C1 one-axis 16-bit value measurements COS_DS410_DT_INTEGER16=1, COS_DS410_TWO_AXIS=0
C2 two-axes 16-bit value measurements COS_DS410_DT_INTEGER16=1, COS_DS410_TWO_AXIS=1
C3 one-axis 32-bit value measurements COS_DS410_DT_INTEGER32=1, COS_DS410_TWO_AXIS=0
C4 two-axes 32-bit value measurements COS_DS410_DT_INTEGER32=1, COS_DS410_TWO_AXIS=1

Object dictionary

The module adds the following objects to the object dictionary:

Index Description Function / Variable Configuration Symbol
6000h Resolution Cos410_SetResolution() -
6010h Slope long16 - COS_DS410_DT_INTEGER16
6011h Slope long16 operating parameter - COS_DS410_DT_INTEGER16
6012h Slope long16 preset value - COS_DS410_DT_INTEGER16
6013h Slope long16 offset - COS_DS410_DT_INTEGER16
6014h Differential slope long16 offset - COS_DS410_DT_INTEGER16
6020h Slope lateral16 - COS_DS410_DT_INTEGER16
6021h Slope lateral16 operating parameter - COS_DS410_DT_INTEGER16
6022h Slope lateral16 preset value - COS_DS410_DT_INTEGER16
6023h Slope lateral16 offset - COS_DS410_DT_INTEGER16
6024h Differential slope lateral16 offset - COS_DS410_DT_INTEGER16
6110h Slope long32 - COS_DS410_DT_INTEGER32
6111h Slope long32 operating parameter - COS_DS410_DT_INTEGER32
6112h Slope long32 preset value - COS_DS410_DT_INTEGER32
6113h Slope long32 offset - COS_DS410_DT_INTEGER32
6114h Differential slope long32 offset - COS_DS410_DT_INTEGER32
6120h Slope lateral32 - COS_DS410_DT_INTEGER32
6121h Slope lateral32 operating parameter - COS_DS410_DT_INTEGER32
6122h Slope lateral32 preset value - COS_DS410_DT_INTEGER32
6123h Slope lateral32 offset - COS_DS410_DT_INTEGER32
6124h Differential slope lateral32 offset - COS_DS410_DT_INTEGER32
6511h Device temperature Cos410_SetTemperature() -
+ Include dependency graph for cos410.h:

Macros

#define COS_DS410_VERSION_MAJOR   2
 
#define COS_DS410_VERSION_MINOR   0
 
#define COS_DS410_DT_INTEGER16   1
 
#define COS_DS410_DT_INTEGER32   0
 
#define COS_DS410_TWO_AXIS   0
 

Functions

uint8_t Cos410_ConfigureResolution (uint16_t uwResolutionV)
 
void Cos410_SetAngleValue16 (int16_t swLongAxisV, int16_t swLatAxisV)
 
void Cos410_SetAngleValue32 (int32_t slLongAxisV, int32_t slLatAxisV)
 
void Cos410_SetResolution (uint16_t uwResolutionV)
 
void Cos410_SetTemperature (int16_t swTemperatureV)
 

Macro Definition Documentation

◆ COS_DS410_DT_INTEGER16

#define COS_DS410_DT_INTEGER16   1

The symbol defines if 16-bit values are supported or not. Possible values are 0 and 1. The default value is 1 (16-bit values supported).

◆ COS_DS410_DT_INTEGER32

#define COS_DS410_DT_INTEGER32   0

The symbol defines if 32-bit values are supported or not. Possible values are 0 and 1. The default value is 0 (32-bit values supported).

◆ COS_DS410_TWO_AXIS

#define COS_DS410_TWO_AXIS   0

The symbol defines if a two-axel inclinometer is used (longitudinal and lateral) or a one-axis inclinometer. Possible values are 0 and 1. The default value is 0 (one-axis inclinometer).

Function Documentation

◆ Cos410_ConfigureResolution()

uint8_t Cos410_ConfigureResolution ( uint16_t uwResolutionV)
Parameters
[in]uwResolutionVresolution value
Returns
SDO handler code
See also
Cos410_SetResolution()
Note
The code located in the file cos410_app.c provides an example and has to be adopted to the application.

The function is a callback function triggered by the protocol stack. It shall check the supplied parameter uwResolutionV for validity. Possible return values are:

  • eCosSdo_WRITE_OK: resolution value is valid
  • eCosSdo_ERR_VALUE_RANGE: resolution value is invalid
  • eCosSdo_ERR_ACCESS_RO: the resolution can not be altered
uint8_t Cos410_ConfigureResolution(uint16_t uwResolutionV)
{
uint8_t ubResultT = eCosSdo_ERR_VALUE_RANGE;
//---------------------------------------------------------------------------------------------------
// allow resolution 0,001 degree and 0,01 degree
//
if ((uwResolutionV == 1) || (uwResolutionV == 10))
{
ubResultT = eCosSdo_WRITE_OK;
}
return (ubResultT);
}
Object Dictionary for CiA 410 (Inclinometer) .

◆ Cos410_SetAngleValue16()

void Cos410_SetAngleValue16 ( int16_t swLongAxisV,
int16_t swLatAxisV )
Parameters
[in]swLongAxisVangle value of longitudinal axis
[in]swLatAxisVangle value of lateral axis
See also
Cos410_SetAngleValue32()

The function sets the 16-bit signed slope angle values for longitudinal and lateral axis. In case the lateral axis is not supported (definition COS_DS410_TWO_AXIS=0) the second parameter has no effect.

◆ Cos410_SetAngleValue32()

void Cos410_SetAngleValue32 ( int32_t slLongAxisV,
int32_t slLatAxisV )
Parameters
[in]slLongAxisVangle value of longitudinal axis
[in]slLatAxisVangle value of lateral axis
See also
Cos410_SetAngleValue16()

The function sets the 32-bit signed slope angle values for longitudinal and lateral axis. In case the lateral axis is not supported (definition COS_DS410_TWO_AXIS=0) the second parameter has no effect.

◆ Cos410_SetResolution()

void Cos410_SetResolution ( uint16_t uwResolutionV)
Parameters
[in]uwResolutionVresolution value
See also
Cos410_ConfigureResolution()

The function sets the resolution value for data object 6000:00h according to CiA 410-B. The supplied value is a multiple of 0,001 degree.

◆ Cos410_SetTemperature()

void Cos410_SetTemperature ( int16_t swTemperatureV)
Parameters
[in]swTemperatureVtemperature value

The function sets the device temperature value for data object 6511:00h according to CiA 410-B. The supplied value is a multiple of 1 degree Celsius.