Introduction to predefined events – Echelon Neuron C User Manual
Page 22
2
Predefined Events
Introduction to Predefined Events
An
event
is a programmatic notification provided by the Neuron firmware that
there has been an occurrence of something significant to the application program.
For example, a network variable update has been received from the network, or
an input pin has changed state.
Events are used in
when-clauses
to enable the execution of a
when-task
, using
the following general syntax:
when(
...
}
Neuron C defines a number of predefined events for events that are managed by
the Neuron firmware. Predefined events are represented by unique keywords, or
by an event identifier with arguments, similar to a Neuron C function call, listed
in Table 2 below. Some predefined events, such as the I/O events, can be followed
by a modifier that narrows the scope of the event. If the modifier is optional and
is not supplied, any event of that type qualifies.
Most events can also be used as predicates in code; see
Bypass Mode
in Chapter 7
of the
Neuron C Programmer’s Guide
.
Table 2. Events Listed by Functional Group
Functional Group
Event
System / Scheduler
offline
online
reset
timer_expires
wink
Input/Output
io_changes
io_in_ready
io_out_ready
io_update_occurs
Sleep
flush_completes
Network Variables
nv_update_completes
nv_update_fails
nv_update_occurs
nv_update_succeeds
Messages
msg_arrives
msg_completes
msg_fails
msg_succeeds
resp_arrives
Within a single program, the following predefined events, which reflect state
transitions of the application processor, can appear in no more than one when
clause: