question

Shi Z avatar image
0 Likes"
Shi Z asked Shi Z edited

Run a simulation when open the model

Hello. I want to run a simulation when open the model.

I used the OnModelOpen Triggers. But it didn't work.

In fact, I find the go() function dosen't work until you use the mouse to click the run button.

For example, when you open a model and execute the go() function in script, it doesn't work. But if you click the run button and reset the model, then execute the go() function in script, it works.

Why?

Here is my test model. Thank you!

FlexSim 19.0.0
run the model error
onmodelopen.jpg (50.1 KiB)
go-test.fsm (16.5 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.

1 Answer

Joerg Vogel avatar image
2 Likes"
Joerg Vogel answered Shi Z edited

I don’t know why it doesn’t work. But if you need a model run start upon starting FlexSim, you can try command line parameters .

· 1
5 |100000

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

Shi Z avatar image Shi Z commented ·

hello, thank you for your advice.

Although it dosen't solve the problem directly, I got a useful imformation in that question.

Use the resetmodel(), then use the go() in OnModelOpen Trigger. It works.

I still don't konw why.

Thank you again. :)

1 Like 1 ·