CANopen Slave Documentation
Version 6.16.04
Loading...
Searching...
No Matches
cos404ao.h File Reference

Detailed Description

This module implements the variables and callback functions for the object dictionary from CiA 404 (analog outputs). The module adds the following objects to the object dictionary:

Index Description Function / Variable Configuration Symbol
6300h AO output PV (float) Cos404_AO_SetPV_Real32() COS_DS404_DT_FLOAT
6301h AO physical unit PV - -
6302h AO decimal digits PV - -
6310h AO output type Cos404_AO_SetSignalType() -
6324h AO output offset (float) COS_DS404_DT_FLOAT
6325h AO autozero - -
6326h AO scaling factor - -
6327h AO scaling offset - -
6340h AO fault mode Cos404_AO_Error() -
6342h AO fault PV (float) Cos404_AO_SetFault_Real32() COS_DS404_DT_FLOAT
6348h AO span start (float) - COS_DS404_DT_FLOAT
6349h AO span end (float) - COS_DS404_DT_FLOAT
7300h AO output PV (int16_t) Cos404_AO_SetPV_Int16() COS_DS404_DT_INT16
7324h AO output offset (int16_t) COS_DS404_DT_INT16
7330h AO output FV (int16_t) -
7342h AO fault PV (int16_t) Cos404_AO_SetFault_Int16() COS_DS404_DT_INT16
7348h AO span start (int16_t) - COS_DS404_DT_INT16
7349h AO span end (int16_t) - COS_DS404_DT_INT16
9300h AO output PV (int32_t) Cos404_AO_SetPV_Int32() COS_DS404_DT_INT32
9324h AO output offset (int32_t) COS_DS404_DT_INT32
9342h AO fault PV (int32_t) Cos404_AO_SetFault_Int32() COS_DS404_DT_INT32
9348h AO span start (int32_t) - COS_DS404_DT_INT32
9349h AO span end (int32_t) - COS_DS404_DT_INT32
+ Include dependency graph for cos404ao.h:

Functions

void Cos404_AO_Error (uint8_t ubEnableV)
 
uint16_t Cos404_AO_GetSignalType (uint8_t ubChannelV)
 
void Cos404_AO_Process (uint8_t ubChannelV)
 
void Cos404_AO_RcvPdoPV_Int16 (uint32_t ulMapEntryV)
 
void Cos404_AO_RcvPdoPV_Int32 (uint32_t ulMapEntryV)
 
void Cos404_AO_RcvPdoPV_Real32 (uint32_t ulMapEntryV)
 
uint8_t Cos404_AO_SetFault_Int16 (uint8_t ubChannelV, int16_t swValueV)
 
uint8_t Cos404_AO_SetFault_Int32 (uint8_t ubChannelV, int32_t slValueV)
 
uint8_t Cos404_AO_SetFault_Real32 (uint8_t ubChannelV, float ftValueV)
 
uint8_t Cos404_AO_SetPV_Int16 (uint8_t ubChannelV, int16_t swValueV)
 
uint8_t Cos404_AO_SetPV_Int32 (uint8_t ubChannelV, int32_t slValueV)
 
uint8_t Cos404_AO_SetPV_Real32 (uint8_t ubChannelV, float ftValueV)
 
uint8_t Cos404_AO_SetSignalType (uint8_t ubChannelV, uint16_t uwSignalTypeV)
 
float McDacGetGain (uint8_t ubChannelV, uint16_t uwSignalType)
 
float McDacGetOffset (uint8_t ubChannelV, uint16_t uwSignalType)
 
void McDacSetFV_Int16 (uint8_t ubChannelV, int16_t swValueV)
 

Enumeration Type Documentation

◆ Cos404_AO_SignalType_e

Enumerator
eCOS404_AO_ST_NOT_DEFINED 

not defined type

eCOS404_AO_ST_VOLT 

Voltage

eCOS404_AO_ST_VOLT_10V_BIP 

10 V, Bipolar

eCOS404_AO_ST_CURR 

Current

eCOS404_AO_ST_CURR_4_20mA 

4 .. 20 mA, Current

eCOS404_AO_ST_CURR_0_20mA 

20mA, Bipolar

eCOS404_AO_ST_FREQUENCY 

Frequency

eCOS404_AO_ST_PWM 

PWM

Function Documentation

◆ Cos404_AO_Error()

void Cos404_AO_Error ( uint8_t  ubEnableV)
Parameters
[in]ubEnableVset / reset error condition
See also
Cos404_AO_SetFault_Int16()

This function sets / resets the analog output module error condition. Passing a 0 to ubEnableV resets the error condition, passing a 1 to ubEnableV sets the error condition. If the error condition is set, the output is set according to the value of object 6340h.

◆ Cos404_AO_GetSignalType()

uint16_t Cos404_AO_GetSignalType ( uint8_t  ubChannelV)
Parameters
[in]ubChannelVAnalog output channel
Returns
AO signal type provided by enumeration Cos404_AO_SignalType_e

The function returns the signal type value for the DAC channel defined by ubChannelV.

◆ Cos404_AO_Process()

void Cos404_AO_Process ( uint8_t  ubChannelV)
Parameters
[in]ubChannelVAnalog output channel
Note
This function shall be called after the COS 404 module has initialized by Cos404_AO_ParmInit().

This function is responsible to process the selected analog output channel defined by ubChannelV after new process values have been set by Cos404_AO_SetPV_Int16(). As a result, this function will call McDacSetFV_Int16().

◆ Cos404_AO_RcvPdoPV_Int16()

void Cos404_AO_RcvPdoPV_Int16 ( uint32_t  ulMapEntryV)
Parameters
[in]ulMapEntryVMapping entry

