question

Trex-2 avatar image
0 Likes"
Trex-2 asked Steven Hamoen commented

Wait for Event Match With Item and Token Not Working

I am creating a model where i need to release the token only when that part type is produced from the station. I have 5 types of part produced from source and 5 tokens from process flow. I want that which every part type exits the station only that token is released from wait for event by matching the lable type of item and token. But the match value or match both is not working. how can it be done ??


Please find the model :
Wait for event match.fsm

FlexSim 24.1.0
wait for event
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

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered Steven Hamoen commented

@Trex-2 The problem is that in the wait for event you are comparing the value of label Type with the exiting item. So 1 is an integer and the other is a pointer. They are never equal so that is why it is not working. So you can solve it in different ways:

1. only listen to the on exit in then use a decision which of the 5 tokens can continue and which ones can be send back. (be careful if the the flowitem moves in the sink it is gone so getting info from the 3d Object can be more complex)

2. if there can only be 1 object at a time in the processor put all the information on your token when it leaves so make the token independent from the flow item

Giving more info about the actual problem you are trying to solve might give more solutions.

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

Trex-2 avatar image Trex-2 commented ·

can you help me get that applied in the model attached, it would be great it is done with match value or match event on wait for event trigger.


Elaborating the problem :-

All my 5 tokens will wait at wait for event, when item type 1 exits the processor, only the token with Type 1 as lable on it should be released to delay and then it will again come back to wait for event and wait.

0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen commented ·

@Trex-2 Here is the model with the changes.. First off all I removed your assign labels and added the label already on the source. You used a duniform distribution which gave a good change that not all 5 types where made and some where made double. So now I used the tokenIndex on the source.

And I added the decide to check the exiting flow item and send the other tokens back.

But I think you have to work a bit more on your logic because while the token is in the delay it could very well be that the same type goes through the processor again....

WithDecide.fsm

0 Likes 0 ·
withdecide.fsm (33.2 KiB)
Trex-2 avatar image Trex-2 Steven Hamoen commented ·
Thanks for your support @Steven Hamoen but i wanted to know is it possible to use only wait for event to get the function which we are getting at decide, like say if my part type 3 exits only my type 3 token will come out and accordingly it will work let us not think of delay and other stuff as off as those are not really part of my logic, i just want the token to come done from wait for event matching the same object and same token.
0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen Trex-2 commented ·
@Trex-2 Each event has only a limit set of parameters that you can test against. In case of the exit trigger it is the actual item that triggers the onexit event and the port the item leaves through. So you need 1 of those to test against if you want to test on the wait for event itself. If you know the flowitem in advance or if you sending out through different ports you can use the wait for event, otherwise you have to solve it differently.
0 Likes 0 ·