You will need to map IO bits for any area in which there could be interference. You should have a bit for clear of area1, for example. Please note that these bits should be high when the robot is clear and dropped low when not clear. This is a safety measure in case the robot is in one of the areas and it gets powered down. Then you will also have a request to enter the area/s. The PLC acts like a “traffic cop”. It will see the request and grant permission to enter if the area is clear from other robots. It is a good idea to also check that no other robot is requesting entry at the same time. If two requests are simultaneous, the PLC will give access based on priority. See an example that I wrote years ago. You should be able to use it right away as it uses variables which you will pass into the routine call as parameters. While you are there at this github, poke around for any other code that you might find useful.