dear parky You are a perfect man. Thank you so much.
Here is a quick bit of code that does what I think you need.
When Memory bit M10.0 is set to true, it runs through FC4 & finds the lowest number in the Container words, providing it is above 0 & it is enabled per the DW associated with them i.e. DW12-30 are the containers DW32-50 are the status words, currently the status words re either 0 or 1 (you could add other values for some purpose).
When M10.0 is set, it first places the first container value in a temp word, it then cycles through each container & if the value is > 0 and < than the stored one and it's associated enable is 1 then it writes that over the previous one.
Loops through to the end to check the rest, then resets M10.0 so only processes the code on a oneshot. So providing the container is above 0, the container is enabled and it is the lowest value it is stored in the robot word DW0, have left a few spares, you may need to shift the data about if you have already got some sort of formant, I did not effectively use a 2 dimentional array (although it is sort of), thought it was cleaner & it was quick to code but I'm sure someone will post if they have a better way of doing it, my last experience on S7 was probably about 12 years ago & with that & using my experience of S5 some 22 years ago I cobbled it up, well if you do it like this.....
There is a caveat, if no valid container is availlable then the robot word will stay as is so you will need to deal with this.
Anyway, it should give you some ideas.