21
4.6.1
Error Handling
Each command will return a status code as the last byte in its response. This status code will
indicate whether the command completed successfully or whether an error occurred while the
EM405-8 was performing the command. Table II shows a list of potential status codes that may
be returned.
Table II. Status Code (SC)
Value
Meaning
0x00
Successful
0x01
Invalid Command
0x02
Invalid Parameter
0x03
Module did not respond*
* Note: Applies to M-Module requests only.
Successful (0x00): The command completed successfully without error.
Invalid Command (0x01): The first byte received was not a valid command-id value from the
list in Table I.
Invalid Parameter (0x02): The EM405-8 received a valid command however the command
could not be completed because one of the command parameters was invalid or out of range.
Refer to the description of each individual command for parameter details.
Module Did Not Respond (0x03): The EM405-8 received a valid command with valid
parameters; however, the specified module did not respond to the access. This error code applies
to M-Module accesses only. The error code could result from the specified M-Module being
absent, the specified address being outside the range of addresses supported by the particular M-
Module, or more serious hardware problems with the M-Module itself.
If any of the above status codes are returned, the EM405-8 will set the
Reset Error
(RERR)
status
bit in the EM405-8
Reset Error and Manufacturer ID
register (refer to section 4.6.5 for details
on this register). The
RERR
bit can be cleared by writing a ‘1’ to that bit location in the
Reset
Error and Manufacturer ID
register. The status is provided only to indicate that an error has
occurred. Normal operation is NOT inhibited.
Driver software should be written such that it checks for error conditions and performs the
appropriate action to reset the RERR bit. In most cases error conditions are generated by
errors in the software source code, therefore, once the software has been debugged and
verified, error codes will rarely, if ever be received.
C&H Technologies, Inc. <> 445 Round Rock West Drive <> Round Rock, Texas 78681 <> www.chtech.com