question

Anutt K avatar image
0 Likes"
Anutt K asked Jeanette F commented

Error Exception Caught when On Time Event in the model.

Hello in this model the machines are divided to many module but thay are same machine.

1713968874114.png

And I need to get state of machine. When no one of module are not the content on it the machine must to be idle. So, I use the processor for use be agent object of the machine and create the logic in Process Flow for check the content of each module of the machine.

1713969139053.png1713969158305.png

The logic will make agent (State_......Processor) to idle or processing state by checking every 0.1 S. (100 ms.) if some module member of machine has content the logic will create the Item in the agent object and be processing state. If all of module member hasn't some content the logic will check and destroy item in the agent object if them have and make them idle.

But when the model run to once time this error has come. Event through the module member has content but the agent object has come to block state.

1713969569785.png

I'm not sure what the something wrong in this model. I has attached model here. Thank You.

1 Try 16 Apr 24 ver26_Question.fsm

FlexSim 23.0.15
exceptionsexception caughtontimerevent
· 6
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

Logan Gold avatar image
0 Likes"
Logan Gold answered

Hey @Anutt K, the issues are happening because items in the Processors are being destroyed while they are still in the middle of being processed.

When an item enters a Processor, events are scheduled to occur in connection with the item, like when it is supposed to finish processing. If the item is destroyed before those events happen, it throws exceptions like the ones you are seeing. I believe the same issue is causing the Processors' state to change unexpectedly too.

One good solution would be to do what Jason suggests and utilize a Visual Plane containing the processors/modules in your model and set the state of the Plane.

Another option is to change the Process Flow in your current model to stop creating/destroying items in the Processors and set the state of the Processors instead. If you're not doing anything else with the Processors, they shouldn't change their own states. Or if you find there is an issue, you can replace the Processors with something else that doesn't change its own state at all - like a Visual Plane or a Visual Shape object.

Also, going along with another point that Jason made, in your current model, you're already utilizing Event-Triggered Sources and Wait For Event activities. You could use the Decide activities you're already using the check the contents of the Zones in combination with these Event-Triggered Sources and Wait for Events to change the state of the Processor. That way you're not constantly running the Delay activities waiting for something to happen.

5 |100000

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