SECS GEM Manual.pdf - 第54页
GEM Manual for DEK Printers Capabilities Issue 1.6 January 22, 2018 Page 54 of 171 TRANSMIT SPOOL - The host elec ts to receive all messages contained in the spool area. The printer will keep track of the oldest message …

GEM Manual for DEK Printers Capabilities
Issue 1.6 January 22, 2018 Page 53 of 171
Once communications are established, the host must initiate the spool unload sequence to restore full
functionality. Since the printer will deliver secondary messages, the host may inquire for information
or send commands as needed.
The SPOOL ACTIVE state has two AND states: SPOOL LOAD and SPOOL UNLOAD. This means
that they operate independently, though sharing data and some state change stimuli.
SPOOL LOAD - The SPOOL LOAD component enters messages into the spool area. It is divided
into two substates: SPOOL NOT FULL and SPOOL FULL. SPOOL NOT FULL is the default entry
substate of the parent state SPOOL LOAD.
SPOOL NOT FULL - As primary SECS-II messages are directed to the spool area, the printer will
write the SECS-II message to the end of the spool. Status variables SpoolCountTotal and
SpoolCountActual will be incremented each time a message is placed in the spool area.
SPOOL FULL - In this state, all of the allocated spooling area is filled. Choice of the following
options will be controlled by the setting of the equipment constant "OverWriteSpool." The first
message to be dealt with is that which could not be fitted into the spool prior to the transition from
SPOOL NOT FULL.
OverWriteSpool is True: The printer will delete as many of the "oldest" SECS-II messages
contained in the spool area necessary to make space for the new message and then add the
message to the spool area. The status variable SpoolCountTotal will be incremented whenever
a message is put in the spool area. The status variable SpoolCountActual will be adjusted to
keep an accurate count of the number of messages contained in the spool area.
OverWriteSpool is False: Any subsequent primary messages will be discarded. When a
message is discarded, SpoolCountTotal is incremented.
SPOOL UNLOAD - The SPOOL UNLOAD component of SPOOLACTIVE deals with movement of
messages out of the spool. It has an active substate (SPOOL OUTPUT) and a passive substate (NO
SPOOL OUTPUT). NO SPOOL OUTPUT is the default entry substate, since the printer is NOT
COMMUNICATING at the time spooling is initiated. When communications between printer and host
are restored, there is an opportunity for the host to recover spooled messages. No action is taken until
the host initiates the spool output process via the S6F23 (Request Spooled Data). The host has the
option to either receive the spooled messages (see substate TRANSMIT SPOOL) or discard all
messages in the spool (see substate PURGE SPOOL).
NO SPOOL OUTPUT - In this state, no messages are removed from the spool.
SPOOL OUTPUT - This state controls the removal of messages from the spool. Its substates are
TRANSMIT SPOOL and PURGE SPOOL.
PURGE SPOOL - The printer will discard all messages in the spool and, when the spool is empty,
zero SpoolCountActual.

