Creating fpms overview – Echelon i.LON SmartServer 2.0 User Manual
Page 80
66
Creating Freely Programmable Modules
Creating FPMs Overview
You can use the full version of the i.LON SmartServer 2.0 Programming Tool to create FPMs. The
full version of the i.LON SmartServer 2.0 Programming Tool includes all the components needed to
manage an FPM project:
• Eclipse Development Kit preconfigured for writing, building, and uploading FPMs.
• FPM template files.
• FPM library. A tool for creating the C structures of user-defined UNVTs is also included.
• C++ compiler.
• CYGWIN environment.
Creating an FPM with the full version of the i.LON SmartServer 2.0 Programming Tool, entails
creating a new FPM project or opening an existing project, writing the FPM application or FPM driver
in C or C++, and then compiling the FPM.
You can create a new FPM project from the user-defined functional profile template (UFPT) that you
generated with NodeBuilder Resource Editor and you uploaded to your SmartServer following the
steps described in Chapter 3, Creating FPM Templates. When you create the new FPM project, you
select whether you are creating an FPM application or an FPM driver. An FPM application reads and
writes values to the data points declared in it, executes an algorithm upon data point updates, reads
data point properties, and controls timers and executes code upon their expiration. An FPM driver
provides values for the data points declared in it by reading and writing to the RS-232 and RS-485
ports on the SmartServer. Once the FPM project has been created, you can add any user-defined data
types to your FPM that were not declared in the UFPT.
After you create a new FPM project or import an existing FPM project, you can write the FPM
application or FPM driver in C or C++. Writing the FPM application or FPM driver essentially
requires you to implement four main routines that specify the behavior of your FPM:
Initialize()
, Work(), Shutdown(), and OnTimer(). The Initialize() routine is
executed when the FPM is started or enabled; the Work() routine is executed when a data point
declared in the FPM is updated; the Shutdown() routine is executed when the FPM is stopped or
disabled; and the OnTimer()routine is executed when a timer expires.
You can debug your FPMs using a source level debugger (VxWorks 6.2 - Wind River Workbench 2.4)
that you can purchase from Wind River. If you are not using Wind River Workbench to debug your
FPMs, you should follow the FPM coding guidelines described in this chapter so that you can debug
your code more easily. For example, you should frequently insert printf() statements in your code
so that you can view the status of your FPM using the console port of the SmartServer. For more
information on ordering “WindRiver Platform for Industrial Services V3.2 for MIPS32 Processors”,
which includes Wind River Workbench, contact Wind River
sales at
Once you finish writing the FPM, you can compile it. If your code has any errors or warnings, they
will be displayed in the Problems view at the bottom of the document window. You can click on the
errors and warnings listed in this view to debug your FPM. You can also check the Console view
(located to the right of the Problems view) to see if there is more detailed information available for a
given compiler error or warning.
Notes: To use the full version of the i.LON SmartServer 2.0 Programming Tool, you must order and
install the i.LON SmartServer 2.0 Programming Tools DVD. To order the i.LON SmartServer 2.0
Programming Tools DVD (Echelon part number 72111-409), contact your Echelon sales
representative. If you have a demo version of the i.LON SmartServer 2.0 Programming Tool, you can
write FPMs, but you cannot compile and upload them.
If you have already created an FPM project and you want to modify your FPM application or FPM
driver, you can import your FPM project into the current workspace following the steps described in
the Importing FPM Projects section in Chapter 2. After you import your FPM project, you can
proceed to the Writing an FPM Application or Writing an FPM Driver section.