Preemption_mode( ) function, Syntax, Example – Echelon Neuron C User Manual

Page 141: Propagate( ) built-in function

Advertising
background image

Neuron C Reference Guide

121

if (power_up())
initialize_hardware();
else {
// hardware already initialized
...
}
}

preemption_mode( )

Function

The preemption_mode( ) function returns a TRUE if the application is currently

running in preemption mode, or FALSE if the application is not in preemption

mode. Preemption mode is discussed in Chapter 3,

How Devices Communicate

Using Network Variables,

of the

Neuron C Programmer's Guide

.

Syntax

#include <status.h>

boolean preemption_mode (void);

Example

void f(void)
{

if (preemption_mode()) {

// Take some appropriate action

...
}
}

propagate( )

Built-in Function

The propagate( ) built-in function allows a device’s application program to
request that the latest value for one or more of its output network variables be

sent out over the network. Any bound (that is, connected) output network

variable can be propagated at any time. Propagating an unbound output
network variable has no effect on the network, allowing the application to run the

exact same code, regardless of whether the network variable is unbound or is

bound to many network variables.

If an array name is used, then each element of the array is propagated. An

individual element can be propagated by using an array index.
Input network variables cannot be propagated, and calls to propagate( ) for input
network variables have no effect.
This function allows variables to be sent out even if they are declared const, and
are thus in read-only memory (normally a network variable’s value is sent over

the network only when is the application writes a new value to the network

variable). Also, it permits updating a network variable through a pointer, and
then causing the variable to be propagated separately.
Polled output network variables can be propagated with the propagate( )

function. However, if an output network variable is declared as polled, but is also
affected by the propagate( ) function, the polled attribute does not appear in the

Advertising