question

Steven Chen avatar image
0 Likes"
Steven Chen asked Steven Chen commented

How to pass eventdata with executefsnode()

Hello,

How to prepare an eventdata node and use it as parameter on calling executefsnode()?

FlexSim 18.2.2
executefsnode
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

·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Steven Chen commented

If you pass a node as the fourth parameter of executefsnode(), that node will be available in the code as eventdata. It is up to you to ensure that the node you pass in is a valid input, depending on what the code expects.

· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Steven Chen avatar image Steven Chen commented ·

I don't know how to prepare the node for fourth parameter. For example, if I want to pass an item as parameter one of function SendToPort, how do I write the executefsnode()?

test-excfsnode.fsm

0 Likes 0 ·
test-excfsnode.fsm (17.4 KiB)
Jordan Johnson avatar image Jordan Johnson ♦♦ Steven Chen commented ·

It looks like I was wrong. You can't pass an arbitrary node as the fourth parameter. You can only pass numbers or strings.

To use a node, I would toggle the node as FlexScript and use nodefunction() to execute it. Then you can access the parameters with the param() command.

1 Like 1 ·
Steven Chen avatar image Steven Chen Jordan Johnson ♦♦ commented ·

It's work, thank you.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.