GDSX (Extended General Device Support) Manual
LINE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual—529931-001
7-11
Basic Structure of LINE^HANDLER Code
Receipt of an intertask message is one of the events tested for with the CASE
WAIT^EVENT statement (see Figure 7-4). Then a perpetual loop is initiated with logic
to determine what kind of event has happened. A CASE statement tests the event
literal returned from WAIT^EVENT and determines which of four expected events have
occurred. In this example, events tested for are:
•
E^ITC, intertask message from DEVICE^HANDLER
•
E^IOC, I/O completion on a file, most likely the LINE file
Figure 7-4. Basic Structure of LINE^HANDLER Code
INIT
PROCESSING
WHILE (1)
DO
^READUPDATE
(IN^Q^FILE)
CASE
WAIT^EVENT
E^ITC E^IOC E^STOP
VST026.vsd
CALL
STOP^TASK
Find
Cancelled
IOCB
CALL
NOTIFY^IO^
COMPLETION
Cancel Line
Operation
^READUPDATE
(IN^Q^FILE)
E^CAN
@IOCB : =
^LISTEN (...
@IOCB : =
^LISTEN (...
Process I/O
Completion
Send I/O
To Line
CALL
NOTIFY^IO^
COMPLETION
Release
Line IOCB
^READUPDATE
(IN^Q^FILE)