Msg_arrives event, Syntax, Example – Echelon Neuron C User Manual

Page 27: Msg_completes event

Advertising
background image

Neuron C Reference Guide

7

msg_arrives

Event

The msg_arrives event evaluates to TRUE once for each a message that arrives.

This event can be qualified by a specific message code specified by the sender of
the message. See Chapter 6,

How Devices Communicate Using Application

Messages

, of the

Neuron C Programmer's Guide

, for a list of message code ranges

and their associated meanings. You can reduce scheduling overhead by using an
unqualified msg_arrives event followed by a switch statement on the code field of

the msg_in object.

Syntax

msg_arrives [(

message-code

)]

message-code

An optional integer message code. If this field is omitted,

the event is TRUE for receipt of any message.

Example

when (msg_arrives(10))
{
...
}

msg_completes

Event

The msg_completes event evaluates to TRUE when an outgoing message

completes (that is, either succeeds or fails). This event can be qualified by a

specific message tag.

Checking the completion event (msg_completes, msg_fails, msg_succeeds) is

optional by message tag.
If a program checks for either the msg_succeeds or msg_fails event, it must check
for

both

events. The alternative is to check only for msg_completes.

Syntax

msg_completes [(

message-tag

)]

message-tag

An optional message tag. If this field is omitted, the

event is TRUE for any message.

Example

msg_tag tag_out;

...
msg_out.tag = tag_out;
msg_send();
...

when (msg_completes(tag_out))
{
...

Advertising