CANopen Slave Protocol Stack 
Version 7.08.00
Loading...
Searching...
No Matches
Cos404_AI_Config_s Struct Reference

Detailed Description

This struct holds parameters that are used at initial startup of the CiA 404 AI software module. The values within this structure are provided to CiA 404 AI software module using the Cos404_AI_DefaultConfiguration() function. An example initialization for Pt100 is shown in the file cos404_app_ai.c.

const Cos404_AI_Config_ts tsPt100_ConfigC =
{
//---------------------------------------------------------------------------------------------------
// index 6102<sub>h</sub>: number of decimal digits for field value (FV), in case active data
// type is `int16_t`
//
.ubIdx6102_DecimalDigitsInt16FV = 1,
//---------------------------------------------------------------------------------------------------
// index 6102<sub>h</sub>: number of decimal digits for field value (FV), in case active data
// type is `int32_t`
//
.ubIdx6102_DecimalDigitsInt32FV = 3,
//---------------------------------------------------------------------------------------------------
// index 6132<sub>h</sub>: number of decimal digits for process value (PV), in case active data
// type is `int16_t`
//
.ubIdx6132_DecimalDigitsInt16PV = 1,
//---------------------------------------------------------------------------------------------------
// index 6132<sub>h</sub>: number of decimal digits for process value (PV), in case active data
// type is `int32_t`
//
.ubIdx6132_DecimalDigitsInt32PV = 3,
//---------------------------------------------------------------------------------------------------
// default sensor type is Pt100
//
.uwIdx6110_DefaultSensorType = eCOS404_AI_ST_PT100,
//---------------------------------------------------------------------------------------------------
// default operating mode = on
//
.ubIdx6112_DefaultOpMode = 1,
//---------------------------------------------------------------------------------------------------
// physical unit of field value: Ohm
//
//---------------------------------------------------------------------------------------------------
// physical unit of process value: degree Celsius
//
//---------------------------------------------------------------------------------------------------
// span start: -200.0 degree Celsius
//
.slIdx9148_SpanStart = -200000,
//---------------------------------------------------------------------------------------------------
// span end: +850.0 degree Celsius
//
.slIdx9149_SpanEnd = 850000,
//---------------------------------------------------------------------------------------------------
// lower error limit: -201.0 degree Celsius
//
.slIdx914A_LowerErrorLimit = -201000,
//---------------------------------------------------------------------------------------------------
// upper error limit: +851.0 degree Celsius
//
.slIdx914B_UpperErrorLimit = 851000,
//---------------------------------------------------------------------------------------------------
// hysteresis for error signalling: 0.5 degree Celsius
//
.slIdx914C_Hysteresis = 500,
//---------------------------------------------------------------------------------------------------
// configure event at change of sensor type
//
.pfnSensorTypeEvent = Cos404_AI_AppEventSensorType,
//---------------------------------------------------------------------------------------------------
// configure event for operating mode change - not used for PT100
//
.pfnOperatingModeEvent = NULL,
//---------------------------------------------------------------------------------------------------
// configure event for linearization
//
.pfnLinearisationEvent = Cos404_AI_AppEventLinearization,
//---------------------------------------------------------------------------------------------------
// no manufacturer-specific filter - use built-in filter types only
//
.pfnFilterEvent = NULL,
.pfnFilterUpdateEvent = NULL,
//---------------------------------------------------------------------------------------------------
// no status-change notification required - application polls object 6150h if needed
//
.pfnStatusUpdateEvent = NULL
};
Collaboration diagram for Cos404_AI_Config_s:

Data Fields

uint8_t ubIdx6102_DecimalDigitsInt16FV
uint8_t ubIdx6102_DecimalDigitsInt32FV
uint8_t ubIdx6132_DecimalDigitsInt16PV
uint8_t ubIdx6132_DecimalDigitsInt32PV
uint16_t uwIdx6110_DefaultSensorType
uint8_t ubIdx6112_DefaultOpMode
uint32_t ulIdx6101_PhysicalUnitFV
uint32_t ulIdx6131_PhysicalUnitPV
int32_t slIdx9148_SpanStart
int32_t slIdx9149_SpanEnd
int32_t slIdx914A_LowerErrorLimit
int32_t slIdx914B_UpperErrorLimit
int32_t slIdx914C_Hysteresis
Cos404AiSensorType_fn pfnSensorTypeEvent
Cos404AiOpMode_fn pfnOperatingModeEvent
Cos404AiLinearisation_fn pfnLinearisationEvent
Cos404AiFilter_fn pfnFilterEvent
Cos404AiFilterUpdate_fn pfnFilterUpdateEvent
Cos404AiStatusUpdate_fn pfnStatusUpdateEvent

Field Documentation

◆ pfnFilterEvent

Cos404AiFilter_fn Cos404_AI_Config_s::pfnFilterEvent

Manufacturer-specific filter callback (type Cos404AiFilter_fn). When set, this function is called by Cos404_AI_Process() in place of the built-in filter for filter types eCOS404_AI_FILTER_TYPE_MANUFACTURER_01 to eCOS404_AI_FILTER_TYPE_MANUFACTURER_04. Leave as NULL to use only the built-in filter types.

◆ pfnFilterUpdateEvent

Cos404AiFilterUpdate_fn Cos404_AI_Config_s::pfnFilterUpdateEvent

Filter-update event handler (type Cos404AiFilterUpdate_fn). Called when the filter type (object 61A0h) or filter constant (object 61A1h) changes via SDO/USDO write, and also during initialisation. Use this to re-initialize filter state when parameters change. Leave as NULL if no notification is required.

