BusWorks
Model 903MB/902MB/901MB Network I/O Module User’s Manual Digital I/O
___________________________________________________________________________________________
- 15 -
CRC Error Checking
RTU Mode message frames include an error checking
method that is based on a Cyclical Redundancy Check (CRC).
The error checking field of a frame contains a 16-bit value (two 8-
bit bytes) that contain the result of a Cyclical Redundancy Check
(CRC) calculation performed on the message contents.
The CRC value is calculated by the transmitting device and is
appended to the message as the last field in a message—the low
order byte is appended first, followed by the high-order byte.
Thus, the CRC high-order byte is the last byte to be sent in a
message. The receiving device calculates a CRC during receipt
of a message and compares the calculated value to that received
in the CRC field. If the two values differ, an error results.
The CRC is started by first preloading the 16-bit CRC register
to all 1’s. Successive 8-bit bytes of the message (only the 8-data
bits in each character—no start, stop, or parity bits) are applied to
the current contents of the register, and each 8-bit character is
exclusive OR’ed with the register contents. The exclusive OR
result is shifted in the direction of the least significant bit (lsb) of
the CRC, with a zero placed into the most significant bit (msb).
The lsb is then extracted and examined, if the lsb is a 1, the
register is exclusive OR’ed with a preset fixed value. If the lsb is
a 0, no exclusive OR takes place. This process is repeated until
8 shifts have been performed. After the last (eighth) shift, the
next 8-bit byte is exclusive OR’ed with the register’s current
contents, and the process repeats itself for 8 more shifts as
described above. The final contents of the CRC register after all
the message bytes have been applied is the CRC value.
Modbus Exceptions
If an unsupported function code is sent to a module, then the
exception code 01 (Illegal Function) will be returned in the data
field of the response message. If a holding register is written with
an invalid value, then exception code 03 (Illegal Data Value) will
be returned in the response message. The following table lists
possible exception codes:
Modbus Exception Codes
Code
Exception
Description
01
Illegal Function
The function code received in the
query is not allowed or invalid.
02
Illegal Data
Address
The data address received in the
query is not an allowable address
for the slave or is invalid.
03
Illegal Data
Value
A value contained in the query
data field is not an allowable value
for the slave or is invalid.
04
Slave Device
Failure
An unrecoverable error occurred
while the slave was attempting to
perform the requested action.
05
Acknowledge
The slave has accepted the
request and is processing it, but a
long duration of time is required to
do so. This response is returned
to prevent a timeout error from
occurring in the master.
06
Slave Device
Busy
The slave is engaged in
processing a long-duration
program command. The master
should retransmit the message
later when the slave is free.
Modbus Exception Codes…continued
Code
Exception
Description
07
Negative
Acknowledge
The slave cannot perform the
program function received in the
query. This code is returned for
an unsuccessful programming
request using function code 13 or
14 (code not supported by this
model). The master should
request diagnostic information
from the slave.
08
Memory Parity
Error
The slave attempted to read
extended memory, but detected a
parity error in memory. The
master can retry the request, but
service may be required at the
slave device.
In a normal response, the slave echoes the function code of
the original query in the function field of the response. All
function codes have their most-significant bit (msb) set to 0 (their
values are below 80H). In an exception response, the slave sets
the msb of the function code to 1 in the returned response (i.e.
exactly 80H higher than normal) and returns the exception code
in the data field. This is used by the master’s application to
recognize an exception response and examine the data field for
the exception code.
MODULE SOFTWARE CONFIGURATION
From the factory, each module has a default configuration as
detailed in the INSTALLATION section of this manual. Your
application will likely differ from the default configuration and the
module will need to be reconfigured. Series 900MB modules
may be configured by issuing the appropriate Modbus functions
to the Register Map registers, as required to configure the unit.
However, it is much simpler to use the 900MB Configuration
Software to program and control the module parameters and
operating modes. This software is easy to use, self-explanatory,
and complete configuration takes only a few minutes. On-line
help is built-in. As such, a comprehensive guide to the use of this
program is not necessary. To begin configuration, you should
already be familiar with Windows operation and have a basic
understanding of module terminology as it relates to your model.
Before You Begin
1. Have you installed the 900MB Configuration Program? You
should complete the MODULE INSTALLATION (Section 2.0)
of this manual before proceeding.
2. Check that all necessary electrical connections have been
made and that power is applied (module’s green LED ON).
3. Have you set the correct baud rate at the RS485 converter
(or repeater if used)?
4. Have you tried communicating using the Default Mode?
Press the “DFT” push-button of the module until the yellow
status LED is flashing. This sets the module’s
communication parameters to 9600 baud, a slave address
of 247, no parity, and one or two stop bits.
5. If you fail to communicate with the module or have a high
degree of communication errors, try increasing the response
delay time (See Response Delay Register 40010). Some
network converters or host/software systems cannot accept
an immediate response from a slave device without the
additional delay provided via this parameter.