?
Solved

RS485 communication

Posted on 2003-10-23
8
Medium Priority
?
362 Views
Last Modified: 2011-09-20
Hi,
I have a device which is connected to PC over RS232/485 converter.The PC interface program and the device communicates Modbus ASCII&RTU protocol.Everything is OK except ASCII mode in 19200 baud rate.In this conditions sometimes the program give me a timeout error.Timeout error occurs if the program couldn't catch the first byte. (It takes 0x9D and 0x3F instead of 0x3A).I suppose that after sending the last character the transmit line can't change the position immediately and it couldn't receive the right byte in time.
I tried lots of things but it still gives the same error.

If you have any idea please help me...
Thanks
0
Comment
Question by:sonnur
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9606018
What is long of an interconnect cable?
You are sure, what the converter is serviceable?
0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9606029
The error arises by transmission in both directions or only in one?
0
 

Author Comment

by:sonnur
ID: 9606277
Hi
Connection cable is not so long,I think half meter.

There is nothing wrong with the device.The problem is about the program (I think).I run the program do the comport settings (19200, 8 data bit , no parity and a stop bit) and select the Modbus mode (ASCII).I observe the bytes that the PC sends and receives.The first byte which the PC receives is sometimes wrong.In fact I am working in this subject and saw just a minute ago that also in RTU mode (in 19200 baud) the same error occurs.

The problem is the first byte is taken wrong by PC in 19200 baud.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:1mak
ID: 9606289
Does it transmit wrong every time, or just the first time you plug everything together and start the software?
0
 

Author Comment

by:sonnur
ID: 9606473

The bug doesn't only happen I plug everything together first time  and start the software. Also
the transmission is not wrong everytime.The bug happens sometimes in first byte.In ASCII mode the first byte must be 0x3A (111010) but it is sometimes 0x9D (10011101).
0
 
LVL 4

Accepted Solution

by:
1mak earned 80 total points
ID: 9608082
What software are you using?

From what I remember of the Modbus protocol (it's been a long time since i was writing software to talk to Modbus devices...) it has a very simple checksum built in, and if the checksum fails the software should just send it's request again? This doesn't necessarily solve your bad first byte problem, but it works around it...
0
 

Author Comment

by:sonnur
ID: 9612657
I tested the device with 2 software that I downloaded from internet and mine.Everything is ok except the first byte.If I ignore it , because in ASCII mode the first byte must be ':' = ox3A,there is no problem I think.I will test it like this..I hope there won't be problem..
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Loops Section Overview

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question