GEM Manual for DEK Printers Capabilities
Issue 1.6 January 22, 2018 Page 54 of 171
TRANSMIT SPOOL - The host elects to receive all messages contained in the spool area. The printer
will keep track of the oldest message within the spool area. When communications are re-established
with the host and transmission of the spool area is started, the oldest message will be the first to be
transmitted, then the next oldest message, etc. There is no prioritisation of messages to be sent from
the spool. As each spooled message is successfully transmitted to the host, it is removed from the
spool area upon successful completion of the transaction. SpoolCountActual is decremented as each
message is removed from the spool. The printer will transmit messages only from the spool area until
all spooled messages have been completely transmitted to the host.
Flow control of the spool transmit process is achieved in two ways.
First, only one open transaction on the printer is allowed during spool unload. Thus, if a
message requires a reply, the printer will wait for that reply before transmitting the next
message. Messages that require no reply will be transmitted sequentially.
The second flow control method is to allow the host to limit the maximum number of messages
sent from the spool in response to the S6F23 request. An equipment constant
“MaxSpoolTransmit” can be set by the host to achieve this behavior. If MaxSpoolTransmit is
set to five, for example, the printer will send the first five messages from the spool and then
transition to the NO SPOOL OUTPUT state, awaiting the next S6F23 request. There is no
event report generated when MaxSpoolTransmit is reached. The host is responsible for
determining this situation by a) counting the messages received, b) timing out waiting for the
next message, c) inquiring to the printer for the current value of the SpoolCountActual status
variable, or d) some combination of the above. If MaxSpoolTransmit is set to zero, the spool
will be transmitted completely in response to S6F23.
Normal spooling continues during the spool transmit process. If the SPOOL LOAD component
transitions to SPOOL FULL, it will not have any effect on the SPOOL UNLOAD component. Once
full, the spool cannot make the transition back to SPOOL NOT FULL except via the SPOOL
INACTIVE state. Space made available due to the spool unload process will not be used in this case.
When a multi-block message is to be transmitted from the spool, any required inquire/grant transaction
will be initiated. If the host's response denies permission to send the multi-block message, the printer
will discard that message and continue with the transmit process. This sequence will count as one
message in the MaxSpoolTransmit count.
There is one area where SPOOL LOAD and SPOOL UNLOAD may interact: When the spool is full
and OverWriteSpool is True. During the spool transmit process, spooled messages are being removed
and new primary messages are being written to the spool. These new messages are overwriting the
oldest messages available, unless the unload process has freed sufficient spool space.
There is a possibility that the unload and overwrite processes may compete for control of the same
message area. For example, if the spool holds messages ABCDE, with A oldest and E newest, A might
be sent to the host, B (and the space from A) overwritten by the new message F, C sent to the host, D
and E (and the space from message C) overwritten by G, etc. The loss of continuity may be
disorienting to the host program receiving the messages. It is expected that the unload process will be
fast relative to the generation of new messages, so that this occurrence will be rare.
If a communication failure occurs during the spool transmit process, spooling will continue as before
the transmit process began. However, the spool unload sequence will terminate.

GEM Manual for DEK Printers Capabilities
Issue 1.6 January 22, 2018 Page 55 of 171
Transition Table:
# Current State Trigger New State Action Comment
1 SPOOL
INACTIVE
Communications failure
detected.
SPOOL
ACTIVE
SpoolingCountActual
and SpoolCountTotal
are initialised to zero.
Any open transactions
with the host are
aborted.
SpoolStartTime is set
to current time.
The default state in each
OR substate is entered.
The message that could
not be sent remains in the
send queue and is dealt
with in the Spool Active
state. The collection
event Spooling Activated
has occurred.
2 SPOOL NOT
FULL
A message is generated that
will not fit in the spool area.
SPOOL FULL SpoolFullTime is set
to current time.
The message that would
not fit into the spool is
dealt with after the
transition. No collection
event is generated.
3 SPOOL
OUTPUT
Spool area emptied. SPOOL
INACTIVE
Spooling process
disabled. The operator
is informed that
spooling has been
terminated.
The collection event
Spooling Deactivated has
occurred. Transition
from the substate Spool
Load occurs.
4 NO SPOOL
OUTPUT
S6F23 received with RSDC
= 1.
PURGE
SPOOL
No Action Initiates purging process.
No collection event is
generated since this is
based on host request.
5 NO SPOOL
OUTPUT
S6F23 received with RSDC
= 0.
TRANSMIT
SPOOL
No Action Initiates message
transmission from spool.
No collection event is
generated since this is
based on host request.
6 TRANSMIT
SPOOL
Communication failure or
MaxSpoolTransmit reached.
NO SPOOL
OUTPUT
Spool transmission
process suspended.
If communications
failure, the event Spool
Transmit Failure has
occurred. No collection
event generated for
MaxSpoolTransmit
reached.
7 POWER ON Printer loses power. POWER OFF No Action Spooling context has
been maintained in non-
volatile storage prior to
this transition.
8 POWER OFF Power restored to Printer. POWER ON Spooling context
restored from non-
volatile memory.
If spooling were active
prior to power down, it
will continue. If
TRANSMIT SPOOL
was active at power
down, transition #6 is
expected to follow since
communications state is
initially NOT
COMMUNICATING.