beautypg.com

Step 4: implementing analog input and output – Echelon NodeBuilder FX/PL Examples User Manual

Page 26

background image

18

Using the NodeBuilder FX/PL Example

// initialize output lines:

GizmoSetLed(0,

DigitalOutput[0]::cpDigitalDefault.state);

GizmoSetLed(1,

DigitalOutput[1]::cpDigitalDefault.state);

setLockedOutBit(uFblockIndex,

FALSE);

}

else if ((TFblock_command)iCommand == FBC_DISABLED)

This code causes LEDs to be set to the value specified in the cpDigitalDefault configuration
property when the device is reset.

16. Build the development target. To do this, right click the Development target, and then click Build

on the shortcut menu. The LonMaker tool automatically reloads the application into the device.

17. Click the LonMaker tool Taskbar button in the Taskbar to return to the LonMaker tool.

18. Drag four functional block shapes to your drawing, one for each of the DigitalOutput and

DigitalInput functional blocks. Select the Create Shapes for all Network Variables check box
for each functional block.

19. Connect each input network variable to the corresponding output network variable. See the

LonMaker User’s Guide for more information on performing these operations. When you are
done, your LonMaker drawing should look something like this:

20. Press the SW1 and SW2 buttons on the Gizmo 4 I/O Board to verify that these now control the

LEDs.

21. Use the LonMaker tool to verify the functional blocks behave as expected.

Step 4: Implementing Analog Input and Output

In this step, you will add a pair of analog input and output functional blocks to the device, and you will
add an implementation-specific configuration property to a functional block.

1. Click the NodeBuilder tool Taskbar button in the Taskbar to return to the NodeBuilder tool.

2. Right-click on the device template and select Code Wizard from the shortcut menu. The Code

Wizard opens.

3. Right-click the device template’s Functional Blocks folder and select Add Functional Block

from the shortcut menu. The Add Functional Block dialog opens.

4. Add an array of two SFPTanalogInput functional blocks. Name the functional block array

AnalogInput.

5. Open

the

AnalogInput functional block’s Mandatory NVs folder, right-click the nvoAnalog

network variable in the folder, and select Properties from the shortcut menu. The NV Properties
dialog opens.

6. Rename the network variable to nvoAnalogInput.

7. Repeat steps 2 and 3, but add an array of two SFPTanalogOutput functional blocks, and name

the array AnalogOutput.