Cancel
Showing results for
Did you mean:

# cannot find error in SIMTALK code

Pioneer

I am working with lot based manufacturing system - I have 6 lots for a day - each of the 6 lots contains parts for 12 No.s of a product (Lets say "x"). To produce 1 no. of x, 9 different types of parts are used(A,B,C,D,E,F,G,H,I). So I have in total 12*9=108 parts. These 108 parts are packed in 1 lot, so 6 lots have 6*108= 648 parts total.

By init and .create method I am generating 6 lots and then 108 parts per lot(12 A(PartA_Lot1,PartA_Lot2), 12 B, 12C , 12D, 12 E, 12f, 12G, 12H, 12I). But it is not generating as I am expecting. I am atting screenshots, can someone please tell where I am going wrong.

3 REPLIES 3

# Re: cannot find error in SIMTALK code

Valued Contributor

Hi aagosh,

I think the problem maybe is the capacity of container, you can't create more parts beyond the capacity of the container.

Also, you can check whether the part is successfully created by the following code.

local Part : object;

Part := .Mus.Entity.create(TargetContainer);

if Part = void then

debug; --Failed to create Part!

end;

# Re: cannot find error in SIMTALK code

Pioneer

It may be a capacity error, but it is generating parts haphazardly....3 NO.S of PartA_Lot1, 3 B 3C and then 1 D and 1E. You can see this in the structure I have opened after just running the program

# Re: cannot find error in SIMTALK code

Gears Phenom

I think the problem is also that you are creating the PART-instances not on/in your LOT-instances, but in your LOT-classes. And note that "Show Structure" will list the contents in alphabetical order. And you should indeed check the capacity of your LOT-classes, I doubt that they can hold 108 parts at the moment.

So first, you should clean up your model and either delete all parts that sit on your class-objects .MUs.MyLotX, because a model-reset does not affect those. So they will remain there and maybe you did some early testing in your model with only 3 variants and these parts have been there ever since, so your new parts cannot be created.

```is
myLot	: object;
myPart	: object;

do
-- generate 6 LOTs
for local i := 1 to 6 loop
-- 0) clean up LOT-classes (you only need to do this once)
str_to_obj(to_str(".MUs.MyLOT", i)).deleteMovables;

-- 1) create a LOT
myLot := str_to_obj(to_str(".MUs.MyLOT", i)).create(MyLine1);
if (myLot = void) then debug; end;

-- 2) create 12 instances of...
for local j := 1 to 12 loop
-- 3) ... 9 different PARTs (char(65) = "A")
for local k := 1 to 9 loop
myPart := str_to_obj(to_str(".MUs.Part", chr(64+k), "_Lot", i)).create(myLot);
if (myPart = void) then debug; end;
next;
next;
next;
end;```

Regards,
Alex

___________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!