I read thru MODBUS documents. It's being mentioned that the RTU framing is something like START: 3.5 Char Times ADDRESS: 8 bits FUNCTION: 8 bits DATA: n x 8 bits CRC: 16 bits END: 3.5 Char Times I understand that this is a typical MODBUS frame but then there's something like RTU Character Framing with
START: 1 bit DATA: 8 bits PARITY(Odd or Even): 1 bit STOP: 1 bit The total bit is 11 bits. I'm confused with this in which isnt it the number of bits in the Frame is made up of 8 bits block? How can i relate the 11 bits of RTU frame with the above RTU framing?
I'll take a quick stab at this - I'm not a MODBUS specialist, but I think I know what this means.
The first one describes a MODBUS request frame comprising a series of bytes sent on a serial link: since the link may be RS485 multi drop and every byte is significant (there is no defined end of message byte for instance), you stay silent for at least 3.5 bytes. Then you send a byte for the destination station address. Then you send a byte for the function code. Then you send 'n' bytes of data. Then you send a 2 byte CRC. All receivers are able to decode the message, but in case it is garbled or a receiver is connected part way through, you stay silent for at least 3.5 bytes.
The second specification describes the framing of a single byte on a serial link:
1 Start bit
8 data bits
1 Parity bit (even or odd)
1 Stop bit
So if I gave you a parameter string like 9600,E,8,1 as relates to a COM port on a PC, would this second specification start to make sense to you?
Each of the bytes in the message specification (the first spec) are sent on a serial link with the paremeters in the second specification.
I know that you are studying VB for your MODBUS comunications from your previous posts on the group. Look at how that second specification relates to the properties of the MSCOMM control...
Correct me if i'm wrong. I think the silent time of 3.5 chars (not bytes) just happens after all the messages of destination's address, function codes, 'n' byte of data and 2 bytes of CRC instead of silent time of 3.5 Char after each type of bytes being sent.
Yes. This starts to make sense for me. That means in the serial link, the byte will be transmitted via this way: 1 start bit, 8 bits, 1 parity bit and 1 stop bit while what we're getting in our PC from the serial link is just the data bits we want and we need not to worry about how to manipulate the start, stop or parity bit as they are handled by the physical layer. Is that correct?
Bytes, chars, what's the difference in RTU? A unit of 8 bits of data then?
Yes, 3.5 bytes of silent time around each framed *message*. Long enough to give a controller that needs to play with handshake lines time to empty buffers and swap the direction of the line drivers on a 2 wire RS485 bus.