I would be remiss if I did not point out that the SQO can write more bits per transition than just one of the primary 8 ([Steam, Purge, Cool, Idle] for #1 and #2 beds) each time its input rung becomes True. For example, you have Rungs 0013 and 0014 that write a value of 1 to
#2 Adsorb B3:1/8 or
#1 Adsorb B3:1/9 bit when any regen bit (Steam, Purge, Cool, Idle) of the other unit has a value of 1: you could eliminate those rungs by putting a value of 1 in bit 8 of words N7:1 through N7:4 (#2 in regen) and in bit 9 of words N7:5 through N7:8. The same approach could eliminate Rungs 0015 (Any Steam), 0016 (Any Purge), 0017 (Any Cool), and 0019 (Any Idle), although it would require re-assigning the
Any ... bits to be in B3:1 instead in B3:2, which would require shifting other bits out of B3:1, which in turn is fine because most of those don't belong in B3:1 in the first place e.g. B3:1/10 the
Step Advance for the SQO.
All in all, of the two dozen+ rungs that execute the logic (do not write output channel memory), nearly half could be eliminated, and the program might be clearer and easier to understand.
Also, I suggest you add comments to the rungs; you could even have the comment for the SQO rung detail the size, and values for, the N7 Data File.
Anyway, it's been a fun exercise. Thanks for posting, and welcome to the forum!
As you can see in one of my earliest posts (yesterday @ 4:32) I knew I had to enter something somewhere regarding 1,2,4,8,16.... but I couldn't remember where.
Not to put too fine a point on it, but you'll notice that the next post from
@JaxGTO 17 minutes later (see
here) suggested that there needed to be values in N7:1 through N7:8.