Defining a functional block – Echelon LonTal Stack User Manual

Page 67

Advertising
background image

LonTalk Stack Developer’s Guide

55

Using changeable-type network variables allows you to design a generic device

(such as a generic proportional-integral-derivative (PID) controller) that supports
a wide range of numeric network variable types for set-point, control, and

process-value network variables.
See Defining a Changeable-Type Network Variable or more information about
implementing changeable-type network variables for LonTalk Stack applications.
You can also define your own nonstandard data types. The NodeBuilder
Resource Editor utility, which is included with the LonTalk Stack Developer’s

Kit, allows you to define your own, nonstandard data types for network variables

or configuration properties, and allows definition of your own, nonstandard
functional profiles. These nonstandard types are called user-defined types and

user-defined profiles.

Defining a Functional Block

The first step for defining a device interface is to select the functional profile, or
profiles, that you want your device to implement. You can use the NodeBuilder

Resource Editor included with the LonTalk Stack Developer’s Kit to look through

the standard functional profiles, as described in Defining a Resource File. You
can find detailed documentation for each of the standard functional profiles at

types.lonmark.org

.

For example, if your device is a simple sensor or actuator, you can use one of the

following standard profiles:

• Open-loop sensor (SFPTopenLoopSensor)
• Closed-loop sensor (SFPTclosedLoopSensor)
• Open-loop actuator (SFPTopenLoopActuator)
• Closed-loop actuator (SFPTclosedLoopActuator).

If your device is more complex, look through the other functional profiles to see if

any suitable standard profiles have been defined. If you cannot find an existing

profile that meets your needs, you can define a user functional profile, as
described in Defining a Resource File.
Example: The following example shows a simple functional block declaration.

network output SNVT_amp nvoAmpere;

fblock SFPTopenLoopSensor {

nvoAmpere implements nvoValue;

} fbAmpMeter;

This functional block:

• Is named fbAmpMeter (network management tools use this name unless

you include the external_name keyword to define a more
human-readable name)

• Implements the standard profile SFPTopenLoopSensor
• Includes a single network variable, named nvoAmpere, which implements

the nvoValue network variable member of the standard profile

Advertising