Solved

RS485 communication

Posted on 2003-10-23
8
351 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
building a service to accessed via telnet client, want colors ? 4 78
Batch file output 20 77
wordsWithout 49 79
commonTwo  challenge 63 98
This is an explanation of a simple data model to help parse a JSON feed
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now