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.

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.