Scenario: Communication Establishment¶
1. Overview¶
This scenario describes the complete communication establishment sequence between the host and equipment, from TCP connection to ONLINE REMOTE state.
2. Preconditions¶
| Condition | Status |
|---|---|
| Equipment powered on | Yes |
| Network connected | Yes |
| HSMS configured | Yes |
| Equipment in correct state | OFFLINE or HOST OFFLINE |
3. Complete Sequence Diagram¶
sequenceDiagram
participant Host
participant Equipment
rect rgb(240, 248, 255)
Note over Host,Equipment: Phase 1: TCP/IP Connection
Host->>Equipment: TCP SYN
Equipment-->>Host: TCP SYN-ACK
Host->>Equipment: TCP ACK
Note over Host,Equipment: TCP Connection Established
end
rect rgb(255, 248, 240)
Note over Host,Equipment: Phase 2: HSMS Selection
Host->>Equipment: Select.req (SType=1)
Equipment-->>Host: Select.rsp (SType=2, Status=0)
Note over Host,Equipment: HSMS Session Selected
end
rect rgb(240, 255, 240)
Note over Host,Equipment: Phase 3: SECS-II Communication
Host->>Equipment: S1F13 W (Establish Communication)
Note over Equipment: Validate request
Equipment-->>Host: S1F14 (COMMACK=0, MDLN, SOFTREV)
Note over Equipment: State: COMMUNICATING
end
rect rgb(255, 240, 255)
Note over Host,Equipment: Phase 4: Online Transition
Host->>Equipment: S1F17 W (Request Online)
Note over Equipment: Check if online allowed
Equipment-->>Host: S1F18 (ONLACK=0)
Note over Equipment: State: ONLINE LOCAL
end
rect rgb(255, 255, 240)
Note over Host,Equipment: Phase 5: Initial Status Exchange
Host->>Equipment: S1F3 W (Status Request)
Equipment-->>Host: S1F4 (Status Variables)
Host->>Equipment: S5F5 W (Alarm List Request)
Equipment-->>Host: S5F6 (Active Alarms)
end
4. Phase Details¶
4.1 Phase 1: TCP/IP Connection¶
Equipment waits for incoming TCP connection on configured port.
| Equipment Mode | Behavior |
|---|---|
| PASSIVE | Equipment listens, host connects |
| ACTIVE | Equipment initiates connection to host |
Timeout: T5 (Connection Separation) applies if reconnecting after failure.
4.2 Phase 2: HSMS Selection¶
Select.req Header Format:
| Byte | Value | Description |
|---|---|---|
| 0-3 | 0x00000000 | Message length (0 for control msg) |
| 4-5 | 0xFFFF | Session ID |
| 6 | 0x00 | Header Byte 2 |
| 7 | 0x00 | Header Byte 3 |
| 8 | 0x00 | PType |
| 9 | 0x01 | SType (Select.req) |
| 10-13 | System Bytes | Transaction ID |
Select.rsp Status:
| Value | Description |
|---|---|
| 0 | Communication established |
| 1 | Communication already active |
| 2 | Communication not ready |
| 3 | Connection exhaust |
Timeout: T6 (Control Transaction) applies.
4.3 Phase 3: SECS-II Establish Communication¶
S1F13 Structure:
S1F14 Structure:
COMMACK Values:
| Value | Description | Next Action |
|---|---|---|
| 0 | Accepted | Proceed to Online |
| 1 | Denied, Try Again | Retry after delay |
4.4 Phase 4: Online Transition¶
S1F17 Structure:
S1F18 Structure:
ONLACK Values:
| Value | Description | Next Action |
|---|---|---|
| 0 | Accepted | Equipment is ONLINE |
| 1 | Not Accepted, already online | No action needed |
| 2 | Not Accepted, equipment offline | Wait or operator action |
4.5 Phase 5: Initial Status Exchange¶
Host typically queries: - Equipment status variables (S1F3/F4) - Active alarms (S5F5/F6) - Enabled events and reports - Current process state
5. Error Handling¶
5.1 TCP Connection Failure¶
sequenceDiagram
participant Host
participant Equipment
Host->>Equipment: TCP SYN
Note over Equipment: No response
Note over Host: Connection timeout
Note over Host: Wait T5, retry
5.2 Select Rejected¶
sequenceDiagram
participant Host
participant Equipment
Host->>Equipment: Select.req
Equipment-->>Host: Select.rsp (Status=2, Not Ready)
Note over Host: Wait and retry
5.3 Communication Denied¶
sequenceDiagram
participant Host
participant Equipment
Host->>Equipment: S1F13 W
Equipment-->>Host: S1F14 (COMMACK=1)
Note over Host: Retry after delay
5.4 Online Rejected¶
sequenceDiagram
participant Host
participant Equipment
Host->>Equipment: S1F17 W
Equipment-->>Host: S1F18 (ONLACK=2)
Note over Host: Equipment requires operator action
6. State Transitions¶
| Step | Equipment State Before | Equipment State After |
|---|---|---|
| TCP Connect | NOT CONNECTED | NOT SELECTED |
| HSMS Select | NOT SELECTED | SELECTED |
| S1F13/F14 | NOT COMMUNICATING | COMMUNICATING |
| S1F17/F18 | HOST OFFLINE | ONLINE LOCAL |
7. Collection Events Generated¶
| Event | CEID | When |
|---|---|---|
| CommunicationEstablished | 1001 | After S1F14 (COMMACK=0) |
| ControlStateChange | 2001 | After S1F18 (ONLACK=0) |
| OnlineLocal | 2003 | After entering ONLINE LOCAL |
8. Timing Summary¶
| Phase | Timeout | Default |
|---|---|---|
| TCP Connect | Application defined | 10 sec |
| Select | T6 | 5 sec |
| S1F13 Reply | T3 | 45 sec |
| S1F17 Reply | T3 | 45 sec |
9. Linktest Recommendation¶
After communication is established, implement periodic linktest:
sequenceDiagram
participant Host
participant Equipment
loop Every 30 seconds
Host->>Equipment: Linktest.req
Equipment-->>Host: Linktest.rsp
end
This ensures connection health and prevents T7 timeout on idle connections.