Echelon Neuron C User Manual

Page 202

Advertising
background image

182

Functional Block Declarations

A Neuron C program can also implement

additional

network variables in the

functional block that are not in the list of optional members of the profile. Such
additional network variable members beyond the profile are called

implementation-specific

members. These extra members are declared in the

member list using the implementation_specific keyword, followed by a unique
index number, and a unique name. Each network variable in a functional profile

assigns an index number and a member name to each abstract network variable
member of the profile, and the implementation-specific member cannot use any of

the index numbers or member names that the profile already uses.
Note that implementation-specific member network variables or configuration
properties can prevent device certification. Instead of adding implementation-

specific member network variables or configuration properties, consider removing

those items from the interoperable interface, or defining a user-defined functional
profile, possibly inheriting from a standard functional profile, and adding the

desired new members to that UFPT.
At the end of the member list there is an optional item that permits the
specification of a director function. The director function specification begins

with the director keyword, followed by the identifier that is the name of the

function, and ends with a semicolon. See the chapter on functional blocks in the

Neuron C Programmer’s Guide

for more explanation and examples of functional

block members and the director function.

After the member list, the functional block declaration continues with the name

of the functional block itself. A functional block can be a single declaration, or it

can be a singly-dimensioned array.

If the fblock is implemented as an array, as shown in the example below, then

each network variable that is to be referenced by that fblock must be declared as

an array of at least the same size. When implementing an fblock array’s member
with an array network variable element, the

starting index

of the first network

variable array element in the range of array elements must be provided in the

implements statement. The Neuron C compiler automatically adds the following
network variable array elements to the fblock array elements, distributing the

elements consecutively.
Example:

network output SNVT_lev_percent nvoValue[6];

// The following declares an array of four fblocks, which
// have members nvoValue[2]..nvoValue[5], respectively
fblock SFPTanalogInput {

nvoValue[2] implements nvoAnalog;

} myFB[4];

An optional external name can be provided for each functional block. An external
name can be specified with an external_name keyword, followed by a string in

parentheses. The string becomes part of the device interface that is exposed to
network tools. The external name is limited to 16 characters. If the

external_name feature is not used, nor the external_resource_name feature

described below, the functional block identifier (supplied in the declaration) is
also used as the default external name. In this case, there is a limitation of 16

characters applying to the functional block identifier.
An external name can optionally be specified using a reference to a resource file.
The reference is specified using the external_resource_name keyword, instead of

Advertising