[subexp-daq] Accessing subevents' procID inside UNPACK_EVENT_USER_FUNCTION

Håkan T Johansson f96hajo at chalmers.se
Sun Apr 20 12:34:52 CEST 2025


Hi!

Thanks to some insistent requesting by Martin, ucesb now finally can give 
away the subevent header values inside a subevent.

When a parameter in a SUBEVENT declaration is one of the subevent header 
values (type, subtype, control, subcrate/crate, procid) and it is not an 
argument being matched in the EVENT declaration, then the header value is 
passed along.  (If matched, the fixed value is sent.)

It can then be remembered using ENCODE for a MEMBER variable.

One still would need to be careful if several subevents match such a 
'catch-all' specification.

Example:

---

SUBEVENT(SUBEV_WITH_HEADER_PARAM, subcrate, procid)
{
   MEMBER(DATA32 value32);

   ENCODE(value32,(value = procid));
}

EVENT
{
   ...

   whp = SUBEV_WITH_HEADER_PARAM(type=76);
}

---

Side-note: the xtst/xtst.spec unpacker is not a actual experiment. It is 
used to test the specification parser and code generator, so may give 
ideas of what the parser might eat.

Cheers,
Håkan


More information about the subexp-daq mailing list