Syntax, Example 1 – event for a single network variable, Example 2 – event for a network variable array – Echelon Neuron C User Manual

Page 31

Advertising
background image

Neuron C Reference Guide

11

array, the nv_array_index built-in variable indicates the relative index of the

element to which the event applies. The nv_array_index variable’s type is a short
int.
If a network variable range is used, then the network variable at the beginning of

the range must have a lower global index than the network variable at the end of
the range. Each network variable in the range is checked for failure until the

first such network variable with an event is found. The event occurs for each
network variable in the range that experiences a failure event.
Checking the completion event (nv_update_completes, or nv_update_fails in

combination with nv_update_succeeds) is optional by network variable.

If a program checks for the nv_update_succeeds event, it must check for the

nv_update_fails event as well. The alternative is to check only for

nv_update_completes. A program is also permitted to check only for
nv_update_fails as long as there is no use of nv_update_completes or

nv_update_succeeds for

any

network variable.

Syntax

nv_update_fails [(

network-var

)]

nv_update_fails [(

network-var1

..

network-var2

)]

network-var

A network variable identifier, a network variable array

identifier, or a network variable array element. A range
can be specified with two network variable identifiers or

network variable array elements separated with a range

operator (two consecutive dots). The range is defined by
the indices of the referenced network variables. If the

parameter is omitted, the event is TRUE when any
network variable update fails.

Example 1 – Event for a Single Network
Variable

network output SVNT_abs_humid nvoHumidity;

...
nvoHumidity = 32;
...

when (nv_update_fails(nvoHumidity))
{
...
}

Example 2 – Event for a Network Variable
Array

network output SVNT_abs_humid nvoHumidity[4];

...
nvoHumidity[1] = 32;

Advertising