CANopen Slave Documentation
Version 7.00.02
|
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).
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 |
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() | - |
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) |
#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).
#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).
#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).
uint8_t Cos410_ConfigureResolution | ( | uint16_t | uwResolutionV | ) |
[in] | uwResolutionV | resolution value |
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 valideCosSdo_ERR_VALUE_RANGE:
resolution value is invalideCosSdo_ERR_ACCESS_RO:
the resolution can not be alteredvoid Cos410_SetAngleValue16 | ( | int16_t | swLongAxisV, |
int16_t | swLatAxisV ) |
[in] | swLongAxisV | angle value of longitudinal axis |
[in] | swLatAxisV | angle value of lateral axis |
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.
void Cos410_SetAngleValue32 | ( | int32_t | slLongAxisV, |
int32_t | slLatAxisV ) |
[in] | slLongAxisV | angle value of longitudinal axis |
[in] | slLatAxisV | angle value of lateral axis |
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.
void Cos410_SetResolution | ( | uint16_t | uwResolutionV | ) |
[in] | uwResolutionV | resolution value |
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.
void Cos410_SetTemperature | ( | int16_t | swTemperatureV | ) |
[in] | swTemperatureV | temperature 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.