The option "If Item Label Value Changes" for the setup time is made for this.

The minimum batch size of same-type items requires a bit of custom code though. To restrict which type is processed, youi can use the "Pull" behaviour. A label on the processor that contains the allowed type can be used in the "Pull Requirement" to only pull items of the matching type. At the start of the model and inbetween changeovers, all types should be allowed, so the code is set up to allow all types if the label's value is 0.


/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
// If no type is specified, pull anything
if(current.PullType == 0)
{
return 1;
}
// Otherwise, only pull if type matches
return current.PullType == item.Type;
The second label "PullCount" is used to determine at what point the "PullType" should be reset. This is done in the On Entry trigger. (Note that, because there are two drilling machines, "current.name" can't be used for them, since their names are numbered. The row identifier has to be specified as "Drilling". The explicit naming of the row can of course also be done for the other processors, but using their own name makes copying the code faster.)
// Set type and reset count labels when a new type is pulled
if(item.Type != current.PullType)
{
current.PullType = item.Type;
current.PullCount = 0;
}
// Increment count
current.PullCount += 1;
// Check against table value
if(current.PullCount >= Table("change gear")[current.name][current.PullType])
{
// Reset type label
current.PullType = 0;
}
I noticed that the drilling time for type3 is set to 0. Is this correct?
jjss-flow-process-fm.fsm