Taking an application offline, Disabling a functional block – Echelon Neuron C User Manual

Page 182

Advertising
background image

170 Additional

Features

Taking an Application Offline

You can take a device offline using the go_offline( ) function. You typically take

this action if the error cannot be corrected by a device reset or application restart,
and if the error is not localized to specific functional blocks on the device. The

device can also be taken offline (and set back online again) through a command

received over the network. Network tools frequently set devices offline during
configuration.
The go_offline( ) function terminates all outstanding transactions and stops all

application processing. You can call the flush_wait( ) function in the
when(offline) task to ensure that any outstanding transactions complete

normally.

The Neuron firmware continues to run when a device is offline so that a network

integrator using a network tool can test the device status, take any required

corrective actions, and then put the application back online. You can log an
application error, as described in

Logging Application Errors

on page 171, to alert

a network integrator as to the reason for going offline.

Disabling a Functional Block

You can disable an individual functional block for an error that cannot be
corrected by a device reset or application restart, but is localized to a particular

functional block or set of functional blocks on the device.
Functional block status is not built into the Neuron C language, but code to
manage functional block status is automatically generated by the NodeBuilder

Code Wizard. The code wizard creates an fblockData[ ] array that contains the

functional block status for each functional block in an application. The members
of this array are declared with the SNVT_obj_status type.
To disable a functional block, use the following code:

fblockData[fblockIndex].objectStatus.disabled = TRUE;

The

fblockIndex

parameter is the functional block index of the functional block to

be disabled. A network tool can also disable or enable functional blocks from the

network, generally while configuring a single functional block.
You must include code in your application to test the functional block status. The
Code Wizard generates a fblockNormalNotLockedOut( ) function that you can use

to test functional block status. The syntax for this function is as follows:

boolean fblockNormalNotLockedOut(TFblockIndex

fblockIndex

);

The

fblockIndex

parameter is the functional block index of the functional block to

be tested.

For example, the following call from the NodeBuilder example tests the

functional block status for the functional block associated with a network

variable input:

if
(fblockNormalNotLockedOut(fblock_index_map[nv_in_index]))
{

. . .

}

Advertising