CANopen Slave Protocol Stack 
Version 7.04.00
Loading...
Searching...
No Matches
cos404di.h File Reference

Detailed Description

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

Index Description Function / Variable Configuration Symbol
6000h DI read state 8 input lines Cos404_Idx6000() -
Include dependency graph for cos404di.h:

Functions

uint8_t Cos404_DI_PdoSend (uint8_t ubGroupV)
uint8_t Cos404_DI_Read (uint8_t ubGroupV)
void Cos404_DI_Set (uint8_t ubGroupV, uint8_t ubValueV)

Function Documentation

◆ Cos404_DI_PdoSend()

uint8_t Cos404_DI_PdoSend ( uint8_t ubGroupV)
Parameters
ubGroupVinput group number
Returns
1 if PDO transmission is requested

The functions returns 1 if a PDO transmission is requested, otherwise 0.

◆ Cos404_DI_Read()

uint8_t Cos404_DI_Read ( uint8_t ubGroupV)
Parameters
[in]ubGroupVinput group number
Returns
value of digital input block

This function returns the actual state of a digital input block defined by ubGroupV and sends a PDO if the state has changed. The parameter ubGroupV defines the zero based group number.

◆ Cos404_DI_Set()

void Cos404_DI_Set ( uint8_t ubGroupV,
uint8_t ubValueV )
Parameters
[in]ubGroupVinput group number
[in]ubValueVdigital input value

This function sets the actual value of the input ports. The parameter ubGroupV denotes the group number. The first group of 8 digital inputs starts at index 0 (i.e. sub-index - 1 of object 6000h). This function needs to be called from the application code (e.g. interrupt handler, main loop) in order to setup the value for the digital inputs.

Example

main()
{
uint8_t ubDigitalInputValueT;
....
while(1)
{
//------------------------------------------------
// this is the central main loop, which reads
// the value of the digital inputs
//
ubDigitalInputValueT = MyInputReadFunction()
//--- pass this value to the stack ---------------
Cos404_DI_Set(0, ubDigitalInputValueT);
....
}
}
void Cos404_DI_Set(uint8_t ubGroupV, uint8_t ubValueV)