Skip to main content

Module planner

Module planner 

Source
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 as packets counts 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.read per 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 from plc.read, or an error from between.
packets
Packets for reads of these (request, reply) sizes, packed in order as ciplink does.
plan
The reads for tags in packet order. catalog holds the tag definitions; names in no_group (lowercase) are not read whole; budget is bytes per packet; together(struct path) is true if the requested tags under that struct are always read in one read.