Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

app.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <app.h>
#include <def.h>
#include <init.h>
#include <objacces.h>
#include <lifegrd.h>
#include <pdo.h>
#include <nmt.h>
#include <general.h>
#include <timer.h>

Functions

void getTemperatures (void)
void initialisation (void)
void preOperational (void)
void operational (void)
void stopped (void)
void InterruptHandlerHigh ()

Variables

BYTE ledOutput
BYTE temperature1
BYTE temperature2
BYTE * pLedOutput
BYTE * pTemperature1
BYTE * pTemperature2

Function Documentation

void getTemperatures void   
 

a user-defined function which captures temperatures of two temp-sensors

void initialisation void   
 

This function is called automatically by the statemachine, when the microcontroller powers up. after execution of this function the state machine automatically changes into pre-operational state. So don't make loops here (while( getState( ) == INITIALISATION_NODE) )

void InterruptHandlerHigh void   
 

void operational void   
 

The statemachine calles this function, if a NMT message was received from the NMT master that tells this node to change into operational state. in this state the CANopen device sends/receives PDOs and all other message types (but not: Boot-Up Object and LSS Objects) this function must contain a while-loop like this: while( bStateMachineState == OPERATIONAL ) { // because sending of heartbeat must start just after bootup, lets do that... processLifeGuard( ); proccessRxCanMessages( ); // user defined code follows here (or somewhere else in the while-loop) }

void preOperational void   
 

This function is called automatically by the statemachine, when the microcontroller powers up. after execution of the function initialisation the state machine changes into pre-operational state. In this function you have to loop with a while-loop: while( bStateMachineState == PRE_OPERATIONAL ) { // because sending of heartbeat must start just after bootup, lets do that... processLifeGuard( ); proccessRxCanMessages( ); }

void stopped void   
 

This function is called, when a remote node tells this node to stopp this node. in this state, no SDO, no PDO, no SYNC, no Time stamp, no emergency messages are allowed to send/receive --> only NMT, LSS, and (in some cases) Error control Objects can be processed In this function you have to loop with a while-loop: while( bStateMachineState == STOPPED ) { // because sending of heartbeat must start just after bootup, lets do that... processLifeGuard( ); proccessRxCanMessages( ); }


Variable Documentation

BYTE ledOutput
 

BYTE* pLedOutput
 

BYTE * pTemperature1
 

BYTE * pTemperature2
 

BYTE temperature1
 

BYTE temperature2
 


Generated on Wed Dec 25 01:04:57 2002 for CANopen SlaveLib by doxygen1.2.17