Is there a way to listen to flexsim model changes in real time?

Is there a way to listen to flexsim model changes in real time?

aditya_s3
Not applicable
38 Views
7 Replies
Message 1 of 8

Is there a way to listen to flexsim model changes in real time?

aditya_s3
Not applicable

[ FlexSim 21.1.0 ]

I know one can use FlexScript to query the model at a particular instance but I am not sure if it is possible to listen to changes in the model as they appear. Flexscript works like any query language, whenever we hit the query with query builders, it returns back the response from it. So if one has to listen to changes with Flexscript in realtime, one has to query the model every few milliseconds depending on the model speed. Is there another way around where we can build something which will broadcast the changes happening in the Flexsim model to the outside of FlexSim? Please help.

@joshuas @arun.k @joerg.v @phil.b @jacob.g @matt.l @jordan.j @david.c @steven.h @benjaminwilson @jeff.n

0 Likes
Accepted solutions (1)
39 Views
7 Replies
Replies (7)
Message 2 of 8

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

That sounds more like an application for using the emulation module with OPC-UA to export key variables to which other processes can subscribe.

Message 3 of 8

aditya_s3
Not applicable

From FlexSim documentation I could figure out that OPA-UA is the protocol for connecting hardware (PLCs) to the emulation model in Flexsim. I am more interested in connecting the Flexsim model to another software component outside FlexSim in real-time.

0 Likes
Message 4 of 8

Ben_WilsonADSK
Community Manager
Community Manager

You could try FlexSim's socket commands (find recent comments here), the HTTP API, or or use the embedded Chromium browser along with websockets, ajax calls, etc., along with functions that interact between Chromium and your model. (With Chromium, be aware that with changes as of FlexSim 21.0.0, due to Chromium's multi-process architecture, the FlexScript command callwebscriptmethod() and JavaScript function fireFlexsimEvent() are now asynchronous and do not return values directly. See the linked release notes for more info and an example.

If those don't suit your needs, there is also a Module SDK that will allow you to link external code to allow connectivity to whatever you may need.

Message 5 of 8

jason_lightfootVL7B4
Autodesk
Autodesk

You can run an OPC server on a PC or raspberry pi without a PLC. Additionally Node-Red has OPC modules and support for MQTT.

Message 6 of 8

Ben_WilsonADSK
Community Manager
Community Manager

Hi @Aditya S3, was jason.lightfoot's answer helpful? If so, please click the red "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 unaccept and comment back to reopen your question.

0 Likes
Message 7 of 8

leelichou1112
Not applicable

@傑森萊特富特請教請問如何製作真正的機械臂使用MQTT向節點red發送消息


0 Likes
Message 8 of 8

ryan_c10
Not applicable

Hi @立洲,

Could you please post this as a new question? You can link to this post in your new question if that would be helpful for others trying to answer your question. Thanks!

0 Likes