ZCOM Message Handling
Message Queuing
Message Queuing
Each program ZLU (either primary or auxiliary) has a single input queue on which messages are received and read on a
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 are reset to zero via the ztimr routine (a zero “time” value).
The application program uses the zread routine to read messages from the input queue. All response and status messages are written to the primary program ZLU. Data messages can be written to either the primary or auxiliary program 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 message was sent. The message is added to the end of the queue for the specified ZLU.
Figure
| Primary | Points to the |
| Input Queue | |
| Program | |
| ||
|
| |
|
|
|
Application A
zread
Input
Queue MSG MSG
Chapter 2 | 27 |