CANopen Slave Documentation
Version 6.16.04
|
The add-on module CANopen Device Profile CiA 404 allows the integration of measuring devices as specified in CiA 404-1.
The module version is defined by COS_DS404_VERSION_MAJOR and COS_DS404_VERSION_MINOR. Please refer to the history for changes between different versions.
The module is configured by setting of the following symbols inside the cos_conf.h
file:
COS_DS404_AI | number of analog inputs |
COS_DS404_AI_FILTER | support filter for analog inputs inputs |
COS_DS404_AI_SCALING | support scaling for analog inputs |
COS_DS404_AO | number of analog outputs |
The profile allows to support different data types. By means of the following symbols one or multiple data types can be selected. The symbols are located inside the cos_conf.h
file:
COS_DS404_DT_FLOAT | support data type |
COS_DS404_DT_INT16 | support data type |
COS_DS404_DT_INT32 | support data type |
Use the header file cos404.h
to get access to the CANopen Device Profile CiA 404 API.
Each analog input channel is initialized by calling Cos404_AI_Init() prior to CosMgrStart(). An example initialization routine is located inside the cos404_app_ai.c
file.
Analog inputs are read by the application and passed to the protocol stack by means of either Cos404_AI_SetFV_Int16(), Cos404_AI_SetFV_Int32() or Cos404_AI_SetFV_Real32(), depending on the supported data type.
If dynamic PDO mapping is supported (COS_PDO_MAPPING > 0) the default mapping can be set inside the CosPdoComSetup() function, as shown in the following example:
Analog outputs are written by the application by means of either Cos404_AO_SetPV_Int16(), Cos404_AO_SetPV_Int32() or Cos404_AO_SetPV_Real32(), depending on the supported data type.
If dynamic PDO mapping is supported (COS_PDO_MAPPING > 0) the default mapping can be set inside the CosPdoComSetup() function, as shown in the following example:
cos404.h | CiA 404 - Generic definitions |
cos404ai.h | CiA 404 - Analog inputs |
cos404ao.h | CiA 404 - Analog outputs |