question

ahmedmedhat avatar image
0 Likes"
ahmedmedhat asked Andrew O commented

how to not allow flow items into the processor during changeover?

i try to make the processor empty and not accept any flow items when there's a changeover happening.

I succeeded in turning the status to "Change over" but still the flow item sits on inside the processor as it would in a setup time configuration, is that because maybe i inserted the change status code in the (setup time) window? here's the code i entered in the setup time, it looks up the value from a gloabl table and inserts it as a changeover time.

/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);

double Time=Table.query("SELECT Time FROM [C1] WHERE Code = $1",item.Code)[1][1];
setstate(ownerobject(c),31);
print(Time);
return Time;

I tried to overcome the problem of not letting the flowitems in the processor during the changeover by adding the following code to the OnEntry trigger but it does nothing. Please help!

/**Custom Code*/
Object current = ownerobject(c);
Object item = param(1);
int port = param(2);

string status = getlabel(ownerobject(c), "status");  // Get the status of the processor

if (status == "Change over") {
    closeinput(ownerobject(c));  // Cancel the entry of the flow item into the processor
} else {
    openinput(ownerobject(c));  // Allow the entry of the flow item into the processor
}
FlexSim 23.0.0
setup timechangeover
· 1
5 |100000

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

Andrew O avatar image Andrew O commented ·

Hi @ahmedmedhat, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

The setup time is evaluated when an item enters the processor. If you want the changeover to happen while the processor is empty, you have to close the input and change the state when the last item exits.

You could control this externally through a Process Flow. Have the upstream object push the items to a list. A token pulls those items, moves them into the processor and then waits until the process is finished before pulling the next item. Before it moves the item into the processor, the flow can check whether a change over is needed, set the state and delay the token until the setup is finished.

5 |100000

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