Functional block declarations – Echelon Neuron C User Manual
Page 116

104
Using Functional Blocks to Implement a Device Interface
and some required data structures that implement a functional block.
Principally, the functional block creates associations among network variables
and configuration properties. The compiler then uses these associations to create
the self-documentation (SD) data and self-identification (SI) data in the device
and in its associated device interface file (.xif extension).
Functional Block Declarations
The complete syntax for declaring a functional block is the following:
fblock
FPT-identifier
{
fblock-body
}
identifier
[
array-bounds
]
[
ext-name
] [
fb-property-list
] ;
ext-name
: external_name (
C-string-const
)
external_resource_name (
C-string-const
)
external_resource_name (
const-expr
:
const-expr
)
array-bounds
: [
const-expr
]
fblock-body
: [
fblock-member-list
] [;
director-function
]
fblock-member-list
:
fblock-member-list
;
fblock-member
fblock-member
fblock-member
:
nv-reference
implements
member-name
nv-reference impl-specific
impl-specific
: implementation_specific (
const-expr
)
member-name
nv-reference
:
nv-identifier
array-index
nv-identifier
array-index
: [
const-expr
]
director-function
: director
identifier
;
The functional block declaration begins with the fblock keyword, followed by the
name of a functional profile from a resource file. The functional block is an
implementation of the functional profile (that is, it
instantiates
the profile). The
functional profile defines the abstract network variable and configuration
property members, a unique key called the
functional profile number
or
functional profile key
, and other information. The network variable and
configuration property members are divided into mandatory members and
optional members. Mandatory members must be implemented, and optional
members can be implemented as needed.
The functional block declaration then proceeds with a member list. In this
member list, you associate network variables that you declared previously in the
application with the network variable members of the profile. The implements
keyword associates your application network variables with the profile network
variable members. The member list can be omitted if the functional block is used
only as a collection of related configuration properties.
At a minimum, every mandatory network variable member of the profile must be
implemented by an actual network variable in the Neuron C program. Each
network variable (or, in the case of a network variable array, each array element)
can implement no more than one profile member, and can be associated with at
most one functional block.