MCU : PIC24FJ512GA606
Communication : Modbus Slave Mode (RS-232)
This is an RS-232-based Modbus slave mode.
I'm using a Flash EEPROM component. The Flash EEPROM works fine. When I download a HEX file, communication works fine for a while, then stops. The digital output for monitoring works fine.
The same issue persists even after removing all other routines.
The device I compiled and installed previously on the same board (6/24/2025) works fine. After a reset, it works fine again, but then communication stops.
The same issue occurs with FC10 and FC11.
Please help.
Thank you.
Modbus Communication Down
-
seokgi
- Posts: 222
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 1:43 pm
- Has thanked: 8 times
- Been thanked: 8 times
-
BenR
- Matrix Staff
- Posts: 1995
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 524 times
- Been thanked: 711 times
Re: Modbus Communication Down
Hello,
Ok this sounds like a problem maybe to do with bytes getting dropped. The trouble is the CheckForIncoming has to be there to catch the bytes from the master and if you have anything that can cause delays then this can be disrupted.
I wonder if we can move the incoming data collection from the CheckForIncoming macro to an interrupt to improve the chances of keeping everything running.
If you like I can try and make this adjustment to the component and see if that gets us anywhere.
Do you have other interrupts in your program?
Ok this sounds like a problem maybe to do with bytes getting dropped. The trouble is the CheckForIncoming has to be there to catch the bytes from the master and if you have anything that can cause delays then this can be disrupted.
I wonder if we can move the incoming data collection from the CheckForIncoming macro to an interrupt to improve the chances of keeping everything running.
If you like I can try and make this adjustment to the component and see if that gets us anywhere.
Do you have other interrupts in your program?
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel