question

Preet avatar image
0 Likes"
Preet asked Jason Lightfoot commented

Robot blocked and starved state

demo-model 4.fsm

Hello!

By default, the robot task executor shows idle state when there is no object available in a queue OR object is available in a queue but Robot can not process further since processor is still processing.

How would I separate above mention cases as below?

1677711303919.png

Scenario 1 and 4 are being tracked as normal. But I want help in scenario 2 and 3.

1677711358586.png




FlexSim 23.0.2
robot state
1677711303919.png (9.7 KiB)
1677711358586.png (78.1 KiB)
demo-model-4.fsm (39.9 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Preet, was Jason Lightfoot'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

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

In the attached model the queue is modified in 3 ways:

1. End Collecting trigger sets the robot state to blocked if idle.

2. The transport dispatcher trigger creates a task sequence with call subtask added to the end ( to use the next point 3)

3. Label "checkBlocked" is called by the subtask at the end of the task sequence and it sets the robot state to blocked if the queue has content.


demo-model-4_jl_callsubtasks.fsm


· 11
5 |100000

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

Preet avatar image Preet commented ·

Hi @Jason Lightfoot . I am noticing that the robot state will only go to blocked if there is a change in the queue content while the processing is working. In the attached screenshot, there were 2 items in the queue when the robot delivered an item to the processer. Immediately after that, the robot goes into idle state. See the first blue arrow from the left. However, as soon as a new item gets added to the queue, then robot goes into the blocked state. Seems like the label checkBlocked is not retrieved/stored when the robot delivers the item. Rather, it is only retrieved when there is a content change in a queue. Any thoughts on that? My usecase is to set the state of the robot to blocked as soon as it delivers the item to the processer and there is at least 1 item in the queue.


UPDATE:

Upon trying few more things, I found that if I use on Draw trigger instead of on end collecting and check if the queue is not empty before checking if the robot is idle, then it is working as expected. Still would be interested to know your thoughts on this. Attaching the model as well.

1682364701122.png


demo-model-4-jl-callsubtasks (1).fsm

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Preet commented ·

No, don't use the onDraw code for anything your model needs for logic or statistics - when you run an experiment or between the frame interval (which can be large when running fast), no onDraw code is fired.

At what time in my model do you think the incorrect state occurs?

Since FlexSim models are designed to be repeatable it's good practice to reference the exact event when something happens so we can home in on issues rapidly.

0 Likes 0 ·
Preet avatar image Preet Jason Lightfoot ♦ commented ·
Got it @Jason Lightfoot. So what logic should I use to overcome the issue that I mentioned? Did I explain correctly what is happening in the model instead of what I am looking for?
0 Likes 0 ·
Show more comments
Show more comments

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.