Probe S2F47 Before You Put a Threshold in the Tool
A capture where S2F45 and S2F47 both drew S2F0 while S1F3 kept answering. GEM limits monitoring is optional, and thresholds belong in the host.
The request was to raise an MES warning when process temperature goes above 70 degrees. GEM has a feature for exactly that: limits monitoring. Put an upper limit on a variable and the equipment raises a collection event the moment the value crosses it, with no host polling. So I sent an S2F45. What came back was S2F0, not S2F46. S2F47, which only reads, came back the same way. Yet S1F3 on that same socket answered S1F4 immediately. The gate was open. This tool simply does not have limits monitoring.
The capture
Taken with a Python socket straight onto 127.0.0.1:5501. Only exchanges the equipment side logged as RX are listed here.
Select.req went out, Select Status 0 came back, then S1F13 opened the gate.
TX S1F13 00 00 00 23 00 0B 81 0D 00 00 00 00 51 02 01 02 41 10 53 43 41 44 41 54 48 49 4E 47 53 2D 48 4F 53 54 41 03 31 2E 30
RX S1F14 00 00 00 37 00 0B 01 0E 00 00 00 00 51 02 01 02 21 01 00 01 02 41 15 56 58 2D 39 30 30 30 ...
The top bit of 81 0D is the W-bit, the low seven bits are Stream 1, and 0D is Function 13. The first item of the reply body, 21 01 00, is B[1] 0 — COMMACK 0. E30 communication is open from here on.
Next the control. S1F3 with a zero-length list.
TX S1F3 00 00 00 0C 00 0B 81 03 00 00 00 00 51 03 01 00
RX S1F4 00 00 00 31 00 0B 01 04 00 00 00 00 51 03 01 04 41 04 49 64 6C 65 81 08 40 37 94 7A E1 47 AE 14 ...
01 00 is the zero-length list. Four values came back, carrying SystemBytes 00 00 51 03 unchanged.
Now the S2F45. DATAID 1, LIMITID 1 on VID 101, with UPPERDB 70.0 and LOWERDB 68.0 as F8.
TX S2F45 00 00 00 37 00 0B 82 2D 00 00 00 00 51 04 01 02 B1 04 00 00 00 01 01 01 01 02 B1 04 00 00 00 65 01 01 01 03 A5 01 01 81 08 40 51 80 00 00 00 00 00 81 08 40 51 00 00 00 00 00 00
RX S2F0 00 00 00 0A 00 0B 02 00 00 00 00 00 51 04
The length field 00 00 00 37 is 55: a 10-byte header and a 45-byte body. 82 2D is the W-bit plus Stream 2, Function 45. B1 04 00 00 00 65 is U4 101, and 81 08 40 51 80 00 00 00 00 00 is F8 70.0.
The reply is a 14-byte frame whose length field reads 10. Header only, no body. 02 00 is Stream 2 with the W-bit clear, Function 0. SystemBytes 00 00 51 04 matches the request. That is an S2F0.
S2F47 only reads, so I tried it as well, with a zero-length list.
TX S2F47 00 00 00 0C 00 0B 82 2F 00 00 00 00 51 05 01 00
RX S2F0 00 00 00 0A 00 0B 02 00 00 00 00 00 51 05
Same answer. Then one more S1F3 right behind it.
TX S1F3 00 00 00 0C 00 0B 81 03 00 00 00 00 51 06 01 00
RX S1F4 00 00 00 31 00 0B 01 04 00 00 00 00 51 06 01 04 41 04 49 64 6C 65 81 08 40 37 C5 1E B8 51 EB 85 ...
That last round trip is the part of the capture that matters. After two S2F0s the session is alive and data messages still answer normally. The socket did not die and the gate did not close. One explanation is left: this tool does not implement S2F45 or S2F47.
An S2F0 on its own proves nothing
Byte for byte, an unimplemented function and a closed E30 communication gate are the same thing — an empty SxF0 whose only matching field is SystemBytes. That is why the control matters. Confirm S1F3 answers on this socket first, then read the S2F0 from the function you are probing. Do it in the other order and you have proved nothing. Reading SxF0 replies is worked through at length in the S2F23 capture.
E30 files limits monitoring under optional
This is the whole point. E30 separates fundamental requirements from additional capabilities, and limits monitoring sits in the second group. It is not like communication establishment or alarms, where a tool missing them cannot call itself GEM. A GEM-certified tool can have no limits monitoring at all and still be compliant. An interface spec that says "GEM compliant" is not a promise that S2F45 will work.
E5 defines four functions here.
| Function | Name | Direction |
|---|---|---|
| S2F45 | Define Variable Limit Attributes | host → equipment |
| S2F46 | Variable Limit Attribute Acknowledge | equipment → host |
| S2F47 | Variable Limit Attribute Request | host → equipment |
| S2F48 | Variable Limit Attribute Send | equipment → host |
S2F46 returns a VLAACK for the whole request plus per-variable acknowledge codes. I am not writing those code values down from memory. Read them out of E5's S2F46 definition, because I have never received an S2F46 from a tool that implements limits monitoring. I have not verified them.
If it is implemented, the work is not over
A successful S2F46 is not the finish line. The output of limits monitoring is a collection event: the equipment raises one when a variable moves from one zone into another, and each LIMITID carries an UPPERDB and a LOWERDB giving the boundary width on both sides. That width is the anti-chatter device. Cut sharply at 70.0 and a value drifting between 69.99 and 70.01 produces dozens of events.
For any of those events to reach the host, the reporting has to be set up separately — define a report with S2F33, link it to the CEID with S2F35, enable it with S2F37. A limit defined with no report link does nothing. It does not even leave a log line. This is where the time goes.
Do not type the VID in by hand either. Pick it out of the list S1F11 returns.
My opinion: the threshold belongs in the host
Even on a tool that supports limits monitoring, I do not put the threshold there. One reason. A 70.0 stored in the equipment is a configuration value that is not in my repository. Someone changes it at the tool and no diff shows it, no code review sees it, and swapping the equipment controller at the next PM quietly loses it. Six months later you get asked why the warning stopped, and the first thing you have to go open is a screen on the tool.
Polling S1F3 and comparing in host code is slower and less elegant. But the threshold is in code. Whoever changed it is in a commit. You can write a test for it.
There is a case where limits monitoring wins: a spike too short for a one-second poll to catch. The equipment samples internally far faster than any host poll. Use it when that requirement is explicit, and even then have the host push the threshold down with S2F45 on every connect, so the host-side value stays the source of truth.
Checklist
- Get COMMACK 0 from S1F13 first. Probe before that and everything is an S2F0.
- Confirm S1F3 answers with S1F4. That is your control.
- Send S2F47 with a zero-length list. It only reads, so it touches no equipment state. Probe with this one, not S2F45.
- If S2F0 comes back, write "no limits monitoring" into the interface spec and go to polling.
- If S2F48 comes back, check the VLAACK codes against E5 and log what you received.
- Once a limit is defined, check S2F33, S2F35 and S2F37 are all done.
What I have not verified
This capture is from a tool that does not have limits monitoring. The unimplemented reply, the fact that the gate was open, and the fact that the session survived are the whole of what I confirmed in bytes. The VLAACK values in S2F46, which CEID a zone transition actually produces, and whether a tool refuses overlapping UPPERDB and LOWERDB values are all unverified. I have no equipment that would settle them.
To run the same sequence yourself, open a socket against the passive listener in the SECS/GEM simulator. The raw packet log behind this article is in the repository at content/demos/s2f45-s2f47-limits-monitoring-host-side.json.