ESP8266 Modbus I/O Modul

Ask here any questions about Suppanel capabilities, doubts or problems.
You can also leave your opinions.
Post Reply
JosefBernhardt
Posts: 5
Joined: Wed Feb 03, 2021 9:41 am

ESP8266 Modbus I/O Modul

Post by JosefBernhardt » Wed Feb 03, 2021 9:51 am

Dear Suppanel users,
I want to use the software Suppanel to access an ESP8266 module on which Modbus TCP is installed.
The module has 4 inputs 24V, 4 outputs 24V and an analog line from 0 to 10V for input and output.
I would like to program a panel to switch the outputs and read the inputs.
Here is a photo of the board.
ESP8266 24V I/O Modul
ESP8266 24V I/O Modul
FotoBoard1_5.jpg (222.75 KiB) Viewed 537 times
Are there already examples of such an application?
Greetings from Bad Abbach in Germany
Joseph

JosefBernhardt
Posts: 5
Joined: Wed Feb 03, 2021 9:41 am

Re: ESP8266 Modbus I/O Modul

Post by JosefBernhardt » Wed Feb 03, 2021 11:58 am

Dear Suppanel users,
I have now managed to read out the A / D converter and to describe the D / A converter. A switch and an LED also work.
For the switch I use the address 000001,
if I use a second switch with the address 000002 I get the error message Err: 11
How could I fix the problem?
Greetings from Bad Abbach in Germany
Joseph

User avatar
Suppanel
Site Admin
Posts: 47
Joined: Wed Jan 03, 2018 6:28 pm

Re: ESP8266 Modbus I/O Modul

Post by Suppanel » Wed Feb 03, 2021 2:01 pm

Hi,

On the left Suppanel menu, at Help >> Error Codes >> there it explains that error 11 means Illegal data address, this is an error that the device returns, then probably the coil 000002 does not exist on its address map.

Thanks for your inquiry.

JosefBernhardt
Posts: 5
Joined: Wed Feb 03, 2021 9:41 am

Re: ESP8266 Modbus I/O Modul

Post by JosefBernhardt » Wed Feb 03, 2021 3:36 pm

Hello Suppanel team,
I find that strange, when I access my module from the PC with the EasyModbusClient it works.
How could I isolate the problem?
Greetings to Josef

User avatar
Suppanel
Site Admin
Posts: 47
Joined: Wed Jan 03, 2018 6:28 pm

Re: ESP8266 Modbus I/O Modul

Post by Suppanel » Thu Feb 04, 2021 11:45 am

JosefBernhardt wrote:
Wed Feb 03, 2021 3:36 pm
Hello Suppanel team,
I find that strange, when I access my module from the PC with the EasyModbusClient it works.
How could I isolate the problem?
Greetings to Josef
The error 11 that Suppanel shows is a direct translation of Illegal Data Address exception on Modbus specs, this does not depend on whether the master is a PC or another device, it is the slave, the module which returns the error.

https://en.wikipedia.org/wiki/Modbus#Ma ... tion_codes

You can also try to connect the PC and Suppanel at the same time, if the module supports simultaneous connections, both should indicate the same.

Thanks

JosefBernhardt
Posts: 5
Joined: Wed Feb 03, 2021 9:41 am

Re: ESP8266 Modbus I/O Modul

Post by JosefBernhardt » Fri Feb 05, 2021 10:12 am

Dear Suppanel team,

I have now progressed with the ESP8266 Modbus problem.

If I want to read out the status of the coils, it works quite well with a test program if I read out four values ​​with start address 1.

Tx: 00 42 00 00 00 06 01 01 00 00 00 04
Rx: 00 42 00 00 00 04 01 01 01 01

If I want to read a value from start address 1, it also works.

Tx: 00 45 00 00 00 06 01 01 00 00 00 01
Rx: 00 45 00 00 00 04 01 01 01 01

But if I want to read a value from start address 2, 3 or 4, I get an error message.

Tx: 00 53 00 00 00 06 01 01 00 01 00 01
Rx: 00 53 00 00 00 03 01 81 02

So it is up to the ESP8266 software that only allows several values ​​to be read from address 1.

It looks like the Suppanel software tries to read out a value from address 2. Then I get the error message 11.

Would it be possible if I place four switches with start address 1 that the HMI software reads four values ​​from address 1 at the same time and not individually with different start addresses.

This works with Testsoftware

Tx: 00 5A 00 00 00 06 01 01 00 00 00 04
Rx: 00 5A 00 00 00 04 01 01 01 00

Maybe someone has an idea how I could solve the problem.

Regards Josef Bernhardt

User avatar
Suppanel
Site Admin
Posts: 47
Joined: Wed Jan 03, 2018 6:28 pm

Re: ESP8266 Modbus I/O Modul

Post by Suppanel » Fri Feb 05, 2021 7:27 pm

JosefBernhardt wrote:
Fri Feb 05, 2021 10:12 am

But if I want to read a value from start address 2, 3 or 4, I get an error message.

Tx: 00 53 00 00 00 06 01 01 00 01 00 01
Rx: 00 53 00 00 00 03 01 81 02

So it is up to the ESP8266 software that only allows several values ​​to be read from address 1.

It looks like the Suppanel software tries to read out a value from address 2. Then I get the error message 11.

The 8 ( the 5th bit set to 1) means a Modbus exception, and the 02 means Illegal Data Address, it means the ESP8266 doesn't recognize addresses 2, 3 or 4 as valid addresses. I don't know why, I never uses that module. Suppanel translates this exception to Error 11

If you want to do some test with a virtual slave you can use this Modbus slave simulator : https://sourceforge.net/projects/modrssim2/
JosefBernhardt wrote:
Fri Feb 05, 2021 10:12 am

Would it be possible if I place four switches with start address 1 that the HMI software reads four values ​​from address 1 at the same time and not individually with different start addresses.
in this case Suppanel makes a reading for each of the switches, with other more advanced protocols (Connections) like Ethernet/IP or OPC UA, also supported, Suppanel can read several variables in a single request.

Thanks.

JosefBernhardt
Posts: 5
Joined: Wed Feb 03, 2021 9:41 am

Re: ESP8266 Modbus I/O Modul

Post by JosefBernhardt » Sat Feb 27, 2021 2:21 pm

Unfortunately, I can't do it with Modbus!
Now I've tried to use OPC UA.
Is there any good slave (server) software for testing?
greetings
Joseph

User avatar
Suppanel
Site Admin
Posts: 47
Joined: Wed Jan 03, 2018 6:28 pm

Re: ESP8266 Modbus I/O Modul

Post by Suppanel » Sat Feb 27, 2021 7:09 pm

Hi,

Several alternatives:
  • Suppanel incorporates an internal OPC UA server that supplies simulated data for the demo panels. you can put any of them in Design Mode and see how it is configured.

    You can connect to this public server on the internet from Unified Automation that generates simulated data and also admits secure connections: opc.tcp://opcuaserver.com:48010

    You can install on a Windows PC OPC UA ANSI C Demo Server v1.9.1 from here : https://www.unified-automation.com/down ... rvers.html

    You can install on a PC Codesys PLC programming software that includes a soft PLC simulator that incorporates an OPC UA server.
Regards.

Post Reply