Page 1 of 1

MODBUS Error

Posted: Mon Apr 13, 2020 11:49 am
by seokgi
Hi everyone!
I want to send and receive data using MODBUS.
But I get an "Insufficient bytes received" error.
I used several methods but it doesn't work.
Can someone help me?
Thank you.

Re: MODBUS Error

Posted: Mon Apr 13, 2020 12:42 pm
by viktor_au
Hello seokgi

I tried to run your program but I've got a different warning:

Re: MODBUS Error

Posted: Mon Apr 13, 2020 1:20 pm
by seokgi
Sorry!
That is my test program.
reload my program.

Re: MODBUS Error

Posted: Mon Apr 13, 2020 11:05 pm
by viktor_au
The last program gives the same error:

Re: MODBUS Error

Posted: Mon Apr 13, 2020 11:29 pm
by viktor_au
Hi again
A few more questions please...

What program gives you the error?
Did you check the discussion on the next forums?

https://www.electronicspoint.com/forums ... us.269512/
https://forge.codesys.com/forge/talk/Ru ... ecb0598e7/
https://www.edaboard.com/showthread.php ... -in-modbus

Re: MODBUS Error

Posted: Tue Apr 14, 2020 5:55 am
by seokgi
thank you for your attention.
We also reviewed your advice and removed the variables you tested last time. However, it does not work either.
Is there another way?

Re: MODBUS Error

Posted: Tue Apr 14, 2020 8:23 am
by viktor_au
I am not an advanced user, far from it.
My advice is only correct by 80% if not less.
-----------------
Let us have a look at the attached modbus slave example done by Ben.
Do you see the difference between your program and Ben's?
--------------
What I would do?
---------------
Try to change your program:
- Change the speed to 9600
- Use only one register for Modbus Master to request data from
- Try to change the timeout from 50 to 100 or even to 200
----------------------------------------------------------------------------
- Instead of using the RX-485 feedback in one form try to find out what kind of error is coming back to slave from master
- is it 255?
- is it some other number?
Try to print the Rx-485 to see what is coming from master.

Re: MODBUS Error

Posted: Tue Apr 14, 2020 12:00 pm
by Benj
Hello,
But I get an "Insufficient bytes received" error.
What software is giving you this error?

Re: MODBUS 오류

Posted: Wed Apr 15, 2020 11:55 pm
by seokgi
Hello!
I'm glad you're in good health. I was very worried.

I am using Modbus Poll.

Thank you for your interest.

Re: MODBUS Error

Posted: Sat May 23, 2020 9:34 am
by seokgi
Hi Benj
Modbus errors continue to occur. What is the way?

Re: MODBUS Error(Solved)

Posted: Sat May 23, 2020 11:46 am
by AbhijitR
Hello! Seokgi

I have modified few settings from the properties of the MODBUS slave in your chart, which normally I use in my application, unfortunately I do not have the chip you used so testing was not possible.

In the properties I always use RS232 as BUS and add one RS485 IC to the Rx and Tx pins of the PIC chip. I use MODSCAN on the computer to test my hardware.

Below in the properties window whatever count in the "Number of Addresses" you keep for the Coils or Inputs etc, need to be the same in the MODSCAN, if it is different then it do not work.

Abhi

Re: MODBUS Error

Posted: Sun May 24, 2020 12:49 am
by seokgi
Hi !

I don't know why, but changing from RS-485 mode to RS-232 mode works well. What does this mean?

Like the screen captured from the Modbus Poll, it does not respond to Tx once, but once Tx occurs, there is a response.

Re: MODBUS Error

Posted: Sun May 24, 2020 7:54 am
by AbhijitR
Hello!

Regarding the selection of RS485, I read in the datasheet too about having 6 UART modules and the chip do support RS485, but I am really not able to answer may be Ben or someone from the team is the correct person to answer.

One small doubt, when you select the bus as RS485 in that case I hope there is one USB to RS485 converter, in my case I always use the ADAM-4561 converter between the PIC and computer. (PIC chip ---> RS485 chip ---> ADAM-4561 ---> Computer)

In the picture regarding the Tx and Rx I think you should once check the response time in the hardware as well in the computer settings.

Abhi

Re: MODBUS Error

Posted: Sun May 24, 2020 10:16 am
by viktor_au
Hello

Rs232 or Rs485...
----------------------
The question is how many slaves do you want your modbus master to communicate with?

Re: MODBUS Error

Posted: Mon May 25, 2020 1:52 pm
by seokgi
I use MODBUS RTU (RS-485 base) through MAX13487.
The ADAM-4561 mentioned is connected to a PC via USB. USB is not reliable in the industry. So I use RS-232 to RS-485 Converter ADAM-4520. ADAM-4520 has been around for about 20 years. Trust infinitely.

Thank you.

Re: MODBUS Error

Posted: Mon May 25, 2020 10:09 pm
by viktor_au
Hi Seogki

You work on industrial project, that's not a hobby project, isn't it?
Sure, if you have the money you can buy an expensive equipment.
All the best with your project.