Device self-documentation, Examples – Echelon Neuron C User Manual
Page 42

30
Focusing on a Single Device
options
Optional I/O parameters, dependent on the chosen
type
for the I/O object.
The description of each object type includes the type’s available options.
Except where noted, these options can be listed in any order. All options
have default values that are used when you do not include the option in the
object declaration.
io-object-name
A user-supplied name for the I/O object, in the ANSI C format for variable
identifiers.
The description for each I/O object includes a detailed explanation of the syntax
for each I/O object type.
Example: A logic level needs to be measured at the IO3 input pin of the device,
which is named IO_3 in Neuron C. The pin is connected to a proximity detector,
as its programmatic name indicates.
IO_3 input bit ioProxDetector;
Whenever your program refers to the ioProxDetector variable, it is actually
referring to the logic level on pin IO3.
Some I/O objects can be combined or multiplexed according to specific rules. In
addition, there are a number of Neuron C functions and events predefined for
various I/O objects. See the
I/O Model Reference for Smart Transceivers and
Neuron Chips
for more information about I/O objects.
Device Self-Documentation
You can include a text string that describes your device in your application. This
text string can be accessed by any network management tool, and can be used by
a network integrator to verify that they have the correct device when designing
in or installing your device. This text string is appended to the device self-
documentation (SD) string. The Neuron C compiler automatically generates a
portion of the SD string that documents the functional profiles that are
implemented by the functional blocks in your application. You can add
additional text for the SD string using the following compiler directive as
described in the
Compiler Directives
chapter of the
Neuron C Reference Guide
:
#pragma set_node_sd_string
C-string-const
Examples
This section presents three complete programs that illustrate Neuron C
capabilities and good coding style. The examples are:
1 Thermostat
interface
2
Simple light dimmer interface
3
Seven-segment LED display interface