Spooling State Model¶
1. Overview¶
The Spooling capability allows the equipment to store messages that cannot be delivered to the host due to communication failure. When communication is restored, spooled messages are transmitted to the host in order.
2. Spooling State Diagram¶
stateDiagram-v2
[*] --> SPOOL_INACTIVE
SPOOL_INACTIVE --> SPOOL_ACTIVE: Communication Lost & Spooling Enabled
SPOOL_ACTIVE --> SPOOL_TRANSMITTING: Communication Restored
SPOOL_TRANSMITTING --> SPOOL_INACTIVE: All Messages Transmitted
SPOOL_TRANSMITTING --> SPOOL_ACTIVE: Communication Lost Again
SPOOL_ACTIVE --> SPOOL_INACTIVE: Spool Purged / Disabled
SPOOL_ACTIVE --> SPOOL_FULL: Spool Capacity Reached
SPOOL_FULL --> SPOOL_TRANSMITTING: Communication Restored
SPOOL_FULL --> SPOOL_INACTIVE: Spool Purged
3. State Definitions¶
| State | Description |
|---|---|
| SPOOL INACTIVE | Normal operation. Messages are sent directly to host. |
| SPOOL ACTIVE | Communication lost. Messages are being stored in spool. |
| SPOOL FULL | Spool has reached capacity. Oldest messages may be overwritten. |
| SPOOL TRANSMITTING | Spooled messages are being transmitted to host. |
4. Transition Table¶
| # | Current State | Trigger | Next State | Action |
|---|---|---|---|---|
| 1 | SPOOL INACTIVE | Communication failure | SPOOL ACTIVE | Begin spooling messages |
| 2 | SPOOL INACTIVE | Host requests spool (S2F43) | SPOOL INACTIVE | Configure spool streams |
| 3 | SPOOL ACTIVE | Communication restored | SPOOL TRANSMITTING | Begin transmitting spool |
| 4 | SPOOL ACTIVE | Capacity reached | SPOOL FULL | Handle overflow |
| 5 | SPOOL ACTIVE | Spool disabled/purged | SPOOL INACTIVE | Clear spool |
| 6 | SPOOL FULL | Communication restored | SPOOL TRANSMITTING | Begin transmitting spool |
| 7 | SPOOL FULL | Spool purged | SPOOL INACTIVE | Clear spool |
| 8 | SPOOL TRANSMITTING | All messages sent | SPOOL INACTIVE | Resume normal operation |
| 9 | SPOOL TRANSMITTING | Communication lost | SPOOL ACTIVE | Continue spooling |
5. Spooling Configuration¶
5.1 Spoolable Streams¶
| Stream | Function | Spool | Notes |
|---|---|---|---|
| S5 | Alarm Messages | Yes | All alarm events spooled |
| S6 | Collection Events | Yes | Event reports spooled |
| S6 | Trace Data | [Yes/No] |
Trace reports (configurable) |
5.2 Spool Parameters¶
| Parameter | Value | Description |
|---|---|---|
| Max Spool Size | [10000] messages |
Maximum messages in spool |
| Overflow Action | [Overwrite Oldest / Reject New] |
Action when spool full |
| Spool Streams | S5, S6 | Streams to spool |
6. Related Messages¶
| Message | Direction | Description |
|---|---|---|
| S2F43 | H→E | Define Spool Streams |
| S2F44 | E→H | Define Spool Acknowledge |
| S6F23 | E→H | Request Spooled Data |
| S6F24 | H→E | Spooled Data Request Grant |
6.1 S2F43 - Define Spool Streams¶
Structure:
6.2 S2F44 - Define Spool Acknowledge¶
Structure:
STSPACK Values:
| Value | Description |
|---|---|
| 0 | OK, spool defined |
| 1 | Stream not valid |
| 2 | Stream not supported for spooling |
6.3 S6F23 - Request Spooled Data¶
When communication is restored, equipment may request permission to transmit spooled data:
Structure:
6.4 S6F24 - Spooled Data Request Grant¶
Structure:
7. Spool Transmission Sequence¶
sequenceDiagram
participant Host
participant Equipment
Note over Equipment: Communication Restored
Equipment->>Host: S6F23 (RSDC=150)
Host-->>Equipment: S6F24 (RSDA=0, Transmit)
Note over Equipment: Begin Spool Transmission
loop For each spooled message
Equipment->>Host: Spooled Message (S5F1, S6F11, etc.)
Host-->>Equipment: Acknowledge
end
Equipment->>Host: S6F11 (SpoolTransmitComplete)
Host-->>Equipment: S6F12
Note over Equipment: State: SPOOL INACTIVE
8. Related Status Variables¶
| SVID | Name | Type | Description |
|---|---|---|---|
[4001] |
SpoolState | U1 | Current spooling state |
[4002] |
SpoolCount | U4 | Number of messages in spool |
[4003] |
SpoolCapacity | U4 | Maximum spool capacity |
[4004] |
SpoolOverflowCount | U4 | Messages lost due to overflow |
SpoolState Values:
| Value | State |
|---|---|
| 0 | SPOOL INACTIVE |
| 1 | SPOOL ACTIVE |
| 2 | SPOOL FULL |
| 3 | SPOOL TRANSMITTING |
9. Related Collection Events¶
| CEID | Name | Description |
|---|---|---|
[4001] |
SpoolActivated | Spooling started due to communication loss |
[4002] |
SpoolFull | Spool capacity reached |
[4003] |
SpoolTransmitStart | Beginning spool transmission |
[4004] |
SpoolTransmitComplete | All spooled messages transmitted |
[4005] |
SpoolPurged | Spool has been purged |
10. Related Alarms¶
| ALID | ALTX | Category | Description |
|---|---|---|---|
[4001] |
Spool Overflow | Warning | Spool capacity reached, messages may be lost |
11. Implementation Notes¶
11.1 Spool Storage¶
- Spooled messages are stored in non-volatile memory
- Messages are preserved across equipment restarts
- FIFO ordering is maintained
11.2 Transmission Order¶
When transmitting spooled messages: 1. Messages are sent in chronological order (oldest first) 2. Equipment waits for acknowledgment before sending next message 3. If transmission fails, message remains in spool
11.3 Spool Purge¶
Spool can be purged by: - Host command (S2F43 with STSPM=2) - Operator action (if permitted) - Automatic purge on overflow (if configured)