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

Detailed Description

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

Index Description Function / Variable Configuration Symbol
6411h Write analog output 16-bit Cos401_Idx6411() COS_DS401_AO
6443h Analog output error mode Cos401_Idx6443() COS_DS401_AO
6444h Analog output error value integer Cos401_Idx6444() COS_DS401_AO
6450h Analog output SI unit Cos401_Idx6450() COS_DS401_AO
+ Include dependency graph for cos401ao.h:

Functions

void Cos401_AO_Error (uint8_t ubEnableV)
 
void Cos401_AO_Set (uint8_t ubChannelV, uint16_t uwValueV)
 

Function Documentation

◆ Cos401_AO_Error()

void Cos401_AO_Error ( uint8_t  ubEnableV)
Parameters
[in]ubEnableVset / reset error condition

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 outputs are set according to the objects 6443h and 6444h.

◆ Cos401_AO_Set()

void Cos401_AO_Set ( uint8_t  ubChannelV,
uint16_t  uwValueV 
)
Parameters
[in]ubChannelVoutput channel number
[in]uwValueVanalog output write value

This function sets the value uwValueV to the analog output. The parameter ubChannelV denotes the channel number. The first channel starts at index 0 (i.e. sub-index - 1 of object 6411h).

This function is called by the protocol stack for access to a specific analog output.

Example

uint8_t Cos401_AO_Set(uint8_t ubChannelV, uint16_t uwValueV)
{
//------------------------------------------------------------------------------
// set analog output 1 on target hardware here
//
if (ubChannelV == 0)
{
SetMyDacOnHardware(uwValueV);
}
return 0;
}
void Cos401_AO_Set(uint8_t ubChannelV, uint16_t uwValueV)