◆ pfnLinearisationEvent

Cos404AiLinearisation_fn Cos404_AI_Config_s::pfnLinearisationEvent

This processing callback function is called by the 404 AI software module upon set of new field value using Cos404_AI_SetFieldValue() function.

By defining this function it is possible to use manufacturer specific scaling of the field value to the temperature of, for example, a thermocouple sensor.

◆ pfnOperatingModeEvent

Cos404AiOpMode_fn Cos404_AI_Config_s::pfnOperatingModeEvent
Parameters
[in]ubChannelVAnalog input channel

The parameter ubChannelV defines the channel number, the first channel starts at eCOS404_CHANNEL_1.

This event handler is called by the 404 AI software module upon change of operating mode. The application can check the current operating mode by calling Cos404_AI_GetOperatingMode().

Note
In case this function is registered, it is called during initialisation and upon write access to the object at index 6112h.

◆ pfnSensorTypeEvent

Cos404AiSensorType_fn Cos404_AI_Config_s::pfnSensorTypeEvent

This value holds actual ADC sample rate given in [us].

Parameters
[in]ubChannelVAnalog input channel
[in]pvdDataVPointer to sensor type value defined by Cos404_AI_SensorType_e
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error

The parameter ubChannelV defines the channel number, the first channel starts at eCOS404_CHANNEL_1. The data contents of pointer pvdDataV should be defined by the Cos404_AI_SensorType_e enumeration. It is the task of the application to check the value and evaluate whether the corresponding sensor type is supported or not. In case the sensor type is accepted by the application the function shall return eCosSdo_WRITE_OK.

Note
In case this function is registered, it is called during initialisation and upon write access to the object at index 6110h.

◆ pfnStatusUpdateEvent

Cos404AiStatusUpdate_fn Cos404_AI_Config_s::pfnStatusUpdateEvent

Status-change event handler (type Cos404AiStatusUpdate_fn). Called by Cos404_AI_Process() whenever the channel status (object 6150h) transitions — e.g. from eCOS404_AI_STATUS_OK to eCOS404_AI_STATUS_POS_OVERLOAD. Leave as NULL if polling the status object is sufficient.

◆ slIdx9148_SpanStart

int32_t Cos404_AI_Config_s::slIdx9148_SpanStart

This variable defines the span start value of the analog input channel (object at index 9148h).

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ slIdx9149_SpanEnd

int32_t Cos404_AI_Config_s::slIdx9149_SpanEnd

This variable defines the span end value of the analog input channel (object at index 9149h).

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ slIdx914A_LowerErrorLimit

int32_t Cos404_AI_Config_s::slIdx914A_LowerErrorLimit

This variable defines the lower error limit of the analog input channel (object at index 914Ah).

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ slIdx914B_UpperErrorLimit

int32_t Cos404_AI_Config_s::slIdx914B_UpperErrorLimit

This variable defines the upper error limit of the analog input channel (object at index 914Bh).

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ slIdx914C_Hysteresis

int32_t Cos404_AI_Config_s::slIdx914C_Hysteresis

This variable defines the hysteresis for detection of span limits and error limits of the analog input channel (object at index 914Ch).

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ ubIdx6102_DecimalDigitsInt16FV

uint8_t Cos404_AI_Config_s::ubIdx6102_DecimalDigitsInt16FV

This variable defines the number of decimal digits of the field value FV (object at index 6102h) in case data type int16_t is selected.

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ ubIdx6102_DecimalDigitsInt32FV

uint8_t Cos404_AI_Config_s::ubIdx6102_DecimalDigitsInt32FV

This variable defines the number of decimal digits of the field value FV (object at index 6102h) in case data type int32_t is selected.

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ ubIdx6112_DefaultOpMode

uint8_t Cos404_AI_Config_s::ubIdx6112_DefaultOpMode

This variable defines the operating mode of the analog input channel.

The default operating mode is provided once initially by the application during configuration (refer to Cos404_AI_DefaultConfiguration()) and can be later set via SDO / USDO write access to the object at index 6112h.

◆ ubIdx6132_DecimalDigitsInt16PV

uint8_t Cos404_AI_Config_s::ubIdx6132_DecimalDigitsInt16PV

This variable defines the number of decimal digits of the process value PV (object at index 6132h) in case data type int16_t is selected.

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ ubIdx6132_DecimalDigitsInt32PV

uint8_t Cos404_AI_Config_s::ubIdx6132_DecimalDigitsInt32PV

This variable defines the number of decimal digits of the process value PV (object at index 6132h) in case data type int32_t is selected.

The value is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ ulIdx6101_PhysicalUnitFV

uint32_t Cos404_AI_Config_s::ulIdx6101_PhysicalUnitFV

This variable defines the physical unit of the field value FV (object at index 6101h).

The value is encoded according to CiA 890 and is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ ulIdx6131_PhysicalUnitPV

uint32_t Cos404_AI_Config_s::ulIdx6131_PhysicalUnitPV

This variable defines the physical unit of the process value PV (object at index 6131h).

The value is encoded according to CiA 890 and is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration().

◆ uwIdx6110_DefaultSensorType

uint16_t Cos404_AI_Config_s::uwIdx6110_DefaultSensorType

This variable defines the sensor type of the analog input channel (object at index 6110h).

The default sensor type is provided once initially by the application within the configuration at the call of Cos404_AI_DefaultConfiguration() and can be later set via the object at index 6110h.

The object at index 6110h is only writable if a function handler has been provided for the element Cos404AiSensorType_fn.