question

j08j avatar image
0 Likes"
j08j asked Jeanette F commented

How to set source "Triggers" and rack "slot assigned strategy" using code?

There is my action to set source property, how can I do these step by FlexScript?

There is my code.IO by Paint Slot.fsm

Since I had set product's label and paint slot with different type, I want to assigned product into rack slot by matching label.

1.Source Triggers

screenshot-2024-03-18-at-73245-pm.pngscreenshot-2024-03-18-at-73312-pm.png

screenshot-2024-03-18-at-73323-pm.png

screenshot-2024-03-18-at-73340-pm.png

2. rack property

screenshot-2024-03-19-at-120811-am.png

FlexSim 24.0.2
flexscriptsourcecode
· 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.

Kavika F avatar image Kavika F ♦ commented ·
Hey @123, why do you want to set those things programmatically? Maybe if I understand what you're trying to accomplish with your model we could suggest a more robust solution.
0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Kavika F ♦ commented ·
@Kavika F, User 123 has asked a similar question to build a whole model including customized trigger code in a previous question automatically. This thread has been deleted eventually to find users to provide other information, he has already got. I proposed to edit or write a xml file to import treenode code into a model. I added a possible solution to add a string into a node or table cell which an experienced user can transfer into a trigger node to replace an executable code.
1 Like 1 ·
j08j avatar image j08j Joerg Vogel commented ·

I have solved the problem with modify the Table, but I still have the question with adding triggers and setting rack property.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @j08j, was Joerg Vogel's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

@123, rack property answered Jason Lightfoot in a different thread. https://answers.flexsim.com/answers/159726/view.html and triggers are containing executable string text. You can append a limited amount of characters as a string to a node and let a nodefunction execute such a string. But if you are looking for an automatically created source code of several line of code, you can write such a code into an xml formatted text file which you can read into a treenode in your model tree. Currently you try to shape a model while it is running. This is not an intended use of a simulator tool. You can think of a multiple step approach of preparing a model automatically in a first model run. Then on further steps you add parameters and at other runs and finally you let do the experimenter several runs to return results of a model. But you won't get it to work by FlexSim alone. You need a system routine to start FlexSim or execute a run start several times after finishing some changes in your model.

· 2
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·
Slot assign strategy is most a part of find slot query string. It is wrapped around some static code lines to assign a slot. You can parse a string by a label into your query. And you can build all other code statically, which you can transfer to any new rack object.
0 Likes 0 ·
j08j avatar image j08j Joerg Vogel commented ·

Thank you for your suggestion, I will try it!

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.