Sharing of configuration properties – Echelon Neuron C User Manual

Page 127

Advertising
background image

Neuron C Programmer’s Guide

115

fblock_director(nviRequest.object_id,

nviRequest.object_request);

}
}

Likewise, a single task can handle all network variable updates by notifying the
director function that is in charge of the functional block to which the network

variable update applies:

#define CMD_NV_UPDATE 17

when (nv_update_occurs)
{
fblock_director(fblock_index_map[nv_in_index],
CMD_NV_UPDATE);
}

There are no limitations on how you use a director function or how you interpret

the second parameter to the director function. The director function is a useful
means to create Node Object implementations, but you can extend its usage as

well.

Sharing of Configuration Properties

Elements of a functional block array or multiple distinct functional blocks can
share configuration properties using the static and global modifiers. The

following example implements two configuration properties, one being shared

among all members of the functional block array, and one being shared by the
other two functional blocks.
Example:

cp_family SCPTgain cpGain = { 1, 0 };

// This family will have a total of 2 members


// FBs with shared gain factor:
fblock ... {
...
} fbA fb_properties {
global cpGain // shared by fbA and fbB
};

fblock ... {
...
} fbB fb_properties {
global cpGain // shared by fbA and fbB
};

fblock ... {
...
} fbC[5] fb_properties {
static cpGain // shared among fbC[0]..fbC[4]
};

The rules and considerations for shared configuration properties that are
outlined in Chapter 4,

Using Configuration Properties to Configure Device

Behavior

, on page 83, apply to functional blocks as well as network variables.

See

Sharing of Configuration Properties

on page 96 for more details.

Advertising