Tradeoffs, Polling network variables, 56 describes h – Echelon Neuron C User Manual

Page 68

Advertising
background image

56

How Devices Communicate Using Network Variables

2

Check for the failure and the success events

(nv_update_fails, nv_update_succeeds).

3

Check for the update completion event (nv_update_completes).

For example, the following is an acceptable strategy within a program containing

three network variables:

• Network Variable 1: Program checks for no completion events.
• Network Variable 2: Program checks for failure and success.
• Network Variable 3: Program checks for update completion only.

Note: If you choose to use comprehensive completion event testing features (with
network variables), all completion code processing for network variables must be

comprehensive completion event testing. This restriction does

not

mean that

events must be checked for all network variables; it only means that a single
program can use

either

partial

or

comprehensive completion event testing, but

cannot intermix both techniques. The Neuron C compiler detects use of the
comprehensive event feature on a

per-program

basis.

Tradeoffs

Using comprehensive completion event testing for processing network variable

completion events within a program requires more code space and is less efficient
than using partial completion event testing. If you choose a comprehensive

completion event testing feature, such as checking nv_update_completes, you are

limited to comprehensive completion event testing features for whichever
network variable’s events in which you are interested. For example, within a

program using comprehensive completion event testing, you cannot simply check

for nv_update_fails, because that feature applies only to partial completion event
testing.

Polling Network Variables

As described earlier in this chapter, a network variable update is normally

initiated when a device assigns a value to an output network variable. Another
device can request that the first device send its latest value for a network

variable. The process of requesting current network variable values from a

device is called

polling

.

A device’s program can poll any input network variables at any time, including

initial power-up and when transitioning from offline to online. Polling on initial
power-up can cause network congestion if many devices are powered-up at the

same time, and they all do power-up polling. See

Initial Value Updates for Input

Network Variables

on page 62 for more information about polling during power-

up and reset processing.
Polling an input network variable from your program requires the network

binder to apply a different scheme when connecting output network variables
between writer and reader devices, requiring additional address table entries to

be used on the reader device. If you add polling to an existing application that

did not previously use polling, you must create a new device interface (XIF) file
for the device, and import the new device interface file into any network tools

that used the previous version.

Advertising