RS485: framing error (so called).

EStufC

Member
Join Date
May 2019
Location
Kikuara
Posts
69
Hello,
There are master with decentral perephery IO module which comprises SI module, and one slave hanging on the bus.

I faced with a phenomenon (it seems science calls it as framing error) when e.g. plc receives exactly the same number of characters which were sent, however they are all distorted.


In addition:

  • sometimes (I still can't figure out a reason) I get all characters in correct form.
  • after playing around with different commands I noticed a rather weird feature. The short answers suffers of framing error and relatively long ones don't.
Honestly saying I was a bit surprised when I had noticed such feature. So, any ideas please. I would be appreciated.

For a better understanding what I mean, please find a pic in the attachment.

Sample.png
 
Last edited:
If you change your baud rate will you get fewer errors?
This may be a good experiment. If you receive fewer errors, I would then check your cable and connection installation.

Regards,
 
You will more than likely need to provide much more detail on the application (make/model of all of the components involved, communications medium (wired, wireless, etc...), communications protocol, etc...)
Having said that, most "framing errors" are a result of a word format mismatch. Confirm that the baud rate and word format (data bits, parity, stop bits) are the same on both sides.
 
If you change your baud rate will you get fewer errors?
This may be a good experiment. If you receive fewer errors, I would then check your cable and connection installation.

Regards,

Thank you for a tip.

9800 I consider as not high rate at all. Most devices have that rate as default.

Anyway I'll try to decrease.

-cable -ok;

-termination -ok;

-biasing -ok;

An experiment with different baudrates will be first in my list.:unsure:
 
Last edited:
You will more than likely need to provide much more detail on the application (make/model of all of the components involved, communications medium (wired, wireless, etc...), communications protocol, etc...)
Having said that, most "framing errors" are a result of a word format mismatch. Confirm that the baud rate and word format (data bits, parity, stop bits) are the same on both sides.


that's the point, the slave answered with long answer: 9600, 1 - which means 9600 Baud rate, even parity bit.
exactly the same settings the master has.
 
Last edited:
I have "some" experience trouble shooting RS485 networks...


The times I have seen a Framing Error it was a cable issue.
Yesterday when I was out of options I had tried another type of cable, just in case. There was no effect there.

Anyway, I will keep in mind the cable issue.

The cable itself is twisted pair, copper multistrand wire. Also the cable has ridiculous 1 meter length.)


below is standard cable that I use.

csm_S_PN_667_ef7cb6f9c8.png
 
Last edited:
It's hard to really make any kind of determination from a single instance but I wouldn't necessarily call this a framing error.

In the short example you show, what did you expect to see?
Also, why do you consider the comma in the short string (2C hex) an unreadable character when you consider it a comma in the long string? Is it because you didn't expect a comma to be in that location?
Should all stings end with a CR LF combination as a terminator?

Keith
 
It's hard to really make any kind of determination from a single instance but I wouldn't necessarily call this a framing error.

In the short example you show, what did you expect to see?
Also, why do you consider the comma in the short string (2C hex) an unreadable character when you consider it a comma in the long string? Is it because you didn't expect a comma to be in that location?
Should all stings end with a CR LF combination as a terminator?

Keith


I see you look through my pictures carefully. )) Wait a moment...


as I have written above, sometimes miracle happens.
See in the attachment short answer that didn't suffer of error. The device answered with its current bus address 31 CRLF.


Yes according to docs all strings end with CR LF.

Answer_ADR31.png
 
Last edited:
In the example you just posted, is this the data you expected to get?

Also, in the first picture you posted, 74 hex indicated 4 characters and 79 hex indicated 9 characters. In the latest picture 34 hex indicates 4 characters. Which is the correct method? They are technically only one bit different.

Keith
 
In the example you just posted, is this the data you expected to get?

Also, in the first picture you posted, 74 hex indicated 4 characters and 79 hex indicated 9 characters. In the latest picture 34 hex indicates 4 characters. Which is the correct method? They are technically only one bit different.

Keith


yes, it is. exactly!


74hex, 34hex,

  • 7- receive data with toggling;

  • 3- just receive data;

  • 4- means four chars came to buffer to be read.
pay no attention I've tried both, the same effect.




Just I don't have a screenshot with 74hex and not distorted data..
 
Last edited:
Device is address 31.



Do you have 30 other devices at addresses 1 through 30?


How many other devices are there on the network?
 
Device is address 31.



Do you have 30 other devices at addresses 1 through 30?


How many other devices are there on the network?


Hello,
There are master with decentral perephery IO module which comprises SI module, and one slave hanging on the bus.


Also, for a better understanding of current configuration I attached one more pic, find it below.

Conf.png
 
Last edited:
Thanks for the graphic showing the architecture. Now I know what a 'decentral perephery' means (remote I/O). in fact, I suspect that's where the 'DP' in Profibus DP comes from.

It appears that the leading (first) character in the reply is generated by the slave to indicate the number of data bytes that follow and it's correct. But in the Post #1 unprintable/readable reply the data is so distorted that the End-of-message CF LF characters do not come through.

My serial experience matches Firejo's: 'framing errors' that I've seen are always a word format mismatch at the basic serial setup level: baud rate, parity, stop bit(s). And there's no other device on the network bus to cause a conflict to disrupt the data on a 'shared' network bus.

Yet sometimes you get correct replies, other times you get incorrect/unreadable replies.

For a frame to be correct with one transmission, but not on another seems to me to be either
- a vendor firmware implementation issue, not something any user has control over, or
- a misunderstanding of the task/operation - sending a command that sends the correct reply, but it isn't the expected reply due to thinking it should be something else.

If the Post #1 shows the unprintable/unreadable reply to a request for the device address, then the 0C 2C 26 0A makes no sense, yet each received byte was formatted with the correct start bit, 8 data bits, a parity bit and a stop bit in order to clear the UART and become part of the message, which to me means the received data was the slave's intended message. A lost bit or false bit would have caused one or more of the data bytes to be discarded.

I don't know why it's good reply data sometimes, bad reply data other times.
 
Thanks for the graphic showing the architecture. Now I know what a 'decentral perephery' means (remote I/O). in fact, I suspect that's where the 'DP' in Profibus DP comes from.


You know, IMHO of course: at the time Profibus was quite far from attaining Interbus.

However, Interbus is prerogative of another automation market monster. So, Profinet appeared. The acronym DP relocated to PN, as I see.


I don't know why it's good reply data sometimes, bad reply data other times.
Still, I see the difference: short reply <-> long reply only.
 
Last edited:

Similar Topics

Hi, Seeking consultation on an implementation matter, and have a question about Modicon Compact 984 communication through RS485: Three Modicon...
Replies
4
Views
120
i have an device which can support serial (RS485,RS232),CAN protocol . i want to connect it to an existing MIB 1553B bus ,what device will I need...
Replies
0
Views
57
Hi all, I am trying to do Modbus communications via the CB1241 RS485 Communication Board on a Siemens S71200 PLC. I am using a 1215C CPU. After...
Replies
6
Views
183
I'm trying to use a Red Lion Cub counter (Cub5B00) as a counter and give the cub's counts to a Graphite G12 PLC/HMI to display. After about an...
Replies
1
Views
85
Hello, I'm working on a protocol named "BitBus" which use a SDLC protocol for encapsulation. This protocol contains start & End Flag, but when i...
Replies
1
Views
139
Back
Top Bottom