GDSX Manual

LINE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual134303
7-20
Line Control Blocks
Configure a LINE object and three SU objects, and start the LINE:
> SCF
-> ADD LINE $GDS.#LX, ACCESSNAME $TC1
-> ADD SU $GDS.#LX.T1
-> ADD SU $GDS.#LX.T2
-> ADD SU $GDS.#LX.T3
-> START LINE $GDS.#LX
-> EXIT
Run three requester programs:
> RUN APPL/NAME $Al, OUT $GDS.#LX.Tl, NOWAIT/
> RUN APPL/NAME $A2, OUT $GDS.#LX.T2, NOWAIT/
> RUN APPL/NAME $A3, OUT $GDS.#LX.T3, NOWAIT/
The application terminal should now show a prompt.
At the Inspect terminal, pause the TACL process with the PAUSE command. Suppose
for this example that the terminal’s device name is $TC2.
At the TACL terminal, bring your GDSX process under the control of Inspect by
entering:
> DEBUG $GDS, TERM $TC2
To make the source code visible under Inspect, at the Inspect terminal, enter:
- SOURCE ON
- SCOPE #LINE^HANDLER
- SOURCE
Put a breakpoint at the CASE (EVT) OF statement in the main loop of
LINE^HANDLER. Change SCOPE to the USER^STOP procedure, type “SOURCE”
and set a second breakpoint at the CALL ^CANCEL statement. Resume program
execution.
At the application terminal, enter a short text string followed by a carriage return. This
should force the GDSX process to a breakpoint, which will be displayed at the Inspect
terminal. (The WRITEREAD to the IOP has completed, and the call to WAIT^EVENT
has detected the E^IOC event.)
At the Inspect terminal, use the display command to find the current value of EVT:
- DISPLAY EVT
You can check the literals in the errors section in DCCBDECS to determine what kind
of event occurred.
Line Control Blocks
Now the line control block (LCB) for the LINE file can be examined. An LCB is the
internal representation of a LINE and is used to manage a LINE^HANDLER task’s
communication with a file. When SCF was used to configure the LINE, TSCODE
assigned an LCB to manage the terminal. When the LINE object was started, TSCODE
created a LINE^HANDLER task that mapped to the LCB.