Echelon LonTal Stack User Manual
Page 90
78
Creating a Model File
// 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.
Functional Blocks with Configuration Network
Variables
The following example takes the above example and adds a few configuration
properties implemented as configuration network variables. A cp modifier in the
network variable declaration makes the network variable a configuration
network variable. The nv_properties and fb_properties modifiers apply the
configuration properties to specific network variables or the functional block.
// Configuration properties for the node object
network input cp SCPTlocation nciLocation;
// Network variables for the 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")
fb_properties {
nciLocation
};
// Config properties for the Meter
network input cp SCPTminSendTime nciMinSendTime[3];
network input cp SCPTmaxSendTime nciMaxSendTime[3];
network input cp UCPTcoupling nciCoupling;
// Network variables for the meter
network input SNVT_amp
nviAmpere[3];
network input SNVT_volt
nviVoltage[3];
network input SNVT_angle
nviCosPhi[3];
network output SNVT_power
nvoWattage[3] nv_properties {
nciMinSendTime[0],