====== WebHMI's TCP server demo ======
In this demo, we will show how to read float data with one WebHMI (client) from another (server) via WebHMI's Modbus TCP server.
===== Test structure =====
- WebHMI server (MB_SERVER), reading data from Modbus RTU device (simulated with Modbus Slave tool)
- WebHMI client (MB_CLIENT), reading data from MB_SERVER
===== Modbus RTU device setup =====
We will simulate our data with Modbus Slave testing tool.
{{:app-notes:mb-slave-setup.png?direct}}
And check our MB_SERVER reads it well:
{{:app-notes:wb-mb-server-rtu-read-ok.png?direct&600}}
Depending on your test tool or device, you may need to set reverse order check to see your data properly.
{{:app-notes:reverse-order-checkbox.png?direct&400 }}
=== Enable Modbus TCP server function on WebHMI and check with testing tool ===
== Enable Modbus TCP server and setup the value ==
{{:app-notes:mb-server-sertup-float-value.png?direct&800|}}
Please refer to this [[modbus_tcp_server|article]] for enabling Modbus TCP server function.
== Check the value is available with testing tool ==
{{:app-notes:mb-poll-read-value-ok.png}}
===== Setup WebHMI Modbus TCP client =====
=== Create modbus tcp connection to your server ===
== Step 1 ==
Put proper MB_SERVER's IP address and port.
{{:app-notes:wh-mb-client-connection-setup.png?direct&600|}}
== Step 2 ==
Enable group read because float value is 2-word value, so you need group read function.
{{:app-notes:wh-mb-client-connection-group-read.png?direct&600|}}
For the register on the client's side, set Modbus TCP address, Double Word format and float type register (remember you may need reverse word order here too):
{{:app-notes:mb-client-reg-setup-1.png?direct&600|}}
{{:app-notes:mb-client-reg-setup-2.png?direct&600|}}
Then you will see the value:
{{:app-notes:mb-client-read-ok-value.png?direct&600|}}