ESP32 MODBUS ASCII

For general Flowcode discussion that does not belong in the other sections.
pedrazzi
Posts: 21
http://meble-kuchenne.info.pl
Joined: Sat Feb 20, 2021 7:46 am
Location: ITALY
Has thanked: 3 times
Been thanked: 2 times
Contact:

ESP32 MODBUS ASCII

Post by pedrazzi »

Hi, I am trying to make an ascii MODBUS with ESP32 wroom 32, but the compiler returns this error:
../main/esp-project.c: In function 'FCD_04c01_ModbusSlave1__SendAndCalcCRC16':
../main/esp-project.c:3226:9: error: 'FCR_RETVAL' may be used uninitialized in this function [-Werror = maybe-uninitialized]
Use: Reads the state of a single digital input.
Thanks in advance
Attachments
test_MB_ASCII.fcfx
(9.96 KiB) Downloaded 572 times
Tecnoservice

BenR
Matrix Staff
Posts: 1952
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 698 times

Re: ESP32 MODBUS ASCII

Post by BenR »

Hello,

Many thanks for letting us know. I have now pushed out an update to the update system that should solve the problem for you.

pedrazzi
Posts: 21
Joined: Sat Feb 20, 2021 7:46 am
Location: ITALY
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: ESP32 MODBUS ASCII

Post by pedrazzi »

perfect! Thanks for the help..
I tested the serial (OK) then I put the ascii modbus program back, but this doesn't work ..
Attachments
test_MB_ASCII.fcfx
(10.21 KiB) Downloaded 635 times
Tecnoservice

LeighM
Valued Contributor
Posts: 489
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 262 times

Re: ESP32 MODBUS ASCII

Post by LeighM »

If you need 19200 baud, could you try setting this in the UART properties and remove the ChangeBaud(4)
Could you try that please?

pedrazzi
Posts: 21
Joined: Sat Feb 20, 2021 7:46 am
Location: ITALY
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: ESP32 MODBUS ASCII

Post by pedrazzi »

the request is 9600 N 8 1, I put the setting at the beginning to be sure ..
Tecnoservice

pedrazzi
Posts: 21
Joined: Sat Feb 20, 2021 7:46 am
Location: ITALY
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: ESP32 MODBUS ASCII

Post by pedrazzi »

I tried to remove the setting, but the result is always the same. the strange thing is that it doesn't even respond error ...
(this is the message: :010200010010ED.. 3a 30 31 30 32 30 30 30 31 30 30 31 30 45 44 0d 0a )
Tecnoservice

LeighM
Valued Contributor
Posts: 489
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 262 times

Re: ESP32 MODBUS ASCII

Post by LeighM »

Could you check "Library Updates" "Full database"

pedrazzi
Posts: 21
Joined: Sat Feb 20, 2021 7:46 am
Location: ITALY
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: ESP32 MODBUS ASCII

Post by pedrazzi »

actually it was not fully updated, I did the full update and restarted, but the problem is not solved :(
Tecnoservice

pedrazzi
Posts: 21
Joined: Sat Feb 20, 2021 7:46 am
Location: ITALY
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: ESP32 MODBUS ASCII

Post by pedrazzi »

Hello, I also tried with another microprocessor (32U4 / Arduino Leonardo), but the result is the same, I'm afraid I'm making something trivial wrong ..

Thanks in advance
Tecnoservice

LeighM
Valued Contributor
Posts: 489
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 83 times
Been thanked: 262 times

Re: ESP32 MODBUS ASCII

Post by LeighM »

Can you explain a bit more about your setup, what you have connected and what you are trying to do?
The Flowcode Modbus Slave component is to be used for creating Modbus Slave devices.
If you are creating hardware to connect to an existing Modbus (slave) device, then you need to use the Flowcode Modbus Master component.

There are examples on the Flowcode Wiki, such as this one
https://www.flowcode.co.uk/wiki/index.p ... s:_System)

Post Reply