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:
|
| 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) |
| |
◆ 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
|
◆ Cos404_AO_Error()
| void Cos404_AO_Error |
( |
uint8_t | ubEnableV | ) |
|
- Parameters
-
| [in] | ubEnableV | set / 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] | ubChannelV | Analog 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] | ubChannelV | Analog 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] | ulMapEntryV | Mapping 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] | ulMapEntryV | Mapping 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] | ulMapEntryV | Mapping 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] | ubChannelV | Analog output channel |
| [in] | swValueV | Analog 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] | ubChannelV | Analog output channel |
| [in] | slValueV | Analog 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] | ubChannelV | Analog output channel |
| [in] | ftValueV | Analog 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] | ubChannelV | Analog output channel |
| [in] | swValueV | Analog 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] | ubChannelV | Analog output channel |
| [in] | slValueV | Analog 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] | ubChannelV | Analog output channel |
| [in] | ftValueV | Analog 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] | ubChannelV | Analog output channel |
| [in] | uwSignalTypeV | Analog 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] | ubChannelV | Analog output channel |
| [in] | uwSignalType | AO 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] | ubChannelV | Analog output channel |
| [in] | uwSignalType | AO 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] | ubChannelV | Analog output channel |
| [in] | swValueV | 16 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.