Step 3: adding digital i/o – Echelon NodeBuilder FX/PL Examples User Manual
Page 24
16
Using the NodeBuilder FX/PL Example
Now that you have added the device to the LonMaker drawing and loaded the device with its
application, the NodeBuilder Project Manager and the LonMaker tool will automatically load new
builds of the application into the device.
9. The Gizmo display shows an “Echelon NEURON C Example Application” message after loading
and commissioning has been completed.
10. Use the LonMaker tool to test the device. For example, you can add a Node Object functional
block and confirm that it has the appropriate network variables and configuration properties.
Step 3: Adding Digital I/O
You can add digital input and output functionality to your device. In this step, you will add a pair of
digital actuators and sensor functional blocks to the device, and connect them using the LonMaker
tool. Once you complete this step, you can use the buttons on the Gizmo 4 to turn on the LEDs.
After completing this step, you will have a fully functioning L
ON
W
ORKS
device. This step and the
functional blocks added in this step are kept simple in order to focus on the essential steps. More
sophisticated examples follow in subsequent steps.
1. Click the NodeBuilder tool Taskbar button in the Taskbar to return to the NodeBuilder Project
Manager.
2. Right-click
the
NcExample device template and select Code Wizard from the shortcut menu.
The Code Wizard opens.
3. Right-click
the
Functional Blocks folder and select Add Functional Block from the shortcut
menu. The Add Functional Block dialog opens.
4. Add an array of two SFPTopenLoopSensor functional blocks to the device. Name the functional
blocks DigitalInput. These two functional blocks will be used to control the two push-buttons on
the Gizmo 4.
5. Open
the
DigitalInput functional block’s Mandatory NVs folder, right-click the network
variable contained in the folder, and select Properties from the shortcut menu. The NV
Properties dialog opens.
6. Rename the network variables to nvoDigitalInput, and set the type to SNVT_switch. The
network variable is implemented as an array of size 2. These network variables will be used to
send the value of the digital input on the network (for example, whether the button is being
pressed).
7. Repeat steps 3 and 4, but add an array of two SFPTopenLoopActuator functional blocks, and
name them DigitalOutput. These functional blocks will be used to control the two LEDs on the
Gizmo 4.
8. Repeat steps 5 and 6 but rename the DigitalOutput functional block’s mandatory network
variable to nviDigitalOutput, and change the type to SNVT_switch. These two network
variables will be used to receive values from the network to drive the LEDs (for example, turn
them on and off).
9. Right-click
the
DigitalOutput functional block’s Optional CPs folder and select Implement
Optional CP from the shortcut menu. The Implement Optional CP dialog opens.
10. Select nciDefault from the FPT Member Name dialog to implement this configuration property.
Name the configuration property cpDigitalDefault. A single configuration property will be
created for each member of the functional block array (the Static CP option is used to create a
single configuration property that applies to all functional blocks in the array; this option is
discussed in Step 4: Implementing Analog Inputs).
This configuration property will be used to control the initial state of the physical output lines after
power-up or reset. Since it is applied to an actuator, the type of this configuration property is the