Modbus 3.5 character time

P

Thread Starter

phillip

I understand that modbus RTU 3.5 character time depend on baud rate. But now i am failing to implement 3.5 character time using delphi. can some one help please!!!! The other thing is that how do we determine 1.5 character time between the bits?

Thanks in advance
'Stranded' Phil
 
C

Curt Wuollet

From dimming memory :^)

Frames are 10 or 11 bits. A start bit, 7 or 8 data bits, a parity bit, and 1, 1.5, or 2 stop bits (1.5 and 2 archaic ?). So roughly, (insert discussion of baud vs bps here) 9600 baud is 960 characters per second. That would make a character time perilously close to 1 mSec. Same math can provide a rule of thumb for other baud rates. I have use this to amuse and amaze by predicting within seconds, how long a transfer would take. Compression has ruined that parlor magic :^) It's going to be interesting doing accurate mSec delays or timing in delphi. Or sensing same. Much easier in jiffies.

Regards

cww
 
L

Lynn at Alist

Please, are you creating a PC application? Then don't sweat the 3.5 chars (that's one Modbus feature I wish weren't there). It's impossible to measure on a modern system with UART FIFOs, heavy OS overhead and stock serial drivers.

If you're the Master, just send your request, then wait for a response until you've not seen any new data in 50msec. That's almost possible under Windows (+/- 10msec I guess) without special hardware/drivers. (This is one reason the big PLC companies tools don't run on new Windows version right away - ALL of them end up including their own timing-aware serial drivers to replace the stock rubber-time Windows drivers)

If you're the slave, you can do the same - just hope your Master doesn't expect an answer to start faster than 100msec.

Or just examine the bytes as they come. You can easily estimate what sized message you should see. After 2 bytes you know the function; after a few more bytes you'll know the size. If the CRC is valid after this estimated size, you're done with ZERO timing delay. Yes, this violates the SACRED ISO/OSI 7-layer model by making your "Link" layer application aware. Whoppity-do. In the real world - solve your problems as you must. This estimation method gives you the best throughput and performance.

- LynnL, www.digi.com
 
R

Rahamath Dhalayath

I'm not sure about the implementation in delphi. This is related to physical layer implementation. In Windows, the API functions are available that can be used to define the time spacing between subsequent characters and also total timeout for a frame, that can be used for your purpose. In delphi also, similar functions may be available. Please free feel to contact for more details.

Rahamath Dhalayath
Software Engineer
[email protected]
www.sunlux-india.com
 
Top