User`s guide

i.LON SmartServer 2.0 Programming Tools User’s Guide 9
fblock UFPTMath {
in1 implements in1;
in2 implements in2;
out1 implements out1;
} fbMathFunction external_name ("Math Function");
3. Save your model file on your computer. This example stores a model file named “math.nc” in a
folder named “ModelFile” that has been created under the C:\LonWorks directory. The file path of
the source file in this example is therefore C:\LonWorks\ModelFile\math.nc.
4. Create a <YourCompany> folder for your company under the C:\LonWorks\Import folder if one
does not already exist. This is where the XIF generated by the i.LON SmartServer 2.0 LonWorks
Interface Developer tool is to be stored.
5. Install the full version of the i.LON SmartServer 2.0 Programming Tools from the i.LON
SmartServer 2.0 Programming Tools DVD if it is not already installed on your computer. This
will install the i.LON SmartServer 2.0 LONWORKS Interface Developer tool. You will use this
command line interface in the next step to generate the device interface (XIF) file used by your
FPM. For more information on installing the i.LON SmartServer 2.0 LonWorks Interface
Developer tool, see Chapter 2,
Installing i.LON SmartServer 2.0 Programming Tools.
6. Convert your model file to a XIF using the i.LON SmartServer 2.0 LonWorks Interface Developer
tool. To do this, open a Command Prompt window and then type the following command:
libilon --source=<model file path> --pid=<program ID> --
out=<destination path> --basename=<XIF name >
For this example, you would type the following at the command prompt (you need to replace the
sample program ID with your company’s program ID, and you need to replace the
“YourCompany” folder in the C:\LonWorks\Import directory with your company’s folder):
libilon --source=C:\LonWorks\ModelFile\Math.nc --
pid=9F:FD:3E:00:00:00:04:00 --out=C:\LonWorks\Import\YourCompany
--basename=Math
This creates device interface files named “Math” (.xif and .xfb extensions), and stores them in the
C:\LonWorks\Import\<YourCompany> folder.
Note: You need to separate the command switches (--source, --pid, –-out, and –-
basename) with spaces, but you do not insert spaces between the command switch and the
specified argument.
7. Copy the XIF (.xif extension) generated in step 5 to the root/lonWorks/Import<YourCompany>
folder on the SmartServer flash disk. Note that you may need to create the <YourCompany>
folder on the SmartServer flash disk before copying the XIF.
For more information on creating XIFs for your FPMs, see Chapter 4,
Creating FPM Device Interface
(XIF) Files.
Step 3: Creating the FPM Project
You can create the FPM project using the i.LON SmartServer 2.0 Programming Tool. To create a new
FPM project, you make your SmartServer accessible to the i.LON SmartServer 2.0 Programming Tool,
and then create a new FPM project from the resource file set you added to the SmartServer flash disk.
To create an FPM application, follow these steps:
1. Start the i.LON SmartServer 2.0 Programming Tool. To do this, click Start, point to Programs,
point to Echelon i.LON SmartServer 2.0 Programming Tools, and then click i.LON
SmartServer 2.0 Programming Tools. The i.LON SmartServer 2.0 Programming Tool opens.
2. Locate the LonMark Resource View at the bottom left-hand corner of the document window.