Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Modbus
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Modbus ASCII === Modbus ASCII makes use of [[ASCII]] characters for protocol communication. The ASCII format uses a [[longitudinal redundancy check]] checksum. Modbus ASCII messages are framed by a leading colon (":") and trailing newline (CR/LF). A Modbus ASCII frame includes:{{Sfn|MODBUS over Serial Line protocol|2006|p=17|ps=, "2.5.2.1 MODBUS Message ASCII Framing"}} {| class="wikitable" style="float:middle; margin:0 0 1em 1em;" |- ! Name ! Length (bytes) ! Function |- ! Start | 1 | Colon <code>:</code> ([[ASCII]] value 3A<sub>16</sub>) |- ! Address | 2 | Station address |- ! Function | 2 | Indicates the function code e.g. "read coils" |- ! Data |''n'' Γ 2 | Data + length will be filled depending on the message type |- ! LRC | 2 |[[Checksum]] ([[longitudinal redundancy check]]) |- ! End | 2 | Carriage return + line feed (CR/LF) pair (ASCII values 0D<sub>16</sub> and 0A<sub>16</sub>) |} Address, Function, Data, and LRC are ASCII hexadecimal encoded values, whereby 8-bit values (0β255) are encoded as two human-readable ASCII characters from the ranges 0β9 and AβF. For example, a value of 122 (7A<sub>16</sub>) is encoded as two ASCII characters, "7" and "A", and transmitted as two bytes, <code>55</code> (37<sub>16</sub>, ASCII value for "7") and <code>65</code> (41<sub>16</sub>, ASCII value for "A"). LRC is calculated as the sum of 8-bit values (excluding the start and end characters), negated ([[two's complement]]) and encoded as an 8-bit value. For example, if Address, Function, and Data are 247, 3, 19, 137, 0, and 10, the two's complement of their sum (416) is β416; this trimmed to 8 bits is 96 (256βΓβ2βββ416 = 60<sub>16</sub>), giving the following 17 ASCII character frame: <code>:F7031389000A60ββ</code>. LRC is specified for use only as a checksum: because it is calculated on the encoded data rather than the transmitted characters, its 'longitudinal' characteristic is not available for use with parity bits to locate single-bit errors.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)