question

Bo.W avatar image
0 Likes"
Bo.W asked Bo.W action

listen Events and Execute custom code by code

How to listen to Object binded but not added trigger through code (NOT PF)? For example, When the item entering in Queue1, I want to execute the variable code (queueOnEntry) of Plane1.

I added an eventListener ,but it does not worked.

Any suggestion is welcome.

listen Events and Execute custom codeV21.0.2.fsm

FlexSim 21.0.2
flexsim 21.0.2
· 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.

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Bo.W commented

The problem with your model is that your plane reference is wrong. You are trying to reference "Plane24", but the object in your model is "Plane1".

Also, your queueOnEntry node needs to be toggled as FlexScript. Right now, it is just holding a string. Since you want it to be executed, you need to toggle it as FlexScript.

Attached is your example, modified to show you how the eventlisten() command works.

listen-events-and-execute-custom-codev2102_1.fsm


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