question

Thoams G avatar image
0 Likes"
Thoams G asked Ben Wilson commented

Set certain state on the TimeTable, when closing Input?

I am desperately trying to set the state of a processor when using the time table. The situation is as following:

According to the shift plan, I want to stop the production and therefore the input. This enables the item still in the processor to be processed. It is important for me to do that, since I am writing down the entering times and exiting times to a global table. If the item is stuck over the weekend, the item stay time in the processor is becoming larger and larger which does not resemble the reality.

The problem with closing the inputport on this scheduled downtime is that the processor is in the idle state, which would then interfere with the dashboard. I would like to set the state to STATE_OFF_SHIFT but I do not know how to do that. Is there any possibility do that with the help of the TimeTable?

Thank you for your help, it is really appreciated.

Future State .fsm

FlexSim 18.1.2
time tableflexsim 18.1.2setstate
future-state.fsm (148.7 KiB)
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Thoams G, was Serge A's answer helpful? If so, please click the red "Accept" button on 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

·
Serge A avatar image
1 Like"
Serge A answered Thoams G commented

Down function (as any Flexscript trigger) has immediate effects, so

- if you Stop Object, you set the off shift state correctly, but suspend processing and don't unload the item

- if you Stop Input, you can finish processing, but then the object enters the idle state (so the statistics can be off, or the object may even start processing the next item when it is supposed to be down)

To achieve what you want you need to do both, but postpone state change (stop) until the object is empty. Given that it's not immediate, and depends on some other condition in the future, you probably cannot do it in the down function.

Instead you may start a process flow which will wait until the processor can be stopped. Please find atached a simplied model which uses this technique. At t=50 the object is supposed to start its "scheduled down" period, but there's a flow item in the processor.

The Down Function is set to do nothing (return a string "do nothing"):

Instead there's a fixed resource process flow, attached to this Processor, which creates a new token every time Down Function event triggers:

This process closes input immediately, but delays state changes. It may even skip the downtime completely. Please note how Event-Triggered Source is configured. It filters events, to intercept only those of the current object, and it writes event parameters downstate and downtime as token labels.

P.S. If you haven't deleted the previous post, I would have sent you an answer hours ago. Sorry, don't have time to type all the explanations again. I hope this example is helpful. delayed_stop_example.FlexSim18.1.fsm

P.P.S. In general, if a behavior to be implemented lasts in time, implementing it in Process Flow is usually more straightforward.


· 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.

Thoams G avatar image Thoams G commented ·

Thank you for your answer, I will try it immediately.

I am sorry I deleted my posts from hours ago, but i thought I had a working idea. I implemented it and thought it would work. So I deleted the post to avoid wasting someone's time. However, after a few hours I realised that my approach didn't work and even after several attempts it didn't work so I turned to you.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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