Initial value updates for input network variables, Ge 62 d – Echelon Neuron C User Manual

Page 74

Advertising
background image

62

How Devices Communicate Using Network Variables

Initial Value Updates for Input Network Variables

Many applications react not only to physical inputs received through I/O models

and peripheral hardware, but also respond to input network variable values. For
those devices, power-up (and post-reset) behavior must be carefully considered.
Example: A simple room temperature controller might accept a temperature

sensor’s current reading through an input network variable, and might compute
and output a control value that drives the valve:

network input SNVT_temp nviCurrent;
network output SNVT_volt nvoValve;

when(nv_update_occurs(nviCurrent)) {
nvoValve = control_algorithm(nviCurrent);
}

When this device powers up, it simply waits for the current temperature input

value to change. After a new value is received, the device updates the
nvoValveDriver output network variable, and the valve moves to a new position.
For many devices, this model is sufficient. The temperature sensor’s reading

changes over time, and most sensors also implement periodic heartbeats at a
configurable interval. When the heartbeat interval expires, or the actual

temperature reading changes over the the threshold of a hysteresis, the sensor

updates its output network variable, the room temperature controller takes
appropriate action, and the heating valve is adjusted accordingly. The devices in

this network respond to external events and act as soon as necessary.

Some devices, however, need to produce up-to-date control values sooner after

power-up or reset, or need to ensure a consistent and up-to-date set of input

network variables. Consider, for example, an enhanced room temperature
controller. This new controller also accepts a temperature setpoint value through

an input network variable.
Example:

network input SNVT_temp nviCurrent;
network input SNVT_temp nviSetpoint;
network output SNVT_volt nvoValve;

when(nv_update_occurs(nviSetpoint))
when(nv_update_occurs(nviCurrent)) {
nvoValve = control_algorithm(nviCurrent, nviSetpoint);
}

However, this example is flawed, because it cannot successfully compute a new

control value unless both input network variables have been updated. There are
several ways to solve this problem:

• Track the last-known good value using a suitable type of non-volatile

memory or a battery back-up device design.

Most low-cost non-volatile memory parts, such as EEPROM and flash
memory, have a limited number of write cycles. Therefore, this approach

only works with infrequently updated input network variables, and also

assumes that the actual setpoint and current temperature do not change
much compared to that last-known good value.

Advertising