OK. I will assume your question is one of graphical presentation in ladder view. There's a hidden question too: where do we place the comment in the mnemonic representation?
So let's start with mnemonic view. I think your very dense rung would look like:
STR X0, OR X10, OR X20, OR X30, OR X40,
STR X1, OR X11, OR X21, OR X31, OR X41, ANDSTR,
STR X2, ...
... , OR X44, ANDSTR,
OUT Y0, OUT Y10, OUT Y
20, OUT Y
30, OUT Y
40The mnemonic sequence is columns first, then rows. Each row appears 5 times! So getting a proper association of the comment to the row gets hard. The comment has to appear between mnenomic lines. In the example above, where the commas separate the operations. This suggests that it would be easier to map
comments on contacts, coils and boxes rather than on rows.
Given that the comments will appear between operations in the mnemonics, then ladder view comments should appear "near" the contact, coil or box it applies to.
Taking one step back,
Nickname, Wiring Info and
Description appear above the
Element Name in ladder view. Each of these is presented full width. And space is provided for all three lines above the element name. The ladder diagram is spread out so that none of the lines go through any of the text.
Accumulator Boxes also show the element name and the nickname, wiring info and description inside the boxes. IBOXes show only the element names. For multi-element contacts like the comparison contact, you can provide comments for both elements being compared, but you can't provide a comment for the comparison operation itself or for any constants used.
Back to the ladder view question on how to handle vertical lines in the middle of a row comment.
First off, let's consider them
operation comments or
reference comments rather than row comments.
If the operation is a box or a multi-element contact, I'd suggest adding the comment above the nickname, wiring info and description for the element(s) referenced. For contacts and coils, I'd spread the lines to avoid overlap. For boxes, I'd keep the comment inside the box. For both placements, I'd like support for multi-line comments similar to the support for ctrl-k rung comments. This would allow for narrower lines in ladder view by putting the comment in a small paragraph rather than one long line.
For entry of the comments in ladder view, I'd suggest using ctrl-{something} using the cursor position to determine which contact, coil or box to apply the comment to. This would also determine where the comment would be inserted in the mnemonic view. And placement in the mnemonic view would signal where to put in the comment in the ladder.
The absolutely most common operations are AND and OR. These are represented by lines in ladder view. The cursor cannot actually be positioned on one of these. I have no suggestion on how to add comments to these. However, I don't see much need. A comment could be placed on the participating contact(s) if an explanation is required.
This feels like it would be a non-trival to implement. It's been a long time since I did lines-of-code estimates for new software functions. Even with excellent object oriented code with good inheritance, this is going to hit several places in the program. It might be easier to just not collapse rungs when the second one has a comment.
As I thought about your question, I ran into an avalance of things to consider. But that's why we ask questions isn't it - to trigger thought about answers. I hope this is useful input.