Step 4: developing the device application – Echelon IzoT NodeBuilder User Manual

Page 52

Advertising
background image

5. Double-click the IzoT NB Example Device.nc file in the Project pane to open the main Neuron C

file for this new device template.

6. Open the Switch.h and LED.h header files and view the functional block and configuration

property declarations.

7. Open the Switch.nc and LED.nc Neuron C files and view the default implementation of the

director function (named SwitchDirector or equivalent).

The director function is a mechanism that allows the developer to easily dispatch events to all the
functional blocks in a device with a single function call. For instance, during reset, the when
(reset)
clause can dispatch the reset event for each functional block in the device when it is done
initializing the “global” components in the device. This is done using the following line of code:

executeOnEachFblock (FBC_WHEN_RESET);

8. Proceed to the next section to implement your device’s functionality by editing your Neuron C

code.

For more information on defining device interfaces and generating Neuron C code for them, see
Chapter 6, Defining Device Interfaces and Creating their Neuron C Application Framework.

Step 4: Developing the Device Application

The Neuron C source code generated by the NodeBuilder Code Wizard implements your device’s
interface. The Code Wizard also generates a skeleton application framework, including the most
common tasks performed by the Node Object. When developing the device application, you will
typically concentrate on writing the algorithms that implement your device’s functionality. To do this,
you will edit the code generated by the Code Wizard and program any required interaction between the
device application and the I/O devices on your device hardware.

In this step, you will add Neuron C I/O declarations to the Switch.h, and LED.h header files, and then
implement your desired I/O functionality in the Switch.nc and LED.nc Neuron C files.

Note: The I/O object declarations used for the FT 6000 EVK hardware (FT 6000 EVBs) and the
NodeBuilder FX/PL hardware (LTM-10A Platform with Gizmo 4 I/O Board) are different. Therefore,

38

IzoT NodeBuilder Quick-Start Exercise

Advertising