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.

Bo.W avatar image Bo.W commented ·

Prompt reply. @jason.lightfoot @steven.hamoen @Matthew Gillespie @Ben Wilson

I know that message triggering can be realized, and so can PF. It's just that I'm doing a function development. Should I consider triggers function overload and how to implement it?

Be grateful.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Bo.W commented ·

then try the SDK

0 Likes 0 ·
Bo.W avatar image Bo.W Joerg Vogel commented ·

Can the function eventlisten be implemented? It seems that the third parameter of this function named relaynode is not executed.

0 Likes 0 ·
Show more comments

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.

Bo.W avatar image Bo.W commented ·

The Object name was not changed back when uploading. The main problem is the node data type.Thank you very much.

0 Likes 0 ·