Only Select.rsp Tells You the Tool's Real HSMS Session ID
Real captures: data message replies echo any Session ID you invent, and Select.rsp is the one frame that returns the tool's own.
The vendor manual lists a Session ID in two places and the two values disagree. You pick one, put it in the host config, send Select — Select Status 00, accepted. You send S1F1 and S1F2 comes back in 0.6 ms with the Session ID you sent. Everything looks right. It isn't. On an HSMS connection, Select.rsp is the only frame that checks the Session ID you sent, and a data message reply hands back whatever you put in it. The capture below came from a plain Python socket opened against the passive listener at 127.0.0.1:5501. Select.rsp ignored the 12 I sent and returned the equipment's own 11; the S1F2 right behind it returned that same 12 unchanged.
Captured 2026-11-23 with no equipment faults set — {} confirmed before and {} again afterwards. The raw export is committed at content/demos/hsms-session-id-echo-vs-select-rsp.json. Every hex string below is a frame the equipment side logged as RX. None of it is synthesised.
The connection that's actually correct
This equipment's Session ID is 11. E37 puts the SessionID in bytes 0–1 of the ten-byte header.
00:04:00.670 TX Select.req 00 00 00 0A 00 0B 00 00 00 01 00 00 50 01
00:04:00.672 RX Select.rsp 00 00 00 0A 00 0B 00 00 00 02 00 00 50 01
00 0B (11) went out and 00 0B came back. Byte 3 is 00, Select Status 0, accepted (reading a Select.rsp). Then S1F13 to open the communication gate so data messages aren't aborted.
00:04:00.674 TX S1F13 W 00 00 00 0C 00 0B 81 0D 00 00 00 00 50 02 01 00
00:04:00.685 RX S1F14 00 00 00 37 00 0B 01 0E 00 00 00 00 50 02 01 02 21 01 00 ...
21 01 00 is COMMACK 0. Worth noticing: the S1F13 body I sent was 01 00 — a List with zero elements, no MDLN and no SOFTREV. COMMACK 0 came back anyway. This listener is permissive, and the equipment accepting something is not evidence that what you sent was right. That is the whole article.
Select with a Session ID that doesn't exist
Same socket, SessionID 12 this time.
00:04:00.690 TX Select.req 00 00 00 0A 00 0C 00 00 00 01 00 00 50 03
00:04:00.690 RX Select.rsp 00 00 00 0A 00 0B 00 00 00 02 00 00 50 03
Out went 00 0C (12); back came 00 0B (11). SystemBytes 00 00 50 03 echoed unchanged and byte 3 is 00. Accepted. There is no session 12, and no refusal arrived.
Same with 0xFFFF.
00:04:00.695 TX Select.req 00 00 00 0A FF FF 00 00 00 01 00 00 50 05
00:04:00.695 RX Select.rsp 00 00 00 0A 00 0B 00 00 00 02 00 00 50 05
Identical. FF FF out, 00 0B back, Select Status 0. This listener never looks at the incoming SessionID — it writes its own and sends.
The direction matters here. Equipment answering under a different SessionID is a separate article about the equipment's side of it. This is the reverse. The wrong value came from my host, Select.rsp is telling me so, and nobody reads it because the Status says 0.
The data path will lie to you
Same connection, S1F1 with SessionID 12.
00:04:00.693 TX S1F1 W 00 00 00 0A 00 0C 81 01 00 00 00 00 50 04
00:04:00.693 RX S1F2 00 00 00 32 00 0C 01 02 00 00 00 00 50 04 01 02 41 15 56 58 2D 39 30 30 30 ...
00 0C out, 00 0C back. The body carries MDLN VX-9000 Plasma Etcher and SOFTREV SECSGEM-1.4.1 exactly as it should. 0xFFFF behaves the same way.
00:04:00.697 TX S1F1 W 00 00 00 0A FF FF 81 01 00 00 00 00 50 06
00:04:00.697 RX S1F2 00 00 00 32 FF FF 01 02 00 00 00 00 50 06 01 02 41 15 ...
FF FF returns as FF FF. And going back to 11 still works.
00:04:00.699 TX S1F1 W 00 00 00 0A 00 0B 81 01 00 00 00 00 50 07
00:04:00.699 RX S1F2 00 00 00 32 00 0B 01 02 00 00 00 00 50 07 ...
All three values work. Three S1F1s on one connection, with 11, 12 and 0xFFFF, all drew an S1F2, and each one got its own value handed back.
The echo is not a bug. A secondary message carrying the primary's SessionID and SystemBytes back is what E37 specifies, and that pair is what lets a host match a transaction at all. The consequence is that an echoed field cannot validate anything. You get back the number you wrote. It's a mirror, and you're using it as a check.
Which side breaks
What I measured is one listener's behaviour. Real equipment will likely act differently and I have not verified this against a tool. E37's Select Status table names 1 as Communication Already Active, so refusing a second Select.req on an already-SELECTED connection with a 1 is the standard-conforming answer. This capture returned 0. That's a citation, not a measurement.
The direction of the failure is the nasty part for a host developer. Develop against permissive equipment and a wrong Session ID passes end to end. Then integration puts you in front of strict equipment, nothing in your code changed, and either Select refuses you or data messages get dropped in silence. What you go and suspect is the network. What did it is a number somebody typed into a config file months earlier.
The single-session point is worth holding onto alongside it. E37.1 (HSMS-SS) has one session, so the Session ID is not a selector that picks a session — it's a constant for the life of the connection. There is a separate subsidiary standard covering multiple sessions, but I do not have its text and have not verified what it specifies. For anyone connecting to GEM equipment, one conclusion covers it: the value comes out of the vendor manual, and it is not yours to choose.
What to put in the host code
- Compare Select.rsp's SessionID against the value you sent, and log it. Different means a warning. A warning even when the Status is 0. The entire failure in this article dies on that one line.
- When that comparison disagrees, stop — don't adopt the value the equipment returned. Adopting it works, and anything that works never gets its config fixed.
- Validate nothing against a data message reply's SessionID. It's an echo, so it always matches. Pair transactions on SystemBytes.
- Write the source next to the Session ID in your config: which page of which vendor manual. A bare number leaves the next person unable to tell a measurement from a guess.
- Don't collapse Device ID and Session ID into one field. This equipment is Session ID 11, Device ID 1. Any stack that merges them gets one of the two wrong the moment they differ.
Every capture above came from a socket opened directly against the passive listener in the SECS/GEM simulator. To reproduce it, change nothing but the SessionID in your Select.req and read bytes 0–1 of the Select.rsp that comes back.