Expand description
Read planner: one read of a struct instead of several reads of its members, which are sliced out of it.
A poll costs about 12 ms per packet plus 1.35 ms per read service, so fewer reads matter, but an extra packet
costs far more than a few reads. For the tags of one cycle, a struct (a tag, an array element or a nested
member, at most whole_max_bytes) or a run of elements of one atomic array (A[3]{5}) replaces the reads of
the tags under it when that pays: groups are taken best first by extra reply bytes per read saved, each only if
it costs at most BYTES_PER_READ extra reply bytes per read saved and the cycle’s estimated packet count does
not grow over plain reads. A together struct is always read whole.
Structs§
- Read
- One read service of a plan and the requested tags it serves.
Enums§
- Key
- A slice step into a read value.
Constants§
- BYTES_
PER_ READ - One read service (~1.35 ms) costs about as much packet time as this many reply bytes.
- PACKET_
BYTES - Request and reply budget of a packet when the driver has no connection size.
- VERSION_
REPLY - Reply bytes of ciplink’s tag table version check.
- VERSION_
REQUEST - Request bytes of ciplink’s tag table version check, sent in every packet with instance IDs.
Functions§
- chunks
reads(a plan) split into lists of about one packet each, packed aspacketscounts them.- dig
- The part of a read value at
path(member names ignoring case, array indexes), None if it isn’t there. - execute
- Runs a plan split in chunks, one
plc.readper chunk;between(plc, partial results)runs after every chunk but the last (the worker publishes those results and runs queued writes there), and its results are left out of the returned ones. Returns (results by tag, names of failed group reads, read services sent). The members of failed group reads are read one by one after the last chunk, so no value is ever wrong. Err = a lost connection fromplc.read, or an error frombetween. - packets
- Packets for reads of these (request, reply) sizes, packed in order as ciplink does.
- plan
- The reads for
tagsin packet order.catalogholds the tag definitions; names inno_group(lowercase) are not read whole;budgetis bytes per packet;together(struct path)is true if the requested tags under that struct are always read in one read.