Hi,
I am creating a conveyor system consisting of a straight conveyor with a photo eye and a decision point on it. There are multiple of these conveyors next to each other. I manage to create the conveyors and the photo eyes and decision points, but only the first that is created of the photo eyes/decision points works correctly. For the first I create the photo eye into the conveyor using createinstance and Flexsim moves the photo eye to the same rank level as the conveyor and creates the link between them. For the other ones the objects remain inside the conveyor and thus the rest of the code does not work as it should. Also, when stepping through the code with the debugger so that I put breakpoints on the rows where the decision points, photo eyes and before the connections from and to the conveyor are created then the code works as it should, probably due to some timing issue.
Anyone that has a clue on how to fix this problem? See the attached model where the problem is replicated.
Call the createConveyorSystem user command from the script window as I have defined it there to see what happens.