MODBUS Error
Moderator: Benj
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
MODBUS Error
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.
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.
- Attachments
-
- 24FJ256GA406_Test.fcfx
- (17.1 KiB) Downloaded 224 times
Last edited by seokgi on Sun May 24, 2020 12:48 am, edited 3 times in total.
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: MODBUS Error
Hello seokgi
I tried to run your program but I've got a different warning:
I tried to run your program but I've got a different warning:
- Attachments
-
- mis_v-1.jpg
- (32.05 KiB) Downloaded 568 times
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: MODBUS Error
Sorry!
That is my test program.
reload my program.
That is my test program.
reload my program.
- Attachments
-
- 24FJ256GA406_Test.fcfx
- (10.27 KiB) Downloaded 189 times
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: MODBUS Error
The last program gives the same error:
- Attachments
-
- mis_v-1.jpg
- (32.05 KiB) Downloaded 555 times
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: MODBUS Error
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
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
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: MODBUS Error
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?
We also reviewed your advice and removed the variables you tested last time. However, it does not work either.
Is there another way?
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: MODBUS Error
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.
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.
- Attachments
-
- Slave_Example-2.fcfx
- (10.94 KiB) Downloaded 199 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: MODBUS Error
Hello,
What software is giving you this error?But I get an "Insufficient bytes received" error.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: MODBUS 오류
Hello!
I'm glad you're in good health. I was very worried.
I am using Modbus Poll.
Thank you for your interest.
I'm glad you're in good health. I was very worried.
I am using Modbus Poll.
Thank you for your interest.
- AbhijitR
- Posts: 299
- Joined: Fri Nov 07, 2014 12:48 pm
- Location: Pune, India
- Has thanked: 280 times
- Been thanked: 79 times
- Contact:
Re: MODBUS Error(Solved)
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
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
- Attachments
-
- Slave_Example-2_23-05-2020.fcfx
- (12.25 KiB) Downloaded 146 times
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: MODBUS Error
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.
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.
- Attachments
-
- K-20200524-311287.png
- (20.99 KiB) Downloaded 174 times
- AbhijitR
- Posts: 299
- Joined: Fri Nov 07, 2014 12:48 pm
- Location: Pune, India
- Has thanked: 280 times
- Been thanked: 79 times
- Contact:
Re: MODBUS Error
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
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
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: MODBUS Error
Hello
Rs232 or Rs485...
----------------------
The question is how many slaves do you want your modbus master to communicate with?
Rs232 or Rs485...
----------------------
The question is how many slaves do you want your modbus master to communicate with?
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: MODBUS Error
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.
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.
-
- Posts: 342
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 60 times
- Contact:
Re: MODBUS Error
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.
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.