question

Meng,Li avatar image
0 Likes"
Meng,Li asked Meng,Li commented

How to set function nodes' value through GUI ? Like TE's loadtime

Sorry that i can't upload the model here, instead i attached two pictures which may demonstrate the problem.

In picture 001, i used a FR named "Console" to receive and store the value i typed in in it's labels as an intermediate process. Then in picture 002, i wrote some codes in "Apply"button's "OnPress" trigger to set the value to my actual target nodes.

But i can not set value to function node, such as TE's loadtime.(Why i have to do this? Answer: i want to change all TEs'loadtime at one time.) How can i do this?

Look forward to any suggestion.

Best Regards

FlexSim 19.1.0
gui
001.png (3.5 MiB)
002.png (3.2 MiB)
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

·
Allister Wilson avatar image
1 Like"
Allister Wilson answered Meng,Li commented

You can use a label on each target object to store its load / unload / process / etc. time, the trigger can just return the relevant label's value.

In the attached model, the processor has a processTime label which can be adjusted from the dashboard in realtime.


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

Meng,Li avatar image Meng,Li commented ·

Thanks for your helpful suggestion, Wilson. I have tried this method and it works well. I just wonder if there is a more direct way to do this. Look for a piece of code to apply directly to the TE's loadtime node.

0 Likes 0 ·
Allister Wilson avatar image Allister Wilson Meng,Li commented ·

Replacing the loadtime node's value with a number appears to work, but I have no idea if it may also have unintended consequences, given the node is meant to contain executable code.

I'd wait for a developer to confirm this isn't a bad idea before actually using it in a project.

See this manual entry if you're not sure how to replace a node's value.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Allister Wilson commented ·

As Allister said, that node is meant to contain executable code. Setting its value to a number instead of a script may work now, but it may cause troubles if something changes in the future.

You could set the variable's code directly. See:

https://answers.flexsim.com/answers/56361/view.html

https://answers.flexsim.com/answers/30252/view.html

0 Likes 0 ·
Show more comments

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.