After an HSMS Reconnect, Resend S1F13 — Not S1F17
A reconnected host's S2F41 came back as S2F0. Two socket captures: the GEM communication state resets on a drop, the control state does not.
The link dropped once overnight. The host reopens TCP, gets Select.rsp 0, and pushes the S2F41 START that was still sitting in its queue. Ten bytes come back. S2F0. This is the same tool that answered the same command with HCACK 0 a minute earlier.
What a drop erases on the equipment, and what it leaves behind, is the whole article. Measure it with two sockets and the two halves separate cleanly. The GEM communication state resets when the connection goes; the control state stays.
First socket: the normal path
I opened a Python socket against the passive listener and played the host. Round-trip times are measured on the host side, and SystemBytes count up from 70 01.
TX Select.req 00 00 00 0A 00 0B 00 00 00 01 00 00 70 01
RX Select.rsp 00 00 00 0A 00 0B 00 00 00 02 00 00 70 01 (7.2ms)
SessionID 00 0B is 11. The four leading bytes are the length, and the SEMI E37 message header is the ten after it: Session ID, Byte 2, Byte 3, PType, SType, then four System Bytes. The length counts header plus body and not itself, which is why a header-only control message reads 00 00 00 0A.
The sixth header byte is the SType. The SType table in SEMI E37 gives 01 for Select.req and 02 for Select.rsp — and 09 for the Separate.req further down. In a Select.rsp, Byte 3 carries the Select Status in the slot a data message uses for its Function. 00 here, accepted. HSMS is now SELECTED.
TX S1F13 W 00 00 00 17 00 0B 81 0D 00 00 00 00 70 02 01 02 41 04 48 4F 53 54 41 03 31 2E 30
RX S1F14 00 00 00 37 00 0B 01 0E 00 00 00 00 70 02 01 02 21 01 00 01 02 41 15 ... 41 0D ... (5.4ms)
The body is L[2]{A "HOST", A "1.0"} — the host's own name and version slots. The S1F14 that comes back holds L[2]{B 0, L[2]{MDLN, SOFTREV}}, and 21 01 00 is COMMACK 0. The communication state model of SEMI E30 moves to COMMUNICATING right here.
TX S1F17 W 00 00 00 0A 00 0B 81 11 00 00 00 00 70 03
RX S1F18 00 00 00 0D 00 0B 01 12 00 00 00 00 70 03 21 01 00 (1.1ms)
A 14-byte request with no body. Byte 2 is 81, so W-bit 1 and Stream 1, and byte 3 11 is 17. The answer is 21 01 00 — a bare one-byte Binary item, not a list: ONLACK 0. The control state has gone to ON-LINE REMOTE.
TX S2F41 W 00 00 00 15 00 0B 82 29 00 00 00 00 70 04 01 02 41 05 53 54 41 52 54 01 00
RX S2F42 00 00 00 11 00 0B 02 2A 00 00 00 00 70 04 01 02 21 01 00 01 00 (0.9ms)
01 02 41 05 53 54 41 52 54 01 00 is L[2]{A "START", L[0]}, a START with no parameters. The reply is L[2]{B 0, L[0]} — HCACK 0 and an empty CPACK list. The command took.
Nothing new so far; that is the happy path from the article on HCACK 2 and control states. Now cut the link.
TX Separate.req 00 00 00 0A 00 0B 00 00 00 09 00 00 70 05
(no reply, TCP close)
Second socket: the same command comes back S2F0
Two seconds later, back to the same port. Select is identical.
TX Select.req 00 00 00 0A 00 0B 00 00 00 01 00 00 70 06
RX Select.rsp 00 00 00 0A 00 0B 00 00 00 02 00 00 70 06 (1.9ms)
Then the same S2F41 that worked a moment ago.
TX S2F41 W 00 00 00 15 00 0B 82 29 00 00 00 00 70 07 01 02 41 05 53 54 41 52 54 01 00
RX S2F0 00 00 00 0A 00 0B 02 00 00 00 00 00 70 07 (2.5ms)
The length is 10. There is no body at all. Byte 2 is 02 — W-bit 0, Stream 2 — and byte 3 is 00, Function 0. In SEMI E5, Function 0 in any stream aborts the transaction: "your request ends here, there is no answer."
Two things to read off it. First, SystemBytes 70 07 match the request, so the abort is the other half of your transaction, matches on SystemBytes, and stops T3 the moment it lands. Second, it arrived in 2.5 ms. This is not a timeout. The equipment answered, and the content of the answer was "no". A host that logs this as "no response" files the wrong ticket with the vendor. Telling the timers apart is its own article.
One S1F13 brings it back
TX S1F13 W 00 00 00 17 00 0B 81 0D 00 00 00 00 70 08 01 02 41 04 48 4F 53 54 41 03 31 2E 30
RX S1F14 00 00 00 37 00 0B 01 0E 00 00 00 00 70 08 01 02 21 01 00 01 02 41 15 ... 41 0D ... (0.2ms)
Byte for byte the first socket's S1F13 with different SystemBytes. COMMACK 0, communication state restored. That skipping S1F13 after SELECTED aborts every data message except S1F13 is the gate covered in SELECTED is not communicating and the E30 communication gate. What this capture adds is that the same gate is closed again after a reconnect.
No S1F17 was sent, and HCACK is 0
TX S2F41 W 00 00 00 15 00 0B 82 29 00 00 00 00 70 09 01 02 41 05 53 54 41 52 54 01 00
RX S2F42 00 00 00 11 00 0B 02 2A 00 00 00 00 70 09 01 02 21 01 00 01 00 (2.0ms)
There is no S1F17 anywhere on the second socket. HCACK is 0 regardless. The body is L[2]{B 0, L[0]}, the same bytes as the first socket's fourth exchange apart from SystemBytes.
That is the result. Across one socket closing and another opening, the communication state fell to NOT COMMUNICATING and the control state stayed at ON-LINE REMOTE. The only thing the host has to redo is S1F13.
Which part is the standard and which part is this tool
A line has to be drawn here.
SEMI E30 carries two separate state models, and that is the whole point. Its communication state answers whether the host and the equipment are communicating at all, and the key from NOT COMMUNICATING to COMMUNICATING is the S1F13/S1F14 exchange. Lose the connection and that state goes with it — the capture above shows it. The control state answers a different question: whether the equipment is in a condition to accept host commands, meaning OFF-LINE, ON-LINE LOCAL or ON-LINE REMOTE. The fact that a link dropped says nothing about that condition.
Writing that every tool behaves this way would be a lie. The numbers above come from one listener. Which control state a tool powers up in is an equipment setting, and whether any tool reapplies that setting on a link drop and falls back to OFF-LINE is something I have not verified against real equipment. The other direction is unverified too: what ONLACK an S1F17 draws while the tool sits in ON-LINE LOCAL cannot be reproduced on this listener, which answers every S1F17 with a fixed 21 01 00.
So the rule a host can act on comes from the cost comparison, not from the measurement.
The reconnect sequence, four lines
- Send Select.req, then S1F13, unconditionally, on every TCP connect. No condition on it. That the previous session reached COMMUNICATING means nothing on a new socket.
- Send S1F17 unconditionally too. The cost is one round trip. Skipping it saves a millisecond; being wrong about it means firing a command at a tool sitting in LOCAL and spending half an hour on the HCACK 2 that comes back. Even where the control state survived, as above, the extra S1F17 costs nothing.
- Do not hold commands in a queue across a disconnect. Flush the queue straight after a reconnect and the first command disappears into an S2F0. Release it after the handshake completes, or drop it and let the layer above decide again.
- Never log SxF0 on the same line as "no response". An abort is a legitimate reply and it carries a stream and function number. Without that distinction, a day goes into searching the network.
Treating the host's own cached control state as grounds for a recovery decision is the same trap. Even an ONLACK 0 in S1F18 does not say which ON-LINE sub-state you landed in. The only real verdict is firing one S2F41 and reading the HCACK.
The capture above came out of hitting the passive listener of the SECS/GEM simulator from outside over a socket. Every frame is logged as RX on the equipment side, so open the same two sockets yourself and watch what your driver sends on the second one.