question

Bendjelloul A avatar image
0 Likes"
Bendjelloul A asked Matt Long answered

Emulation using Modbus TCP - write problem

Hello,

I can connect and read holding registers in Flexsim (emulation : Modbus TCP Server) using modbus TCP Client, but nothing happens in the model when I write to holding registers.

Please find enclosed the simplified flexsim model used in the test (problem occured with both versions 18.2 and 19.2.3).

what could be the problem?

Thank you for your support

modbus-test.fsm

FlexSim 19.2.3
modbus
modbus-test.fsm (32.8 KiB)
· 3
5 |100000

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

Bendjelloul A avatar image Bendjelloul A commented ·

Please find enclosed a print screen of the test, it does not work even for writing in global table. (I checked the order of registers in reading input registers and it's correct).

The holding registers values are changing correctly in the server (verified with a second modbus TCP Master) but nothing happens in flexsim.

modbus-emulation-controls-does-not-work.png

globaltable-config-in-emulation.png

0 Likes 0 ·
Joshua S avatar image Joshua S Bendjelloul A commented ·

Are you able to write any values from FlexSim to the server?

0 Likes 0 ·
Bendjelloul A avatar image Bendjelloul A commented ·

I tested the modbus server of flexsim using a Photo eye and it's working correctly. the value in the register is changing according to the photo eye and The Modbus TCP client reads it successfully.

How ever the controls does not work.

0 Likes 0 ·
Matt Long avatar image
0 Likes"
Matt Long answered

@Dominik U Sorry for the late response. We debugged the issue and found it to be a bug in our Modbus connection. We have fixed the issue in 20.1.2 and 20.0.6. You should now be able to communicate properly with FlexSim from client applications.

5 |100000

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

Joshua S avatar image
2 Likes"
Joshua S answered Dominik U commented

Also in the Connections Tab, change it from a Server to a Client.

· 7
5 |100000

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

Bendjelloul A avatar image Bendjelloul A commented ·

sure, I totally agree. I used to work with my flexsim model as opc da client with an opc server.

Now, I need to work with flexsim model as a server.

And I am connecting to flesxim modbus server with modbus tcp client and it connects successfully.

How ever the controls does not work.

NB: I avoided to send you the model of my work. And used a simpler model instead, to focus better on the emulation problem rather than the model.

Thank you for your support

1 Like 1 ·
Joshua S avatar image Joshua S Bendjelloul A commented ·

My apologies, I've been misreading your posts. I'll look into this more. What modbus client tool are you using?

1 Like 1 ·
Bendjelloul A avatar image Bendjelloul A commented ·

thank you, I can interact successfully with flexsim as opc da client.

I would like to work with flexsim model as a server. (modbus or any other protocol)

0 Likes 0 ·
Joshua S avatar image Joshua S Bendjelloul A commented ·

If you set FlexSim to be the server, then you need to be talking to a client and not another server.

2 Likes 2 ·
Bendjelloul A avatar image Bendjelloul A commented ·

Ok, modbus TCP client is : ModbusTool.exe

0 Likes 0 ·
Matt Long avatar image Matt Long Bendjelloul A commented ·

@Bendjelloul A I'm having trouble finding that software. Is that a free app you can download? And if so from where?

0 Likes 0 ·
Dominik U avatar image Dominik U Matt Long commented ·

@Matt Long

Here: https://www.modbustools.com/

In my company, we have the same issue. Any tools, wich we have, can't send data to "inside" of simulation. Modbus Tools, Simple Modbus, even my own tools have no chanse to do it.

Some time ago, I was testing server emulation and finde something wierd in it.

If you write from simulation to server registers and try to read this by some client, then everythig is ok, data are availble. But when data is writen to server by modbus client then nothing happens in simulation. In this plase - please hold onto your chair - when client try to read data from server (that was send few moments ago), this data is in server. Main malfunction of server emulation is that, data isn't visible as some variable or event, even though it exist in server registers.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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