Sending application-specific periodic messages – Echelon ISI User Manual

Page 96

Advertising
background image

ISI Programmer’s Guide

94

You can use periodic processing in the ISI engine to schedule and send periodic

heartbeat updates for any of the output network variables in your application.
To send periodic heartbeats, follow these steps:

1. Start the ISI engine with the isiFlagHeartbeat flag. This causes the ISI

engine to periodically call the IsiQueryHeartbeat() callback. This

function returns TRUE if a heartbeat has been propagated, and FALSE
otherwise.

2. Implement an IsiQueryHeartbeat() callback function and call the

IsiIssueHeartbeat() function from within the function to send a heartbeat
update. The IsiIssueHearbeat() function sends a network variable

heartbeat for the indicated network variable index and all associated

aliases. These heartbeats are sent with unacknowledged service with one
repeat.

The IsiIssueHeartbeat() function only propagates network variables using group
addressing. For example, if you use subnet/node ID addressing to implement an

acknowledged connection as described in

Creating an Acknowledged Connection

,

the output will not be propagated by the IsiIssueHeartbeat() function. To

propagate outputs that do not use group addressing; use the propagate() Neuron

C library function in combination with an IsiCreatePeriodicMessage() callback
described in the next section for customized but scheduled network variable

heartbeats.

E

XAMPLE

The following starts the ISI engine with heartbeats enabled and issues a

heartbeat in response to the IsiQueryHeartbeat() callback.

when (reset) {
IsiStartDa(isiFlagHeartbeat);
}

boolean IsiQueryHeartbeat(unsigned nv) {

// Agree to all heartbeats suggested by the ISI engine

return IsiIssueHeartbeat(nv);

}

Sending Application-Specific Periodic Messages

You can send periodic messages, taking into account network size so that you

optimize use of available channel bandwidth. The ISI engine automatically
sends periodic messages in a controlled and scheduled manner to limit channel

utilization for both ISI and application heartbeat messages. When each cycle of

periodic messages is completed, the ISI engine calls the IsiCreatePeriodicMsg()
callback function. The default implementation of this function always returns

FALSE. To send application-specific periodic messages, follow these steps:

1. Start the ISI engine with the isiFlagApplicationPeriodic flag.

2. Override the IsiCreatePeriodicMsg() callback function to set an

application-specific flag and return TRUE to signal that the application
has a periodic message to send. Do not send the message from within

Advertising