question

Anutt K avatar image
0 Likes"
Anutt K asked Logan Gold answered

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
· 4
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

Just some observations at this point:

  1. This model should take a few seconds to run, but you are creating scanning events which make it run very slowly. Instead you should detect entry and exit events to change state.
  2. You should also use object process flows rather than copy paste them in a general process flow.
  3. You should probably also use a container (plane/visual) tool to contain the modules - then you can set the state of that container.
0 Likes 0 ·
Anutt K avatar image Anutt K Jason Lightfoot ♦ commented ·

I don't understand how we can detect the event for use to be condition of something. Can you give me some example about entry and exit event detection please.

And you can give me some example to set the plane from any condition nearby this case please.


0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Anutt K commented ·

Here's an example where the plane is the instance for this object flow:1714059713215.png

You could alternatively detect the entry and exit for the first and last objects rather than any in between or a number of other methods.

containerProcessingState.fsm

0 Likes 0 ·
Show more comments

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.

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.