Solved

RS485 communication

Posted on 2003-10-23
8
352 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
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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about problems I had with the new location API and permissions in Marshmallow

831 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