How to use the value returned by Emulation to control the object sent by the Source
How to set Modbus Control Register?
provide examples.
How to use the value returned by Emulation to control the object sent by the Source
How to set Modbus Control Register?
provide examples.
Hi @Candan, was Felix Möhlmann'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 unaccept and comment back to reopen your question.
To control what type of object the source creates, you can set its 'itemclass' variable.
object.setVariable('itemclass', rank)
The second parameter 'rank' is the flow items rank/index in the Flow Item Bin.
The attached model was a test. We set the modbus connection up so we could remote control the conveyor speed from a Raspberry Pi.
1.Does it means I send data by my computer IP? Can I send data by other port of mobus?
2.How do I set in variables if I want to use photoeye?
1. Data is exchanged through a network connection. FlexSim can either function as the server (slave), which is what we did in our test. So the IP address is that of the computer running FlexSim in the local network. If FlexSim is running as client, it would be the address of the server.
Yes, you can change which port is used. 502 is used as standard in any source we found, so we used that one.
2. You'd add a new Sensor Register (Sensor - FlexSim writes values on event, Control - FlexSim reacts to change in value) and choose the photo eye as the Associated Object. Under 'Write Events' you can then specific which event will trigger a write operation and what value should written to the register.
It's in the nature of the task: You can't verify if the connection works without setting one up. The model should serve as an example of how to set up a connection in FlexSim and connect registers to values in the model.
We used pymodbus (modbus implementation for python) to write to and read from the registers FlexSim provides when running as server. This article helped with the basics (mainly section: pymodbus as Modbus client)
https://blog.jonasneubert.com/2019/11/02/using-pymodbus-to-communicate-with-a-plc/
9 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