Modbus / TCP Error

For general Flowcode discussion that does not belong in the other sections.
seokgi
Posts: 217
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 6 times
Been thanked: 7 times

Flowcode v10 Re: Modbus / TCP Error

Post by seokgi »

Yesterday, with your help, I tested it.



I initialized the PC, installed FC10 and updated.
However, MODBUS/TCP still doesn't work.

Upload the project file and logic analyzer screen here.
It may be difficult, but please take a look.

I look forward to your help on site.

Thank you.
And I'm sorry.
Attachments
Screen.jpg
Screen.jpg (74.57 KiB) Viewed 2552 times
230719_Freezer-SPI_Ethernet_TEST.fcfx
(58.34 KiB) Downloaded 474 times

seokgi
Posts: 217
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 6 times
Been thanked: 7 times

Re: Modbus / TCP Error

Post by seokgi »

Modbus Poll accured read error, Write Error, Response Error, and Exception Error 31. 97. 32

Ping is OK.

And SPI operates only in Software Mode.

seokgi
Posts: 217
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 6 times
Been thanked: 7 times

Re: Modbus / TCP Error

Post by seokgi »

Is there any way I can do it?
I'm sorry to have been troublesome.

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

Re: Modbus / TCP Error

Post by BenR »

Can you try and increase the SPI prescale for the TXP_IP component, things weren't working for me when I had this set too low. 250KHz clock seems like it should be ok.

Might also be worth trying a hardware SPI channel if available.

Might also be worth doing a flasher test to confirm the MCU is running at the speed you think it is.
https://www.flowcode.co.uk/wiki/index.p ... ED_flasher

What are you using as the Master?

seokgi
Posts: 217
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 6 times
Been thanked: 7 times

Re: Modbus / TCP Error

Post by seokgi »

I tried changing the SPI Prescale. But the clock rate doesn't change and the error still occurs.

10Hz is generated by the MCU, and when viewed with an oscilloscope, it is measured as approximately 9.96Hz.

And if you change the hardware channel, the system won't work (maybe hangup?)

Also, if I2C is changed to a hardware channel, it does not work. If the serial EPROM does not work, changing it with software will work.

Engineers who using other languages do not understand this situation.

Thank you.
Attachments
Screen3.jpg
Screen3.jpg (51.24 KiB) Viewed 2504 times
Screen2.jpg
Screen2.jpg (34.69 KiB) Viewed 2504 times
Screen1.jpg
Screen1.jpg (42.39 KiB) Viewed 2504 times

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

Re: Modbus / TCP Error

Post by BenR »

For the TCP_IP_W5500 component try switching to a hardware channel and also change the Fosc/2 to something more like Fosc/16 or /32 or /64

For me /4 wasn't working but as soon as I went to /16 it all worked flawlessly.

Everything else looks to be ok.

Have you tried my program at all on your hardware and in the simulator to see if that is working for you?

Post Reply