question

Karthikeyan B avatar image
0 Likes"
Karthikeyan B asked Matthew Gillespie edited

Set Item color and process items based on labels and item type

Hello I am trying to create some logic for a bigger simulation i am trying to do.

Requirements :

1) I need to produce 9 different product types on my line

2) I have 3 major product types , I have 3 sub product types under every major product.

3) I use the Even trigger ( On creation to assign 3 different major product types )

4) I use the assign label on creation to assign my sub products to the major types so 3X3 = 9

5) I want to create the item colors based on both type and label , not successful

6) I know i can just go ahead and create 9 different item types or labels but I want to use labels and item types so i can use labels later in the process to route the items to different locations in the conveyor.

7) I have used the following expression on the set object color

Color.byNumber(item.Type)+Color.byNumber(item.Subtype)

Can some one tell me how to fix this ??

set-object-color-expression.pngcolor-by-label-and-item-type.fsm

source-triggers.jpg

Also I want to know if the expression i am using to process the 9 different items based on the labels on the same processor is right.processor-based-on-label-value.png

1) I use the getlabelnum(item,"labelname") and I use the value by case for the processing time on the processors

Is this the best way to do this or is there some other way where i can do it based on item type too ??

I have attached my model for the set object color and i have attached screen shots for the other questions.

Thanks

Karthik

FlexSim 19.0.2
process timeitem typecolor
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joshua S avatar image
2 Likes"
Joshua S answered Karthikeyan B commented

I changed up your creation trigger so that it would assign Type and Subtype based off of operations done on a value "type" that allows you to set the color as well. so now your Types will be 1-3 and your Subtypes will be 1-3, I also changed up the flow so they would check for 1-3 rather than 4-6. You can change it back to checking for 4-6 if you want, just change the code

item.Subtype=type%3+1;

to

item.Subtype=type%3+4;

it was just easier for me to think of it using a 3X3 matrix

18352-color-by-label-and-item-type.fsm

What you are doing for the processor should work, just change the "variant" to "Type".


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.