Reset event – Echelon Neuron C User Manual
Page 33

Neuron C Programmer’s Guide
21
msg_succeeds
msg_fails
resp_arrives
Most network events, except resp_arrives, are enqueued only if the Neuron C
compiler has determined that the application checks for the event. The online,
offline, and wink events are always enqueued but are discarded by the scheduler
if no corresponding when clause is found.
When it reaches the head of the queue, an event remains there until processed by
the application. Therefore, any network event that is checked for by an
application must be checked for frequently, or the event remains at the head of
the queue, effectively blocking that queue. A blocked queue prevents the
application from continuing normal processing of events and can cause the device
to fail to respond to any subsequent application or network management
messages.
This is a particularly critical consideration for nv_update_occurs and msg_arrives
events, which can arrive unsolicited at any time; in comparison, completion
events and responses arrive only as the result of application-initiated outgoing
network activity. The Neuron C compiler determines that an event is handled by
the application by virtue of its presence in the program, even if it is never
checked for in a when clause, or is only checked for in special circumstances.
Reset Event
The reset event is TRUE the first time this event is evaluated after the Neuron
Chip or Smart Transceiver is reset for any reason. Note that I/O object and
global variable initializations are performed before processing any events. The
reset event task
is the first task to be executed after reset of the Neuron Chip or
Smart Transceiver.
The reset event task executes only if the device is in the configured state (that is,
if the device is not applicationless, hard-offline, or unconfigured). Also, the reset
event task runs when the device is unconfigured if the directive #pragma
run_unconfigured is specified in the application program. The task runs
regardless of whether the device is soft-offline or not. The soft-offline state is not
reset-retained, so the only case where this is meaningful is when the device
transitions from unconfigured or hard-offline to configured state after a reset, as
would typically happen during initial commissioning. In this case, the device
executes the reset task followed by the offline task.
A reset occurs as a natural part of the process of commissioning a L
ON
W
ORKS
device, and the reset process includes the execution of the reset event task. The
device undergoes a state transition to complete the commissioning process, and
that state transition can only be completed after the reset event task has been
executed. Consequently, you should keep the reset event task short so that the
device can be commissioned at maximum speed. You must keep the total reset
event task processing time under 18 seconds to prevent commissioning failures.
Reset event task processing time includes Neuron firmware initialization time as
described in the Smart Transceivers databooks.