#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 |
|
a user-defined function which captures temperatures of two temp-sensors |
|
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) ) |
|
|
|
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) } |
|
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( ); } |
|
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( ); } |
|
|
|
|
|
|
|
|
|
|
|
|