question

Candan avatar image
0 Likes"
Candan asked Jeanette F commented

Emulation Modbus TCP Connection

How to simulate, using two models on a local server, using points to send signals to each other


For example, process 1, A connection:


Model A: Queue1→Processor1→Queue2→Processor2


Process 2, receiving signal without A connection


Model B: Queue1→Processor1→Queue2→Processor2




When model A:Queue1 has objects generated, model B:Queue1 will also have objects generated




Same as other items

FlexSim 22.2.0
emulation tcp
· 2
5 |100000

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

Candan avatar image Candan commented ·

who can answer this question?

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

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.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

You would add a modbus connection to both Flexsim instances, configuring one to act as the server and the other as the client.

Then you set up variables to write/read data to/from the server. Sensor Variables react to something in the model and write data to the server. Control Variables react to changes on the server and would be used to influence the model.

Choose a fitting register type to store the number data you want to transfer between models (information on what Coil, Holding Register, etc. mean can be found in many places online - in short: a Coil is only a single bit/binary value, a register can hold more data, input registers can only function one way).

Attached are simple example models. If you run them on the same machine, items will be created in the queue in the server model whenever an item is processed in the client model.

modbus-example.gif

modbus_example_fm_server.fsm

modbus_example_fm_client.fsm


· 2
5 |100000

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

Candan avatar image Candan commented ·

What if one source transfers to multiple processors?

A model. to B model.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Candan commented ·

You find a way to transfer the information which processor the item is send to to the other model. For example, you add an additional variable that sets a label in the server model depending on the exit port of the item. That label can then be used to determine where to create the item.

modbus_example_fm_server_1.fsm

modbus_example_fm_client_1.fsm

0 Likes 0 ·