question

lancewu avatar image
0 Likes"
lancewu asked Jeanette F commented

Can the WEB SERVER request open the model to carry parameters?

When I am using WEB SERVER, I want to customize the request interface. I noticed that he has such a command


  • webserver.dll?createinstance=my%20model starts an instance of FlexSim running the model specified (here it's 'my model.fsm') and returns a short xml reply containing the instance number.


  • it can request to open the flexsim model, and I want to carry parameters when opening the model, similar to this:Flexsimxe myfile.fsm - rofops 8
    We can use commandlineparam (str param) to obtain parameters. Can web server requests achieve this?
FlexSim 22.1.4
codewebserver
· 3
5 |100000

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

lancewu avatar image lancewu commented ·

Can webserver implement this feature?

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

Hi @lancewu,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

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

Hi @lancewu, 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

I don’t think that there are parameters that you can parse into a model On Open event from system command line parameters. Those values must be available in source code editor default header declared as param1, param2, and so on. Maybe they are available, then you should find them there in this model event in your model toolbox.

I would try instead to provide external parameters to a model in a text file, that you load in an event On Model loading or opening or resetting. You can implement a dialog to modify a text file in a web server. Then you invoke a call to open FlexSim model for a Webserver.

Alternatively you can try to use pointer addresses in system memory to parse values from different system processes into another. You will probably need for such an approach programming languages that can set and read such system pointer values like C++, .net, …

Actually this approach is not intentionally what a FlexSim Webserver does. It is not meant to provide individually customized model instances for every connected client. This would involve to start a new session for every new connected client and you need an own license for each session then. And your server must be really powerful running simultaneously several models.

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.