question

tomonori S avatar image
0 Likes"
tomonori S asked Ryan Clark edited

About the model of reversible conveyor

The user has a question about the attached model.

Currently, we are ranking flow items, but I would like to bring them to the sink in this order, so please tell me how to make them.

The processing time at the station varies depending on the product, so even if the processing of the products that arrived later is completed, I would like to stay on the spot (station) and execute it after processing the products that arrived earlier.

I created a process flow as a trial and set it to flow only rank 1 items, but it seems that stopping and resuming custom code is not working well.

model_01.fsm



FlexSim 21.0.3
wait for eventcustom codedecidestationreversible conveyor
model-01.fsm (57.6 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.

Eric M avatar image Eric M commented ·

Hi @tomonori S, was Felix Möhlmann's helpful? If so, please click the red "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 Ryan Clark edited

1. It seems that when you reverse the conveyor, the items get processed again by the station. I added the condition that only items with "Flag != 1" should be processed, so this doesn't happen.

2. One important thing to note here is: If you "stop" an item X times, you also have to "resume" it X times before it actually continues. In your model items might get stopped multiple times, because the tokens react to any station finishing its process, than stop the item and only continue it, when it has the correct rank.

I changed this so the item gets stopped in the arrival trigger of the station. The Wait for Event activity in the process flow now waits for the item it is assigned to to finish the process. It then either resumes the item if the rank is correct, or sends it to another Wait for Event. There it waits until another item has left the system (passed DP8) and then tries again.

3. To know which item's turn it is, I created a global variable "CurrentRank". This is an array with as many entries as there are item types. Each entry starts at 1. The process flow checks whether the items rank is equal to the value of "CurrentRank" at the index of the item's type. If that is the case, the items rank is the next one in order and it can continue. Each time an item passes over DP8, the arrival trigger increments the value of that types entry in the array by 1.

The "Breathe" delays in the process flow are important. They make sure, that the update of the global variable, item label and conveyor speed are complete before accessing these values.

model-01_fm.fsm

I hope this is helpful to you.


model-01-fm.fsm (58.9 KiB)
· 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.

tomonori S avatar image tomonori S commented ·

Thank you for your polite reply.

I have additional questions about this model.

In the attached model, on the source side of the 3D model, flow items are ranked in order of generation, regardless of type.

Please tell me how to flow flow items in rank order in such a situation.

model_02.fsm

0 Likes 0 ·
model-02.fsm (54.9 KiB)
Felix Möhlmann avatar image Felix Möhlmann tomonori S commented ·

Change the global variable "CurrentRank" into an integer instead of an array. Then, in the decide activity and the code snippet of the arrival trigger of DP8 just use "CurrentRank" instead of "CurrentRank[item.Type]".

That way, the rank is not split by type but combined for all items.

model-02_combinedRank.fsm

0 Likes 0 ·
tomonori S avatar image tomonori S Felix Möhlmann commented ·

Thank you for your support.

0 Likes 0 ·
tomonori S avatar image tomonori S commented ·

excuse me. It's been a while since the previous question, but when I change the process time of each station in the attached model, the flow items do not flow in the order of rank.

What is the cause of this?

model-03.fsm

img.png


0 Likes 0 ·
img.png (10.1 KiB)
model-03.fsm (54.4 KiB)
Felix Möhlmann avatar image Felix Möhlmann tomonori S commented ·

Setting the conveyor speed to a negative value seems to overwrite the "stop" of the item. This wasn't apparent last time because mostly the items will trigger the station again when the direction is reversed, thus renewing the "stop" of the arrival trigger. Mostly, but not always. In cases where the event doesn't trigger a second time the items simply continue with the tokens still stuck in the process flow.

I could fix this by connecting the conveyors to motors and stopping and resuming those instead.

model-03_motors.fsm


0 Likes 0 ·
model-03-motors.fsm (56.9 KiB)
tomonori S avatar image tomonori S commented ·

@Felix Möhlmann,

Thank you for your reply.

I have a question about the model. Please tell me the meaning of the part surrounded by red in "img_01.png". Also, how does connector 2 used in this "Decide" work?

img-01.png

0 Likes 0 ·
img-01.png (52.2 KiB)