Echelon IzoT NodeBuilder User Manual

Page 67

Advertising
background image

16. The NodeBuilder debugger has demonstrated that events occur when the button is both pressed

and released. To implement the desired behavior in which an event occurs only when the button is
pressed, change the following lines of code in the Switch.nc file:

nvoSwitch.state = !input_value;
nvoSwitch.value = input_value ? 200u : 0;

to the following:

if (!input_value) {

nvoSwitch.state ^= 1;

nvoSwitch.value = nvoSwitch.state ? 200u : 0;

}

17. Verify that the Load after Build option (

) is set.

18. Right-click the IzoT NB Example Device device template in the Project pane, then click Build on

the shortcut menu. The IzoT NodeBuilder tool rebuilds the IzoT NB Example Device application
and downloads it to all devices using the IzoT NB Example Device device template.

19. Right-click the IzoT NB Example Device device in your IzoT CT drawing, then click Browse on

the shortcut menu to open the IzoT Browser. Verify that the Monitor All button (

) on the

toolbar is enabled.

20. Press the left button at the bottom of your development board (SW1 on the FT 6000 EVB; IO_6

on the Gizmo 4 I/O Board) repeatedly. Observe that the button now acts as a toggle-switch—the
value of the nvoSwitch network variable in the Switch functional block changes when you press
the button, but it no longer changes when you release the button.

21. Proceed to the next section to install and test your device in an IzoT or L

ON

W

ORKS

network.

For more information on debugging Neuron C applications, see Chapter 10, Debugging a Neuron C
Application
.

IzoT NodeBuilder FX User's Guide

53

Advertising