Solved

RS485 communication

Posted on 2003-10-23
8
354 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
Industry Leaders: 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!

 
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 40 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Please help| Getting the syntax error in below query. 2 80
BATCH to EXE Converter 2 98
Java List 4 76
Best laptop programming computer for Windows development 14 85
This article will show, step by step, how to integrate R code into a R Sweave document
A short article about a problem I had getting the GPS LocationListener working.
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 …

737 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