4. Configuration
115
MODBUS Client Diagnostics
The diagnostics of the configured MODBUS request are stored in variables of type
T_DIAG_MODBUS_ETH_CLIENT_1 which are described in Table 4-67.
Diagnostic Variable
T_DIAG_MODBUS_ETH_MAPPING_1.*
Size
Description
Communication Status Bits:
byStatus.*
bCommIdle
BOOL
Communication idle (waiting to be executed)
bCommExecuting
BOOL
Active communication
bCommPostponed
BOOL
Communication deferred, because the maximum
number of concurrent requests was reached.
Deferred communications will be carried out in
the same sequence in which they were ordered
to avoid indeterminacy. The time spent in this
State is not counted for the purposes of time-out.
The bCommIdle and bCommExecuting bits are
false when the bCommPostponed bit is true.
bCommDisabled
BOOL
Communication disabled. The bCommIdle bit is
restarted in this condition
bCommOk
BOOL
Communication terminated previously was held
successfully
bCommError
BOOL
Communication terminated previously had an
error. Check error code.
bDiag_6_reserved
BOOL
Reserved
bDiag_7_reserved
BOOL
Reserved
Last error code (enabled when bCommError = true):
eLastErrorCode
MASTER_ERROR_CODE
(BYTE)
ERR_EXCEPTION (1): response reported in a
code (see eLastExceptionCode = exception
code).
ERR_CRC (2): response with invalid CRC.
ERR_ADDRESS (3): MODBUS address not
found. The address that answered the request
was different than expected.
ERR_FUNCTION (4): invalid function code. The
function received in response was different from
that expected by request.
ERR_FRAME_DATA_COUNT (5): the amount of
response data was different than expected.
ERR_INVALID_PROTOCOL_ID (6): unidentified
Protocol. The response protocol is different than
expected.
ERR_NOT_ECHO (7): response is not echo of
the question (FC 5 and 6).
ERR_REFERENCE_NUMBER (8): invalid
reference number (FC 15 and 16).
ERR_INVALID_FRAME_SIZE (9): reply smaller
than expected.
ERR_CONNECTION (20): Error during
connection phase.
ERR_SEND (21): Error during transmission
phase.
ERR_RECEIVE (22): Error during reception
phase.
ERR_CONNECTION_TIMEOUT (40): time-out
at the application level during the connection
phase.
ERR_SEND_TIMEOUT (41): time-out at the
application level during transmission.
ERR_RECEIVE_TIMEOUT (42): time-out at the
application level while waiting for response.
NO_ERROR (128): without errors since startup.
Last exception code received by master:
eLastExceptionCode
MODBUS_EXCEPTION
(BYTE)
NO_EXCEPTION (0)
FUNCTION_NOT_SUPPORTED (1)
MAPPING_NOT_FOUND (2)