question

Wang Z2 avatar image
0 Likes"
Wang Z2 asked Braydn T converted comment to answer

Change the queue property with code

hi !

In my simple model,I want change the queue property with code in user command.

I want trigger the user command in suitable time to make the queue changed.

Now, I want change the "Output",set "send to port" as "Push to TaskList"

Due to the large number of queues, it will save a lot of time if I can set the queue in batches with code.

I looked at the structure of “Output”, trying to find a breakthrough, I found the corresponding code written in the location of the instruction, but I don't know how to implement this function in the “User Command”.

Can you give me a example code?You can write in this simple model.code-to-change-the-queue-property.fsm

codeuser commandsqueue output port control
· 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 ·

@Wang Z2, are you still building your model? Or do you want to change a running model dynamically? Case 1: There is another approach to accomplish your task without source code. You can copy attributes, variables and triggers from a highlighted object to several selected objects by a tool. Case 2: is different!

0 Likes 0 ·
Wang Z2 avatar image Wang Z2 Joerg Vogel commented ·

I'm still building my model,I'll try your way.Thanks

by the way

I am building a parametrically driven model. That is: input parameters to generate the required model. Now, the entity and the simple A-key 、S-key connection between the entity has been completed. I started to change the entity properties and let the model run at the logical level。

For a simple example, let's say I am working on a model that can automatically generate an AS/RS system. I only need to enter the shelf size in the GUI interface, click on the button to generate the entity, and click another button to trigger user command and implement the logical layer connection.(like:change the queue or others' properties)

May I ask if this idea is feasible? Since I don't know C++, I can't program in C++. At present, I can only think of this method.

Because China’s learning resources are limited, and my English is not very good, it’s a little hard to learn Flexsim,thank you for your continued response and help, and I have gained a lot.

0 Likes 0 ·
Joshua S avatar image
0 Likes"
Joshua S answered

@Wang Z2

That idea is not only feasible, but is used by many of our users. The only problem is that it does require some code to implement which is based off of C++ and functions built into FlexSim, but doesn't require alot of code depending on what you are doing.

You can begin by creating a dashboard and trying out these options.

Then you can link them to global variables or have them run scripts with press or toggle events. You have to toggle the edit mode button on the side to get them to run after you have built them.

Here is an example model, You can change the values in the table, then hit the Rebuild button and the model will adjust to the values in the table. The code is rather complex if you haven't coded before, but it's just there to show you what it is capable of.

scalable-agv-rack-system-2.fsm


pic1.png (28.0 KiB)
5 |100000

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

John avatar image
1 Like"
John answered

@Wang Z2 ,13-1-17849-code-to-change-the-queue-property.fsmI attach a sample model, Hope this works for you.


5 |100000

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

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.