Example 1 – event for a single network variable, Example 2 – event for a network variable array, Example 3 – event for a range of network variables – Echelon Neuron C User Manual

Page 33: Nv_update_succeeds event

Advertising
background image

Neuron C Reference Guide

13

Example 1 – Event for a Single Network
Variable

network input SNVT_switch nviSwitch;

when (nv_update_occurs(nviSwitch))
{
...
}

Example 2 – Event for a Network Variable
Array

network input SNVT_switch nviSwitch[4];

when (nv_update_occurs(nviSwitch))
{
...
}

Example 3 – Event for a Range of Network
Variables

network input SNVT_switch nviSwitch1, nviSwitch2,
nviSwitch3;

when (nv_update_occurs(nviSwitch1 .. nviSwitch3))
{
...
}

nv_update_succeeds

Event

The nv_update_succeeds event evaluates to TRUE once for each output network

variable update that has been successfully sent and once for each poll that
succeeds (see the

Neuron C Programmer’s Guide

for the definition of success).

If an array name is used, then each element of the array is checked for success.

The event occurs once for each element that experiences a success completion
event. An individual element may be checked by using an array index. When

nv_update_succeeds is TRUE for an event qualified by the name of an entire NV
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 to see if a value has
been received. The event occurs once for each network variable in the range that

experiences a success completion event.
Checking the completion event (nv_update_completes, or nv_update_fails in
combination with nv_update_succeeds) is optional by network variable.

Advertising