Changing functional block status, Logging application errors, System errors – Echelon Neuron C User Manual
Page 183

Neuron C Programmer’s Guide
171
See the
FT 5000 EVB Examples Guide
or the
NodeBuilder FX/PL Examples
Guide
for more examples of using the fblockNormalNotLockedOut( ) function.
You can change the functional block status, as described in
, to alert a network integrator as to the reason for disabling a
functional block.
Changing Functional Block Status
You can report a functional block error condition using the nvoStatus output of
the Node Object functional block. Each functional block on a device has an
independent status condition, so network tools use the nviRequest input to the
Node Object functional block to request the status of an individual functional
block, and this status is reported via the nvoStatus output.
Functional block status is not built into the Neuron C language, but as described
in
on page 170, code to manage functional block
status is automatically generated by the NodeBuilder Code Wizard. You can
update the functional block status by setting the appropriate fields within the
fblockData[ ] array. See the definition of the SNVT_obj_status type at
types.lonmark.org
, or in the NodeBuilder Resource Editor, for a description of the
fields.
For example, the following statement changes the functional block status for the
functional block identified by
fblockIndex
to report a mechanical fault:
fblockData[fblockIndex].objectStatus.mechanical_fault =
TRUE;
Logging Application Errors
You can report a device error condition using the error_log( ) function, which is
passed an error number between 1 and 127. This function writes the last number
into a dedicated location in EEPROM. A network tool can use the
query status
network diagnostic command to read the last error. The syntax for the
error_log( ) function is as follows:
void error_log (unsigned int
error_num
);
The error number values between 1 and 127 are application-defined. You can
assign numbers in this range to your device error conditions, and document these
assignments as part of your device documentation.
System Errors
The Neuron firmware reports system errors using the same error log used to
report application errors. System errors include programming errors and
network errors and inconsistencies. As with application errors, network tools can
retrieve the last value from the error log using the
query status
network
diagnostic command.
System error numbers are in the range of 128 to 255; see the
Neuron Tools Errors
Guide
for an annotated list of system error messages.