Don't Use S2F25 as Your HSMS Heartbeat — Use Linktest and S1F1
One socket, 11 ms: an S2F25 loopback came back as an S2F0 abort while Linktest and S1F1 both answered. Where a host liveness check belongs.
I wired a host driver's 30-second heartbeat to S2F25, the Loopback Diagnostic Request. The equipment did not answer S2F26. It answered S2F0. The driver read that as "no response" and marked the tool offline. The socket never dropped. Throw a Linktest.req down the same socket and Linktest.rsp comes back inside 1 ms; throw an S1F1 and S1F2 arrives carrying MDLN and SOFTREV. The equipment was alive the whole time. What was dead was my liveness logic.
"Alive" means a different thing at each layer
Three things need separating before you design a liveness check, or you walk straight into this.
- The TCP connection — is the socket open, does
recvreturn something other than 0. No SECS knowledge involved. - The HSMS control layer — SEMI E37's SType messages. Send Linktest.req (SType 5), get Linktest.rsp (SType 6), and you know the peer's HSMS implementation is alive, parsing frames and writing replies. TCP can be open while the peer process is wedged; this is where that shows.
- The SECS-II data path — are real Sx/Fy transactions turning. The E30 communication state has to be open to COMMUNICATING, and the tool has to have implemented the function you are sending.
S2F25 tests layer 3. The Loopback Diagnostic Request as E5 defines it carries one binary item, ABS, in the body, and the equipment returns those same bytes in S2F26. Nothing beats it as a round trip through your encoder and decoder. There is exactly one problem: if the tool never implemented S2F25, layer 3 can be perfectly healthy and no reply arrives. That is the capture below.
The capture — one socket, 11 ms, six frames
Captured 2026-11-13. EQ1 on the simulator ran as a passive listener on 127.0.0.1:5501, driven from outside by one plain Python socket. The hex below is what the equipment side logged as RX/TX, and the times are measured at the host. Session ID is 00 0B (11). No fault flag was switched on. The raw export is committed at content/demos/s2f25-loopback-sxf0-hsms-heartbeat.json.
1. Select.req → Select.rsp
TX Select.req 00 00 00 0A 00 0B 00 00 00 01 00 00 02 01 t+0ms
RX Select.rsp 00 00 00 0A 00 0B 00 00 00 02 00 00 02 01 t+4ms
00 00 00 0A Length 10 — header only, no body
00 0B Session ID 11
00 Byte 2
00 Byte 3 — in a Select.rsp this is Select Status. 0 = accepted
00 PType 0
01 → 02 SType 1 = Select.req, 2 = Select.rsp
00 00 02 01 SystemBytes — the reply returns them unchanged
That reaches E37's SELECTED. None of it is SECS-II yet.
2. S1F13 → S1F14, COMMACK 0
TX S1F13 W 00 00 00 0C 00 0B 81 0D 00 00 00 00 02 02 01 00 t+4ms
RX S1F14 00 00 00 37 00 0B 01 0E 00 00 00 00 02 02
01 02 21 01 00 01 02 41 15 56 58 2D 39 30 30 30 20
50 6C 61 73 6D 61 20 45 74 63 68 65 72 41 0D 53 45
43 53 47 45 4D 2D 31 2E 34 2E 31 t+7ms
Byte 2 is 81: top bit is the W-bit, the remaining seven bits are Stream 1. Byte 3's 0D is Function 13. The body 01 00 is an L[0], a zero-length list.
The reply body is an L[2]. 21 01 00 is COMMACK 0, then an L[2] holding a 21-byte ASCII item starting 41 15, "VX-9000 Plasma Etcher", which is MDLN, and a 13-byte one starting 41 0D, "SECSGEM-1.4.1", which is SOFTREV. The E30 communication state is now COMMUNICATING. Before it opens, no data message except S1F13 gets through — that gate is worked out in bytes in SELECTED and S1F3 still comes back as S1F0.
3. S2F25 → S2F0. This is the whole article
TX S2F25 W 00 00 00 10 00 0B 82 19 00 00 00 00 02 03 21 04 DE AD BE EF t+7ms
RX S2F0 00 00 00 0A 00 0B 02 00 00 00 00 00 02 03 t+9ms
00 00 00 10 Length 16 = 10 header + 6 body
00 0B Session ID 11
82 W-bit 1 + Stream 2
19 Function 25
21 04 Binary item, one length byte, 4 bytes
DE AD BE EF ABS — the bytes I expected back
What came back is 14 bytes with a zero-length body. Byte 2 is 02, Byte 3 is 00. Stream 2, Function 0 — an abort. DE AD BE EF is nowhere in it.
4–5. On the same socket, Linktest and S1F1 were fine
TX Linktest.req 00 00 00 0A 00 0B 00 00 00 05 00 00 02 04 t+9ms
RX Linktest.rsp 00 00 00 0A 00 0B 00 00 00 06 00 00 02 04 t+10ms
TX S1F1 W 00 00 00 0A 00 0B 81 01 00 00 00 00 02 05 t+10ms
RX S1F2 00 00 00 32 00 0B 01 02 00 00 00 00 02 05
01 02 41 15 56 58 2D 39 30 30 30 20 50 6C 61 73 6D
61 20 45 74 63 68 65 72 41 0D 53 45 43 53 47 45 4D
2D 31 2E 34 2E 31 t+11ms
Linktest.rsp landed 1 ms after the S2F0. One millisecond after that, S1F2 arrived with MDLN and SOFTREV in an L[2]. S1F1 itself is a 14-byte header with no body at all (Byte 2 81 = W-bit + Stream 1, Byte 3 01). All three layers healthy; only the S2F25 aborted.
6. Separate.req
TX Separate.req 00 00 00 0A 00 0B 00 00 00 09 00 00 02 06 t+11ms
RX (nothing — the socket closed with a FIN)
SType 9 gets no reply, and that is correct.
The S2F0 carries my SystemBytes
Easy to miss. The S2F0's SystemBytes are 00 00 02 03 — the same value as the S2F25 I sent. So an SxF0 is the secondary message of my transaction, and receiving it stops T3 on the spot. There is no 45-second wait here. But the Stream is 2 and the Function is 0, so matching on "I expected an S2F26" finds nothing. Match on SystemBytes — the same rule as in matching pipelined requests on SystemBytes.
That is where this splits from the S9 family. A Stream 9 message like S9F7 is a new primary message the equipment opens, so it carries its own SystemBytes and the offending header rides in the body. It will not match your transaction table at all. Stream 9 error messages has that difference in bytes.
The S2F0 also tells you nothing about why. Unimplemented function, a closed communication gate, or "not right now" — fourteen bytes have no room for a reason. How to tell them apart is in one test that splits an S2F0 in two.
So what do you poll
Where I land:
- Link liveness: Linktest. It is the message E37 built for the job. Set the period as long as the tool tolerates. Working out which timer actually fired is in the HSMS timeout timers.
- Application liveness: S1F1. E5's Are You There Request is implemented by essentially every GEM tool, and it has no body. In the capture above S1F2 came back in 2 ms carrying MDLN and SOFTREV — the reply is itself proof that a SECS-II decoder is running.
- S2F25: once, at commissioning. Send it while setting the interface up and watch whether the ABS comes back untouched. That proves the encode/decode round trip. Used as a periodic heartbeat against a tool that never implemented it, you collect an S2F0 every 30 seconds and take a healthy link offline.
- Never read an SxF0 as "the tool is dead." A reply arriving means the peer received the frame, parsed it, and wrote to the socket. Declare a tool dead on silence — a T3 expiry — and on nothing else.
What I did not verify
- The S2F0 in this capture is this listener's choice. E5 also has a path where an unimplemented function draws S9F5, Unrecognized Function Type, and which one you get is implementation-dependent. I have not verified real equipment sending S9F5 against a tool.
- Whether GEM (E30) requires S2F25 support is not something this article verified, so it stays at "depends on the tool".
- I never captured a successful S2F26, because this listener does not implement S2F25. "It returns the ABS unchanged" is therefore E5's definition, not something this run demonstrated.
You can push the hex above straight into the SECS/GEM simulator as it stands. Lining it up byte for byte against the frames your own driver builds is the fastest way through.