Model file – Echelon FTXL User Manual

Page 226

Advertising
background image

214

Example FTXL Applications

void myEventReady(void) {
/* Signal application task so that it can process the

* event. */

OsalSetEvent(eventReadyHandle);

}

Model File

The model file, Dynamic Interface Example.nc, defines the L

ON

W

ORKS

interface

for the example FTXL device.

The model file defines two functional blocks: NodeObject and VoltActuator. The

NodeObject functional block allows a network management tool to enable or

disable the functional blocks for the FTXL device. The VoltActuator functional
block defines the interface for the application.
The VoltActuator functional block includes two network variables, nviVolt and

nvoVoltFb. The functionality for these network variables is implemented in the
myNvUpdateOccurred() function described in

Callback Handler Function

on page

213.

The two network variables for the VoltActuator functional block include

references to a configuration network variable (CPNV), nciNvType. This

reference allows the nviVolt and nvoVoltFb network variables to maintain type
changes in non-volatile memory, and thus be preserved across device resets.
The model file does not include definitions for any dynamic network variables.

However, the application supports the addition, modification, and deletion of
dynamic network variables. You use the LonTalk Interface Developer utility to

specify the number of dynamic network variables supported by the application.
The model file is shown below.

#pragma enable_sd_nv_names

network input cp SCPTnvType nciNvType;

network input SNVT_obj_request nviRequest;

network output sync SNVT_obj_status nvoStatus;

fblock SFPTnodeObject {

nviRequest implements nviRequest;

nvoStatus implements nvoStatus;

} NodeObject

external_name("NodeObject");

network input changeable_type SNVT_volt nviVolt
nv_properties
{

global

nciNvType

};

network output changeable_type SNVT_volt bind_info(unackd)
nvoVoltFb
nv_properties
{

global

nciNvType

};

Advertising