Conditional events, Complex events – Echelon Neuron C User Manual
Page 233
Neuron C Reference Guide
213
parm-declaration
:
declaration-specifier-list
parm-declarator-list
;
parm-declarator-list
:
parm-declarator-list
,
declarator
declarator
Conditional Events
In Neuron C, an event is an expression which can evaluate to either TRUE or
FALSE. Neuron C extends the ANSI C concept of conditional expressions
through special built-in functions that test for the presence of special Neuron
firmware events. The Neuron C compiler has many useful built-in events that
cover all the common cases encountered in Neuron programming. However, a
Neuron C programmer can also create custom events by using any parenthesized
expression as an event, including one or more function calls, and so on.
when-event
:
( reset )
predefined-event
parenthesized-expr
interrupt-event
:
( repeating [,
frequency-value
] )
(
io-object-declarator
)
(
io-object-pin-name, interrupt-condition
)
predefined-event
:
( flush_completes )
( offline )
( online )
( wink )
(
complex-event
)
Complex Events
All of the predefined events shown above can be used not only in the
when-clause
portion of the task declaration but also in any general expression in executable
code. The complex events below use a function-call syntax, instead of the
keyword syntax of the special events above.
complex-event
:
io-event
message-event
net-var-event
timer-event
io-event
:
io_update_occurs (
variable-identifier
)
io_changes
(
variable-identifier
)
io_changes
(
variable-identifier
) by
shift-expr
io_changes
(
variable-identifier
) to
shift-expr