beautypg.com

Saving your model file – Echelon i.LON SmartServer 2.0 User Manual

Page 76

background image

62

Creating FPM Device Interface (XIF) Files

nciHeartbeat[0],nciOffline[0],nciThrottle[0],nciHysteresis[0]
};

/////////////second FB array instantiated//////////////////////////

network input SNVT_switch nviACSwitch[NUM_SWITCH_ENCODER_FBs];
network input SNVT_switch nviFurnaceSw[NUM_SWITCH_ENCODER_FBs];
network output SNVT_hvac_mode nvoHVACMode[NUM_SWITCH_ENCODER_FBs];

fblock UFPTSwitchEncoder {
nviACSwitch[0] implements nviACSwitch;
nviFurnaceSw[0] implements nviFurnaceSwitch;
nvoHVACMode[0]implements nvoHVACMode;

} fbSwitchEncoder[NUM_SWITCH_ENCODER_FBs] external_name ("Digital
Encoder");

Multiple Functional Blocks with Multiple UFPTs and Same Data Point Names

The following example demonstrates how to use multiple functional block arrays in a model file to
create multiple sets of functional blocks that are instances of their respective UFPTs. In addition, this
example handles the scenario in which the data points in a UFPT have the same names. You could
then write separate FPM applications for the UFPTs instantiated by the model file. When you deploy
the FPM applications on the SmartServer and select the XIF generated from this model file, the
internal FPM device will include arrays of the functional blocks that are separate instances of their
respective FPM applications.

#define NUM_OF_ADD_FB 3
#define NUM_OF_SUB_FB 2

/////////////first FB array instantiated/////////////////////////

network input SNVT_count in1[(NUM_OF_ADD_FB + NUM_OF_SUB_FB)];
network input SNVT_count in2[(NUM_OF_ADD_FB + NUM_OF_SUB_FB)];
network output SNVT_count out1[(NUM_OF_ADD_FB + NUM_OF_SUB_FB)];

fblock UFPTMathAdd {
in1[0] implements in1;
in2[0] implements in2;
out1[0] implements out1;
} fbMathAddFunction[NUM_OF_ADD_FB] external_name ("FpmAdd");

/////////////second FB array instantiated/////////////////////////

fblock UFPTMathSubtract {
in1[NUM_OF_ADD_FB] implements in1; //can't use [0] for second FB
in2[NUM_OF_ADD_FB] implements in2; //so use next unused index
out1[NUM_OF_ADD_FB] implements out1;
} fbMathSubtractFunction[NUM_OF_SUB_FB] external_name ("FpmSub");

Saving your Model File

When you have finished creating your model, you need to save it as a Neuron C source file (.nc
extension) on your computer. The example above is stored in a model file named “HVAC.nc” in a
folder named “ModelFile” that has been created under the C:\LonWorks directory. The file path of the
source file in the example is therefore C:\LonWorks\ModelFile\HVAC.nc. You can then proceed to the
next section, which explains how to convert a model file to a XIF.