?
Solved

RS485 communication

Posted on 2003-10-23
8
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
8 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

Independent Software Vendors: 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

This is about my first experience with programming Arduino.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

770 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