- You are setting the "OCCUPIED" label on the item and not the Photo Eye in the block and clear triggers.
- The video is 8 years old and the header shown for the OnMessage trigger is no longer valid. With current syntax the trigger code should look something like below. Through the "activeItem" property of the Conveyor.DecisionPoint class you can access the item currently blocking the PE directly, so no need for a for-loop.
Object current = ownerobject(c);
Object fromObject = param(1);
Variant msgparam1 = param(2);
Variant msgparam2 = param(3);
Variant msgparam3 = param(4);
Conveyor.DecisionPoint PE = current;
if(objectexists(PE.activeItem) && Model.find("PE1").OCCUPIED == 1 && Model.find("PE3").OCCUPIED == 1)
{
PE.conveyor.itemData[PE.activeItem].resume();
}
With that said, the same logic can be achieved with just a small block of activities in a Process Flow (which was still a relatively new feature when the video was made and might not have had these capabilities back then). This is both quicker to set up and scales better to a different number of lanes because no fixed references to other objects are used. Opening the queue outputs is still done through the OnClear trigger in the second attached model, though it could also be moved to the Process Flow by adding a Wait for Event activity that waits for the PE to be uncovered and a Custom Code activity set to open the outputs.