I am having a problem with my source_init method and I was hoping someone could help me. The goal of the source_init method is to create container (pallet) with product inside (housing_cover) in the store (conditionroom) initally so that the assembly line on the bottom will be able to run.
I also would like some help in another area of my model ...I would like the cover source to stopuntil the store (conditionroom) has a capacity of 2 pallets left in stock, then trigger the molding machine to start producing parts, these parts then will be moved to the store (conditonroom). the molding machine should only run until the condtionroom has a capacity of 20 pallets. Can someone help me with this too?
Thank you in advance
what exactly is your problem with the INIT-method? It works, once you create a variable-object named "Pallet", which you use in the method-code, and also adjust the name "CoverBP1" to "CoverBP".
As for the other method, you should set it as rear-triggered exitcontrol of SOURCE, not front-triggered (else you must add a "@.move;" into your method code), and also you use wrong syntax, try this (I don't really understand what you are trying to achieve in your model, so I can only speak for the method-syntax now):
is do source.exitLocked:=true; stopuntil conditionroom.numMU < 2 prio 1; source.exitlocked:=false; if conditionRoom = 20 then source.exitLocked := true; stopuntil conditionRoom.numMU < 2 prio 1; source.exitlocked:= false; end; end;
Hope this helps,
Thank you for your reply.
I will try to explain a little better in what I want to accomphish with this model.
First I would like the bottom assembly line to control the molding proc above it by way of the conditionRoom. The conditionRoom is stocked by the molding line. The conditionroom feeds the assembly line (below) and when the conditionroom reaches a certain capacity this should trigger the source of the molding to unlock and start running until the conditionroom reaches a max capacity then the source should lock.
I struggle with methods and I still am having trouble with the variable-object...can you explain this to me.
Let me know if you have more questions.
Thank you in advance!
you have already used local variables in your methods. These variables are only known inside the method, and after the method has been executed, their value cannot be determined. Global variables are objects you place in your model, just like the Method and SingleProc or Source. You find them in the Information Flow-Toolbox:
I think you don't need a global variable at the moment, you can use a local variable in your INIT-Method. I was not sure what your methods should do, so I thought you wanted "Pallets" to be a global variable object. Just replace the datatype "object" with "integer" in your method (and fix the entrance-control of CONDITIONROOM, it does not exist). Your method can even work completely without this variable (heads-up: your method does not work properly if CONDITIONROOM.yDim is smaller than the number of pallets you create in your INIT-Method, so you could just as well skip the "if ConditionRoom.yDim"-check!):
is do -- create 1 full pallet on Buffer1 .mus.pallet.create(buffer1); for local i:= 1 to 480 loop .mus.housing_Cover.create(buffer1.cont); next; -- create 24 full pallets in ConditionRoom for local j:= 1 to 24 loop .mus.Pallet.create(source_init); for local i := 1 to 480 loop .mus.housing_Cover.create(source_init.cont); next; if (ConditionRoom.YDim - ConditionRoom.numMU) >= 1 then Source_init.cont.move(ConditionRoom.pe(2, 1 + ConditionRoom.numMU)); end; next; -- start cover-delivery? If CoverBP.YDim > 0 then CoverBP.sort (1, "up"); ref(DeliverCover).methCall(CoverBP[1,1]-EventController.absSimTime, 1); end; end;
Then for your process: you need to consider 2 events:
1) pallets enter the ConditionRoom (EntranceCtrl): if 20 pallets are reached, lock the source
2) pallets leave the ConditionRoom (ExitCtrl): if 2 pallets are reached, open the source
This should not be an ExitCtrl of the source, I think, I would use the controls of the ConditionRoom, see the attachment; next you need to fix the "PlaceParts"-method, I think.
Thank you for your explanation.
I tried to update my placeparts method but the DeliverCover method troubles out before I can see if it works. For some reason the method does not register the pallets in the conditionroom which results in this error. Do you have any suggestions?
Thank you again!
1) your PlaceParts-Method will not work like this. You move the part to ConditionRoom, if Y is >= 1, but you never set it to any value or increment in this method; and Y is a local variable, so it's "recreated" everytime this method is executed, and initialized with the value zero. So your check can never be true.
2) your line
obj := ConditionRoom.pe(2,ConditionRoom.Ydim).cont;
does not work, because the ConditionRoom is occupied (at least 1 pallet inside), but not full! You try to find the pallet on the 63rd position (YDim is 63), but that position is empty (currently only positions 1-24 have a pallet). If you don't care which pallet you get, try this instead:
-- find a pallet of type 2 in ConditionRoom
for local y := 1 to ConditionRoom.yDim loop --> find the pallet at lowest position
-- for local y := ConditionRoom.yDim downto 1 loop --> find the pallet at highest position
if ConditionRoom.pe(2, y) /= void then
obj := ConditionRoom.pe(2, y);
Thank you for your help!
I am still having trouble getting the placeparts and delivercover to work correctly. I am not fluent in simtalk and I have trouble understanding the errors I receive.
I will attach my updated model. I want the delivercover method to reference the tablefile bc this model is only a piece of a bigger model.
I appreciate all your input
It would of course be helpful for others here to have a complete description of what you are actually trying to do with your model, so we can better help you. So I can only check for syntax errors step by step.
In your DeliverCover-method,there is one mistake:
if ConditionRoom.pe(2, y) /= void then
You must add a ".cont" here:
if ConditionRoom.pe(2, y).cont /= void then
Then later, you have one line:
for local z := 1 to Pallet loop
but "Pallet" is no integer-number, it is the name of one of your sources, so this line will not work, but it is never executed at the moment, because "Palletcount" is never > 0.
I don't know what your variable "Palletcount" exactly means, but it seems strange to me that it becomes negative... Should this also be incremented during init when you create the 24 pallets?
Also this leads to an error in your "PlaceParts" method later on, because you determine
Y := MaxStack-palletcount;
which becomes 63 - (-24) = 87 and that is bigger than YDim of ConditionRoom. Why do you need to use a specific Y-position in ConditionRoom anyway? Try the attached method-code.
Also your eventcontroller starts on "2016/01/04" but in "CoverBP" you have entered "2017/04/10" as date for whatever this table-entries mean. So your model runs 460 days without any events.
Also note that Buffer1 has a capacity of 8, so in DeliverCover waiting until "not Buffer1.full" means that you load 8 pallets to Buffer1 with this method at once (not sure whether that is intended).
In "EnterConditionRoom", the line
has no effect, what do you intend to do with it? "ContentsList" can be used to read the contents-list of a store, you don't have to register parts in that list.
Some background of what I am trying to accomplish with this model;
I have modeled an assembly line that I want to follow a build plan schedule (CoverBP). The assembly line is fed from the conditionroom (store), the conditionroom is stocked by the molding parallelproc. What I want from this model is to see how much the molding machine (parallelproc) has to run to keep the conditionroom stocked, so that, the assembly line never runs out of product.
I will be adding more molding machines (parallelprocs) to feed the conditioroom (store) and I will be adding another customer to the build plan.
To answer so of your questions;
I intended palletcount to count the pallets in the conditionroom (store). My thought here was when the conditionroom became full it would trigger the source to lock ( and unlock when hit a low capacity). I know we covered this in the enter/exitconditionroom method but I was curious how the global variable would work in this instance. (Unfortunately I only confussed myself).
I also noticed that the palletcount became negative and was erroring out my placeparts method but I was at a loss on how to fix this error. I thought I should add it to my init method but I couldn't get it to work (see attached text file). My thought was that it would increment when the pallets entered and exited conditionroom since I will have other product at some point to track in the conditionroom.
I thought having specific Y-positioning could help with FIFO. Is this wrong?
The eventcontroller was an overlook, I forgot to set it when I started this model.
The contents list is away for me to see if the correct product goes to the right column. It really is only for me not used in any other way.
I updated the placeparts method with your suggestion and the model is working. I am going to add more components to this model and keep building the production schedule.
I do have another question. Say I have two customers sharing an assembly line and i want to model a changeover (when the line is down to switch from one customer to another) what is the best way to do this? I was thinking I could add it into the build plan of the schedule. I was also thinking maybe using Lockout? Any suggestions?
Is there any material that I can use to become better at simtalk...preferably a better understanding of how to create arguements and events?
Thank you again for all your feedback and help! I am very appreciative
your adjusted init-method (your attached text file) seems to work fine for me. But you are actually right, I would also move
into the ExitConditionRoom / EnterConditionRoom methods respectively, instead of doing it in the DeliverCover and Init and PlaceParts methods.
Regarding your changeover question, I'd suggest starting a new thread for this.
I personally worked with the books from Steffen Bangsow to get started with SimTalk, and I thought they were quite helpful.