question

Sebastian Hemmann avatar image
0 Likes"
Sebastian Hemmann asked Marcello Rosadini commented

Pull from List fires Trigger twice

Hi,

I´ve attached a model pe-oncleartrigger.fsm

where the pickoption "Pull from List" is used in a Photo Eyes OnClear Trigger.

If we do so, the trigger is fired twice. Does anybody have an Explanation or idea why?

Greetings

Sebastian

FlexSim 17.0.13
pull from listphoto eye
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

Phil BoBo avatar image
3 Likes"
Phil BoBo answered Marcello Rosadini commented

Line 27 of that code calls itself. It is doing what it is supposed to.

The Pull From List pick options use their own code node (c) as a callback with a parameter to determine whether it was the original call or the callback.

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

Marcello Rosadini avatar image Marcello Rosadini commented ·

Sebastian,

not sure if it might have something to do with it, but in the past, we've had different issues when a PE is alligned or very close to a conveyor transfer. Maybe you could try placing it somewhere else and see if it corrects the issue?

0 Likes 0 ·
Sebastian Hemmann avatar image Sebastian Hemmann Marcello Rosadini commented ·

Hi Marcello, thanks for your fast Reply. Sadly this does not have any effect.

0 Likes 0 ·
Sebastian Hemmann avatar image Sebastian Hemmann commented ·

Hi @phil.bobo, thanks for the hint. But what is the solution. I´m quite sure there was no Code added by us/ our Client. So it seems as if the failure is in the pickoption!? Can we just erase line 26 and 27 without any comment. Or what will this affect (what Features will not work)?

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Sebastian Hemmann commented ·

What's the problem? The code firing twice is not a problem. It's a feature.

What's the actual problem?

If you erase lines 26 and 27, then it won't execute the On Pulled callback when it pulls from the list immediately without making a backorder:

The On Pulled code is what is firing the second time it executes.

1 Like 1 ·
on-pulled.png (10.9 KiB)
Sebastian Hemmann avatar image Sebastian Hemmann Phil BoBo ♦♦ commented ·

Why should we want the Code firing twice, if a PE is only cleared once?

You are right, in this example Model it does not effect anything else and is not a problem. But what if we want to add more Code through this trigger (lets say in the Clients model, we were not allowed to share)? Code that is sensitive in how often the trigger is called?

0 Likes 0 ·
Show more comments