GDSX (Extended General Device Support) Manual
LINE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual—529931-001
7-8
Transaction Flow
TSCODE intercepts the message, determines that terminal file number is an ITC file
number, and passes the message to the ITC file for the appropriate LINE^HANDLER
task (in this example there is only one LINE^HANDLER task), which detects it as an
intertask message (E^ITC) when it calls WAIT^EVENT. Then the task calls ^LISTEN
to get the address of the IOCB for the message (@dh^iocb := ^LISTEN (0, 0, 1)).
When data is picked up from the IOCB, it is determined that the operation is a
^WRITEREAD, and a pointer to the IOCB is placed on a ^WRITEREAD IOCB queue,
where it remains until the transaction’s WRITE of the reversed string has been
completed. If the LINE file is free, a nowait ^WRITEREAD (the CPU, PIN prompt) is
sent to the LINE file (a terminal, in this case). A ^READUPDATE is posted on the in
queue referenced by the variable in^queue^file^num, so that another intertask
message can be picked up from the DEVICE^HANDLER task.
When the ^WRITEREAD completes, WAIT^EVENT detects the completion (E^IOC).
The task then calls ^LISTEN to get a pointer to the LINE IOCB (line^iocb, allocated by
TSCODE after the ^WRITEREAD is initiated) containing information about the
completion. Relevant fields in the line^iocb, including the text string input by the user
Figure 7-3. LINE^HANDLER Example Message Flow
#LX
T1
Pseudo-
$RECEIVE
Listener
ITC File
E^TIMEOUT
ITC File
$A3
$RECEIVE
Pseudo-
$RECEIVE
Pseudo-
$RECEIVE
T2
T3
E^CAN
E^STOP
IN^QUEUE^FIL
E^NUM/E^ITC
ITC File
L^H Task
D^H Task
D^H Task
D^H Task
E^IMSG
WT^IOCB
WT^RD^IOCB
^LIST
E^IOC
$A2
$A1
VST025.vsd