I just dug out the project I 'thought' I used it on, but I thought wrong. Now I don't remember which machine I used it on...
Stick with ONLY post #22. Basically, you just want to assign each message to a bit within a word. I haven't touched an Omron in probably 15 years (though I did learn programming with Omron PLCs!). I forget how Omron does bit-of-word. Isn't it something like word 10 is bits 1000-1015?
Let's say messages 2, 7, and 9 need to be displayed. You word will now look like this: 0000001010000100 (Bits 2, 7, and 9 are ON). Let's call this the 'message word'.
Now you need a 'mask word'. This word will have a single '1' cycling through the word over and over.
0000000000000001
0000000000000010
0000000000000100
0000000000001000
.....
0100000000000000
1000000000000000
and repeat
You can use a SHIFT instruction. If the mask word equals zero, you load a '1' into bit zero, then shift repeatedly to move this '1' through the word. When it leaves the end, the word will equal zero again, so you automatically reload the '1' in bit 0 again. Note: I think Omron has a ROTATE instruction that will automatically 'recycle' the '1' bit back to 0 for you. Might make it easier?
You don't want any delay between messages, so 'shift' should occur every scan, but you want to pause it when it encounters one of the messages (so it can be displayed). This is where the AND comes into play. You want to AND the message word with the mask word. The result will only have a '1' in a bit location when the corresponding bits in the message AND mask words BOTH have a '1'.
Now let's see what happens each time the mask word bit moves...
Scan 1:
0000001010000100 Message Word
0000000000000001 Mask Word
------------------
0000000000000000 Result Word (nothing)
Scan 2:
0000001010000100 Message Word
0000000000000010 Mask Word
------------------
0000000000000000 Result Word (nothing)
Scan 3:
0000001010000
100 Message Word
0000000000000
100 Mask Word
------------------
0000000000000
100 Result Word (Hey, we found something!)
The result word is not zero, so we need to display something. First we need to pause the mask word shift register. When the result word is not zero, we enable a timer. While this timer is running, we inhibit the shift register instruction, so the '1' in the mask word pauses at its current location.
Now we need to determine which message was found. We want the value of the bit that was found, so we use the ENCODE instruction (maybe DMPLX in Omron-speak?). The encoded value of 0000000000000100 is '2'. This will be used by your HMI to display message #2.
When the inhibit timer expires, the '1' bit in the mask word takes off running again, searching for the next '1' in the message word. In this example, it will find bit 7 next. The result word is again not zero, so we pause and decode that one, and so on...
Hopefully, this makes sense to you. Let me know if you need more details.
-Eric