Functional blocks without configuration properties – Echelon FTXL User Manual

Page 62

Advertising
background image

50

Creating a Model File

file. The API uses this table to access the network variables when the application

runs. In addition, the application can query the data in this table at runtime.

Important: This example is not interoperable because it does not use functional

blocks to define the purpose of these network variables. However, this type of

declaration can define a functioning device for an initial test application.

Functional Blocks without Configuration Properties

The following model file describes a similar meter application as in the previous

example, but implements it using functional blocks to provide an interoperable

interface:

• A node object based on the

SFPTnodeObject

functional profile to manage

the entire device

• An array of three meters, each based on the same user-defined

UFPTenergyMeter

profile, implementing three identical meters.

Configuration properties are not used in this example.

// node object:
network input

SNVT_obj_request nviNodeRequest;

network output polled SNVT_obj_status nvoNodeStatus;


fblock SFPTnodeObject {

nviNodeRequest implements nviRequest;

nvoNodeStatus

implements

nvoStatus;

} NodeObject external_name("NodeObject");

// UFPTenergyMeter

// Implements the meter from the previous example.

network input

SNVT_amp

nviAmpere[3];

network input

SNVT_volt nviVoltage[3];

network input

SNVT_angle nviCosPhi[3];

network output

SNVT_power nvoWattage[3];

network output polled eeprom SNVT_elapsed_tm nvoUsage[3];

fblock UFPTenergyMeter {

nvoWattage[0] implements nvoWattage;

nviAmpere[0] implements nviAmpere;

nviVoltage[0] implements nviVoltage;

nviCosPhi[0] implements nviCosPhi;

nvoUsage[0]

implements

nvoUsage;

} Meter[3] external_name("Meter");

Because functional blocks only provide logical grouping of network variables and
configuration properties, and meaning to those groups, but do not themselves

contain executable code, the functional blocks appear only in the self-

documentation data generated by the LonTalk Interface Developer utility, but
not in any generated executable code.

Advertising