ACC Programmer's Reference Guide
Chapter 2 27
ZCOM Message Handling
Message Queuing
Message Queuing
Each program ZL U (either primary or auxiliary) has a s ingle input
queue on which messages are received and read on a first-in-first-out
basis. Becausethe ZLU is the input queuingmechanism for timeouts and
statuses, as well as for data messages, all programs should request
(through the zopen routine) at least one program ZLU before using the
other ZCOM calls.
The ztimr routine may be used to enable or disable the timer on a
program ZLU. When enabled, a timeout message is added to the input
queue of the ZLU every n seconds (n being specified as a parameter to
the ztimr call). If there are already 10 or more messages on the queue, no
timer message is queued. Timer processing stops when ZTIMER and
ZCLOCK a re reset to zero via the ztimr routine (a zero “ time” value).
The application program uses the zread routinetoreadmessagesfrom
the input queue. All response and status messages are written to the
primary program ZLU. Data messages can be written to eit her the
primary or aux iliary pro gram ZLUs.
When a zsend routine call is executed, the message to be sent is moved to
the ZCOM kernel buffer which is queued to the ZLU to which the
messagewassent.Themessageisaddedtotheendofthequeueforthe
specified ZLU.
Figure 2-1 Program Message Queueing
Application A
zread
Primary
Program
Points to the
Input Queue
MSGMSG
Input
Queue










