I have encountered a problem regarding the use of global variables in a hierarchy.
In my model I have several different subframes where each subframe constitutes a machine. The reason why I chose to model this way is because every machine can execute different kinds of processes. In each process the pallet is unloaded and the MU's are being processed one by one.
I have written some code telling that each process only can handle one pallet since only one pallet can be in the machine at the time. However, my methods only works per process. That is, pallets may enter two different processes at the same time - which is wrong!
I use the boolean global variable machineOccupy in order to see if there are any pallets in the process. How can I use this variable in order to make sure that only one process is working at the time?
I have a thought of using entrance controls for buffers outside the sub-frame that is connected with the global variable inside the subframe, but I do not see how it could work. Or how it could help me make sure that only one entrance is used at the time.
A suggestion in the forum to a guy with a similair problem was to drag and drop the variable to the Models in the Library, but keeping the variable here and dragging it to the different frames where I want to use it does not work.
Could someone please help me??
PS. "Palettenter" and Pelletexit" in the method in the enclosed photo are SingleProcs in the sub-frames Unbatch and Batch.
Solved! Go to Solution.
It seems like the code you ask for isn't working as I thought it did. The code does not make sure that only one pallet enters a process at the time.. So now I have two problems to handle. The code I had written for the variable MachineOccupied to handle this is enclosed in the photo mainframe in my initial post. The name of the method is "OccupancyControl"
could you please help me? I don't know where to start with the problem anymore.
Thank you very much Steffen!
I'll send you my model from my colleagues email, and we'll se if that will help us figure out the problem.