Link to home
Start Free TrialLog in
Avatar of sonnur
sonnur

asked on

RS485 communication

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
Avatar of GloomyFriar
GloomyFriar

What is long of an interconnect cable?
You are sure, what the converter is serviceable?
The error arises by transmission in both directions or only in one?
Avatar of sonnur

ASKER

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.
Does it transmit wrong every time, or just the first time you plug everything together and start the software?
Avatar of sonnur

ASKER


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).
ASKER CERTIFIED SOLUTION
Avatar of 1mak
1mak

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sonnur

ASKER

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