Diagnostics Command
(Original Document)
At a Glance
Diagnostic commands are sent by the SEND_REQ function block. In this case the SEND_REQ function is used to:
Syntax
The syntax of the communication function is the following:
SEND_REQ (ADDR('0.m.1.SYS', 16#0031, %MWi:3, %Mwk:4, %MWj:L)
The following table describes the different function parameters.
Parameter
Description
ADDR('0.m.1.SYS')
Address of the exchange destination entity.
  • m: processor slot in the rack (0 or 1)
  • 1: channel (always 1)
  • SYS: UNI-TE server of the PCMCIA card
16#0031
Request code
%MWi:3
Parameters of the request:
  • %MWi: diagnostic object type:
    • 1 ... 127: Diagnostics of slaves 1 to 127
    • 128: CANopen card version
    • 129: Status of the CANopen card, the response is equivalent to the contents of the %IW0.m.1.i status words.
    • 130: History of messaging errors
  • %MWi+1: Starting address in the diagnostics table (Value by default 0). To enable partial access to the diagnostics table, specify a starting word in the table (Start offset)
  • %MWi+2: Length in bytes of the diagnostics to be read, this length is generally two times the length of the responses table
%MWk:4
Exchange management parameters: four words identifying the address of the data used to control the SEND_REQ function.
%MWj:L
Reception table contains diagnostics data.
Management Parameters
The following table gives details of the %MWk:4 words.
Word number
Most significant byte
Least significant byte
Data managed by
%MWk
Exchange number
Activity bit
The system
%MWk+1
Operation report:
  • positive response: 16#61
  • incorrect response: 16#FD
Communication report
%MWk+2
Timeout
You
%MWk+3
Length: number of response bytes (initialization compulsory in order to activate the function if the number of bytes sent is 6)