MODBUS Error

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

seokgi
Posts: 135
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 16 times
Contact:

MODBUS Error

Postby seokgi » Mon Apr 13, 2020 11:49 am

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.
Attachments
24FJ256GA406_Test.fcfx
(17.1 KiB) Downloaded 10 times
Last edited by seokgi on Sun May 24, 2020 12:48 am, edited 3 times in total.

viktor_au
Posts: 182
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 33 times
Been thanked: 46 times
Contact:

Re: MODBUS Error

Postby viktor_au » Mon Apr 13, 2020 12:42 pm

Hello seokgi

I tried to run your program but I've got a different warning:
Attachments
mis_v-1.jpg
mis_v-1.jpg (32.05 KiB) Viewed 533 times

seokgi
Posts: 135
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: MODBUS Error

Postby seokgi » Mon Apr 13, 2020 1:20 pm

Sorry!
That is my test program.
reload my program.
Attachments
24FJ256GA406_Test.fcfx
(10.27 KiB) Downloaded 12 times

viktor_au
Posts: 182
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 33 times
Been thanked: 46 times
Contact:

Re: MODBUS Error

Postby viktor_au » Mon Apr 13, 2020 11:05 pm

The last program gives the same error:
Attachments
mis_v-1.jpg
mis_v-1.jpg (32.05 KiB) Viewed 520 times

viktor_au
Posts: 182
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 33 times
Been thanked: 46 times
Contact:

Re: MODBUS Error

Postby viktor_au » Mon Apr 13, 2020 11:29 pm


seokgi
Posts: 135
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: MODBUS Error

Postby seokgi » Tue Apr 14, 2020 5:55 am

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?

viktor_au
Posts: 182
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 33 times
Been thanked: 46 times
Contact:

Re: MODBUS Error

Postby viktor_au » Tue Apr 14, 2020 8:23 am

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.
Attachments
Slave_Example-2.fcfx
(10.94 KiB) Downloaded 6 times

User avatar
Benj
Matrix Staff
Posts: 14786
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4750 times
Been thanked: 4358 times
Contact:

Re: MODBUS Error

Postby Benj » Tue Apr 14, 2020 12:00 pm

Hello,

But I get an "Insufficient bytes received" error.


What software is giving you this error?

seokgi
Posts: 135
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: MODBUS 오류

Postby seokgi » Wed Apr 15, 2020 11:55 pm

Hello!
I'm glad you're in good health. I was very worried.

I am using Modbus Poll.

Thank you for your interest.

seokgi
Posts: 135
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: MODBUS Error

Postby seokgi » Sat May 23, 2020 9:34 am

Hi Benj
Modbus errors continue to occur. What is the way?

User avatar
AbhijitR
Posts: 131
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 181 times
Been thanked: 48 times
Contact:

Re: MODBUS Error(Solved)

Postby AbhijitR » Sat May 23, 2020 11:46 am

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
Attachments
Slave_Example-2_23-05-2020.fcfx
(12.25 KiB) Downloaded 4 times
These users thanked the author AbhijitR for the post (total 2):
medelec35 (Sat May 23, 2020 2:26 pm) • QMESAR (Sat May 23, 2020 4:31 pm)
Rating: 10%
 

seokgi
Posts: 135
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: MODBUS Error

Postby seokgi » Sun May 24, 2020 12:49 am

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.
Attachments
K-20200524-311287.png
K-20200524-311287.png (20.99 KiB) Viewed 139 times

User avatar
AbhijitR
Posts: 131
Joined: Fri Nov 07, 2014 12:48 pm
Location: Pune, India
Has thanked: 181 times
Been thanked: 48 times
Contact:

Re: MODBUS Error

Postby AbhijitR » Sun May 24, 2020 7:54 am

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

viktor_au
Posts: 182
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 33 times
Been thanked: 46 times
Contact:

Re: MODBUS Error

Postby viktor_au » Sun May 24, 2020 10:16 am

Hello

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

seokgi
Posts: 135
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: MODBUS Error

Postby seokgi » Mon May 25, 2020 1:52 pm

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.

viktor_au
Posts: 182
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 33 times
Been thanked: 46 times
Contact:

Re: MODBUS Error

Postby viktor_au » Mon May 25, 2020 10:09 pm

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.