beautypg.com

Using include directives, Example model files, Single functional block – Echelon i.LON SmartServer 2.0 User Manual

Page 73

background image

i.LON SmartServer 2.0 Programming Tools User’s Guide

59

external_name property, the SmartServer uses the FPT key of the UFPT for the functional
block name. The FPT key is a unique ID (20000 or higher) defined for the UFPT within a
resource file set.

The fb-property-list is used to implement the configuration properties declared in the model
file that apply to the functional block. You can implement one or more functional block
configuration properties using the following syntax:

fb_properties

{cp-reference,cp-reference,cp-reference

};

For more information on declaring functional blocks, see Chapter 5 of the Neuron C Programmer’s
Guide
.

Using Include Directives

If a data point declared in your UFPT has a data type that references a system include file, you need to
insert an include directives at the beginning of your model file that in order for it to access that source
file. System include files are installed by the NodeBuilder Development Tool, and they are stored in
the LonWorks\NeuronC\Include directory on your computer by default. To insert an include directive
in your model file, you can use the bracketed form:

#include //bracketed form

For example, if you declare a SNVT_temp_f data point in your model file, which has a float data type,
you need to insert the following include directives at the beginning of your model file:

#include

Example Model Files

The following examples demonstrate how to create model files that instantiate a single functional
block; multiple functional blocks based on the same UFPT; and multiple functional blocks with unique
UFPTs.

Single Functional Block

The following example demonstrates a model file that declares all the mandatory network variable and
configuration property members in the UFPT, which consists of three input network variables, two
output network variables, and four functional block configuration properties (one of which is a user-
defined type). The example model file then declares a functional block that does the following: lists
network variable member implementations of all the declared input and output network variables,
declares an external functional block name to be used by the SmartServer, and implements the declared
configuration properties.

#include

network input SNVT_hvac_mode nviHVACMode;
network input SNVT_temp_f nviSetPoint;
network input SNVT_temp_f nviTemp;

network output SNVT_switch nvoAC_OnOff;
network output SNVT_switch nvoFurnace_OnOff;

network input SCPTmaxSendTime cp nciHeartbeat;
network input SCPTmaxRcvTime cp nciOffline;
network input SCPTminSendTime cp nciThrottle;
network input UCPTHysteresis cp nciHysteresis;

fblock UFPTHVACController {
nviHVACMode implements nviHVACMode;