Echelon NodeBuilder FX User Manual

Page 74

Advertising
background image

60

NodeBuilder Quick-Start Exercise

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 NB FX Example Device device template in the Project pane, then click Build on

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

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

the shortcut menu to open the LonMaker 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 5000 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 a L

ON

W

ORKS

network.

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

Advertising