CANopen Slave Protocol Stack 
Version 7.08.00
Loading...
Searching...
No Matches
cos404.h File Reference

Detailed Description

Include this header to access the complete CiA 404 API. It conditionally includes the sub-module headers for each function block based on the cos_conf.h configuration:

Function block Header Enabling define
Analog input cos404ai.h COS_DS404_AI
Analog output cos404ao.h COS_DS404_AO
Controller cos404co.h COS_DS404_CO
Digital input cos404di.h COS_DS404_DI
Digital output cos404do.h COS_DS404_DO

Set each define to the number of channels (or groups) required, or to 0 to exclude that function block from the build. See CANopen Device Profile CiA 404 for integration details.

Include dependency graph for cos404.h:

Macros

#define COS_DS404_VERSION_MAJOR   2
#define COS_DS404_VERSION_MINOR   10

Enumerations

enum  Cos404_Channel_e {
  eCOS404_CHANNEL_1 = 0 ,
  eCOS404_CHANNEL_2 ,
  eCOS404_CHANNEL_3 ,
  eCOS404_CHANNEL_4 ,
  eCOS404_CHANNEL_5 ,
  eCOS404_CHANNEL_6 ,
  eCOS404_CHANNEL_7 ,
  eCOS404_CHANNEL_8 ,
  eCOS404_CHANNEL_9 ,
  eCOS404_CHANNEL_10 ,
  eCOS404_CHANNEL_11 ,
  eCOS404_CHANNEL_12 ,
  eCOS404_CHANNEL_13 ,
  eCOS404_CHANNEL_14 ,
  eCOS404_CHANNEL_15 ,
  eCOS404_CHANNEL_16 ,
  eCOS404_CHANNEL_17 ,
  eCOS404_CHANNEL_18 ,
  eCOS404_CHANNEL_19 ,
  eCOS404_CHANNEL_20 ,
  eCOS404_CHANNEL_21 ,
  eCOS404_CHANNEL_22 ,
  eCOS404_CHANNEL_23 ,
  eCOS404_CHANNEL_24
}

Functions

uint16_t Cos404_GetActiveDataType (void)
uint8_t Cos404_SetActiveDataType (uint16_t uwDataTypeV)

Enumeration Type Documentation

◆ Cos404_Channel_e

This enumeration provides channel values used in conjunction with CiA 404. Note that the maximum channel value is defined by one of the following definitions in the file cos_conf.h

  • COS_DS404_AI : if the analog input function block is supported
  • COS_DS404_AO : if the analog output function block is supported
Enumerator
eCOS404_CHANNEL_1 

Channel 1

eCOS404_CHANNEL_2 

Channel 2

eCOS404_CHANNEL_3 

Channel 3

eCOS404_CHANNEL_4 

Channel 4

eCOS404_CHANNEL_5 

Channel 5

eCOS404_CHANNEL_6 

Channel 6

eCOS404_CHANNEL_7 

Channel 7

eCOS404_CHANNEL_8 

Channel 8

eCOS404_CHANNEL_9 

Channel 9

eCOS404_CHANNEL_10 

Channel 10

eCOS404_CHANNEL_11 

Channel 11

eCOS404_CHANNEL_12 

Channel 12

eCOS404_CHANNEL_13 

Channel 13

eCOS404_CHANNEL_14 

Channel 14

eCOS404_CHANNEL_15 

Channel 15

eCOS404_CHANNEL_16 

Channel 16

eCOS404_CHANNEL_17 

Channel 17

eCOS404_CHANNEL_18 

Channel 18

eCOS404_CHANNEL_19 

Channel 19

eCOS404_CHANNEL_20 

Channel 20

eCOS404_CHANNEL_21 

Channel 21

eCOS404_CHANNEL_22 

Channel 22

eCOS404_CHANNEL_23 

Channel 23

eCOS404_CHANNEL_24 

Channel 24

Function Documentation

◆ Cos404_GetActiveDataType()

uint16_t Cos404_GetActiveDataType ( void )

Get the active data type for CiA 404 process and field values.

Returns
One of the following values from CoDT_e:

Returns the active data type of the CiA 404 module. Only the three types listed above are supported; the active type is set via Cos404_SetActiveDataType() and controls which object indices are used for AI/AO process and field values (e.g. 7130h for int16_t, 9130h for int32_t, or 6130h for float).

◆ Cos404_SetActiveDataType()

uint8_t Cos404_SetActiveDataType ( uint16_t uwDataTypeV)

Set the active data type for CiA 404 process and field values.

Parameters
[in]uwDataTypeVValue from CoDT_e that corresponds to data type
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error

This function is used to setup the active data type of the CiA 404 profile. The supported values are:

  • eCO_DT_INTEGER16 : 3
  • eCO_DT_INTEGER32 : 4
  • eCO_DT_REAL32 : 8

This parameter has impact on data elements for process and field values of CiA 404 AI and AO.