question

Tuan avatar image
0 Likes"
Tuan asked Jeanette F commented

Once I run the first step, subsequent actions will be executed automatically

The file is socket server.

The file communicates with the client through socket.

The first step is to create socket and waiting for the client to connect. (I have to click run)

The second step is to receive the messages from the client after the connection, , and then to run the model for 100 seconds. (I have to click run to receive the message and run the model)

The third step is to send the entire table of numbers (results)to the client.(I have to click run)

Finally, close the socket.(I have to click run)


Once I run the code(The first step), subsequent actions will be executed automatically without clicking run. This is my question.

In other words.

Waiting for the client to connect and automatically receiving the client messages, after running the code(the first step), and automatically running the model for 100 seconds, and automatically sending the results to the client, and finally, closing socket automatically.

擷取.png

GUI_Socket_InterArrivalTime.fsm

FlexSim 20.0.10
communication socketflexsript
· 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.

1 Answer

Kavika F avatar image
0 Likes"
Kavika F answered Kavika F commented

Hey @Tuan, the reason they won't run all together is because of the "return" statements. When the code executes the first "return", it will end the script. If you want to run all of the code together, you should remove all the return statements and leave the last one. If you need the values returned from those scripts, then you can save them into variables.

Additionally, you could put each of these 4 scripts into "User Commands" and then execute them sequentially in one script without having all of the code visible.

· 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.