I've been trying to establish a socket communication between Flexsim and a Linux c++ script, but i had no sucess. Someone can help me. I put here the photos of each code i'm using.
I've been trying to establish a socket communication between Flexsim and a Linux c++ script, but i had no sucess. Someone can help me. I put here the photos of each code i'm using.
Also, be aware that the On Run Stop trigger fires every time you click the stop button. I would probably just make sure the socket is connected on reset, and then leave it open.
Hi @Catarina, was Jordan Johnson'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.
I can't debug your C++ program. But I made this demo that works on a local computer (127.0.0.1).
The python script makes a simple socket echo server. If you have python installed, you can run the file from a command prompt like so:
cd path/to/folder python -m echo_server.py
If you run that file, the server just sends and receives in a loop. Once the server is running, you can run the model and see that the model is sending and receiving via the socket. For me, this all worked fine, so I don't think it's an issue with FlexSim's socket code.
It looks like you're trying to connect to a different computer. Sometimes firewalls or other network issues can prevent sockets.
Note: I tested this with Python 3.11.
16 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved