Introduction, Functional block declarations syntax – Echelon Neuron C User Manual
Page 200
180
Functional Block Declarations
Introduction
The external application interface of a L
ON
W
ORKS
device consists of its functional
blocks, network variables, and configuration properties. A
functional block
is a
collection of network variables and configuration properties that are used
together to perform one task. These network variables and configuration
properties are called the
functional block members
.
Functional blocks are defined by
functional profiles
. A functional profile is used
to describe common units of functional behavior. Each functional profile defines
mandatory and optional network variables and configuration properties. Each
functional block implements an instance of a functional profile. A functional
block must implement all the mandatory network variables and configuration
properties defined by the functional profile, and can implement any of the
optional network variables and configuration properties defined by the functional
profile. A functional block can also implement network variables and
configuration properties not defined by the functional profile – these are called
implementation-specific
network variables and configuration properties.
Functional profiles are defined in
resource files
. You can use standard functional
profiles (SFPT) defined in the standard resource file set, and you can define your
own functional profiles (UFPT) in your own resource file sets. Functional blocks
based on standard functional profiles are also called
LonMark objects
. A
functional profile defined in a resource file is also called a
functional profile
template
for a list of standard functional profiles.
You can declare functional blocks in your Neuron C applications using fblock
declarations. These declarations are described in this chapter.
A functional block declaration does not cause the compiler to generate any
executable code, although the compiler does create some data structures as
described in
on page 185. These data structures are
used to implement various functional block features.
Principally, the functional block declaration creates associations among network
variables and configuration properties. The compiler then uses these
associations to create the self-documentation (SD) and self-identification (SI)
data in the device and in its associated device interface file (.xif extension).
The functional block information in the device interface file or the SD and SI data
communicates the presence and names of the functional blocks contained in the
device to a network tool. The information also communicates which network
variables and configuration properties in the device are members of each
functional block.
Functional Block Declarations Syntax
The complete syntax for declaring a functional block is:
fblock
FPT-identifier
{
fblock-body
}
identifier
[
array-bounds
]
[
ext-name
] [
fb-property-list
] ;
array-bounds
:
[
const-expr
]