Profile specific RPDO mapping handler for objects with a data type of int16_t. This handler is called if object 7300:xxh is mapped into a RPDO. Please refer to RPDO mapping example for a detailed description.

◆ Cos404_AO_RcvPdoPV_Int32()

void Cos404_AO_RcvPdoPV_Int32 ( uint32_t  ulMapEntryV)
Parameters
[in]ulMapEntryVMapping entry

Profile specific RPDO mapping handler for objects with a data type of int32_t. This handler is called if object 9300:xxh is mapped into a RPDO. Please refer to RPDO mapping example for a detailed description.

◆ Cos404_AO_RcvPdoPV_Real32()

void Cos404_AO_RcvPdoPV_Real32 ( uint32_t  ulMapEntryV)
Parameters
[in]ulMapEntryVMapping entry

Profile specific RPDO mapping handler for objects with a data type of float. This handler is called if object 6300:xxh is mapped into a RPDO. Please refer to RPDO mapping example for a detailed description.

◆ Cos404_AO_SetFault_Int16()

uint8_t Cos404_AO_SetFault_Int16 ( uint8_t  ubChannelV,
int16_t  swValueV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]swValueVAnalog output fault value
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error
See also
Cos404_AO_SetFault_Int32(), Cos404_AO_SetFault_Real32()
Note
An active scaling of process values has no influence on setting the fault value.

This function set the fault value swValueV for the selected analog output channel defined by ubChannelV. The fault value can be read/written via object 7342h.

◆ Cos404_AO_SetFault_Int32()

uint8_t Cos404_AO_SetFault_Int32 ( uint8_t  ubChannelV,
int32_t  slValueV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]slValueVAnalog output fault value
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error
See also
Cos404_AO_SetFault_Int16(), Cos404_AO_SetFault_Real32()
Note
An active scaling of process values has no influence on setting the fault value.

This function set the fault value slValueV for the selected analog output channel defined by ubChannelV. The fault value can be read/written via object 9342h.

◆ Cos404_AO_SetFault_Real32()

uint8_t Cos404_AO_SetFault_Real32 ( uint8_t  ubChannelV,
float  ftValueV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]ftValueVAnalog output fault value
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error
See also
Cos404_AO_SetFault_Int16(), Cos404_AO_SetFault_Int32()
Note
An active scaling of process values has no influence on setting the fault value.

This function set the fault value slValueV for the selected analog output channel defined by ubChannelV. The fault value can be read/written via object 6342h.

◆ Cos404_AO_SetPV_Int16()

uint8_t Cos404_AO_SetPV_Int16 ( uint8_t  ubChannelV,
int16_t  swValueV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]swValueVAnalog output process value
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error
See also
Cos404_AO_SetPV_Int32(), Cos404_AO_SetPV_Real32()

This function set the process value swValueV for the selected analog output channel defined by ubChannelV. The process value can be read/written via object 7300h.

◆ Cos404_AO_SetPV_Int32()

uint8_t Cos404_AO_SetPV_Int32 ( uint8_t  ubChannelV,
int32_t  slValueV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]slValueVAnalog output process value
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error
See also
Cos404_AO_SetPV_Int16(), Cos404_AO_SetPV_Real32()

This function set the process value slValueV for the selected analog output channel defined by ubChannelV. The process value can be read/written via object 9300h.

◆ Cos404_AO_SetPV_Real32()

uint8_t Cos404_AO_SetPV_Real32 ( uint8_t  ubChannelV,
float  ftValueV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]ftValueVAnalog output process value
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error
See also
Cos404_AO_SetPV_Int16(), Cos404_AO_SetPV_Int32()

This function set the process value ftValueV for the selected analog output channel defined by ubChannelV. The process value can be read/written via object 6300h.

◆ Cos404_AO_SetSignalType()

uint8_t Cos404_AO_SetSignalType ( uint8_t  ubChannelV,
uint16_t  uwSignalTypeV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]uwSignalTypeVAnalog output signal type defined by Cia404_AO_Type_e
Returns
eCosSdo_WRITE_OK on success or any other value from CosSdo_e in case of an error
See also
Cos404_AO_SetPV_Int16(), Cos404_AO_SetPV_Int32()

This function configures the analog output signal type uwSignalTypeV for the selected analog output channel defined by ubChannelV.

◆ McDacGetGain()

float McDacGetGain ( uint8_t  ubChannelV,
uint16_t  uwSignalType 
)
Parameters
[in]ubChannelVAnalog output channel
[in]uwSignalTypeAO signal type provided by enumeration Cia404_AO_Type_e
Returns
gain value

The function returns the calibration gain value for the DAC channel defined by ubChannelV. The gain value might be different depending on the analog output signal type, which is defined be the parameter uwSignalType.

This function has to be implemented by the user, it depends on the target hardware.

◆ McDacGetOffset()

float McDacGetOffset ( uint8_t  ubChannelV,
uint16_t  uwSignalType 
)
Parameters
[in]ubChannelVAnalog output channel
[in]uwSignalTypeAO signal type provided by enumeration Cia404_AO_Type_e
Returns
offset value

The function returns the calibration offset value for the DAC channel defined by ubChannelV. The offset value might be different depending on the analog output signal type, which is defined be the parameter uwSignalType.

This function has to be implemented by the user, it depends on the target hardware.

◆ McDacSetFV_Int16()

void McDacSetFV_Int16 ( uint8_t  ubChannelV,
int16_t  swValueV 
)
Parameters
[in]ubChannelVAnalog output channel
[in]swValueV16 Bit field value
Note
Adopt this function to the application. An example function implementation is located inside the file cos404_app_ao.c.

This function is called by the protocol stack in order to set the field value of the DAC.