
07/04 AWB2700-1428GB
Function block DiagGetState
53
Diagnostics for the CANopen bus
All the participant bytes must be interrogated for diagnosis.
The participant bytes can be interrogated for error messages
(content>0), starting with Byte 2 (participant with node number 2
(= address)) and continuing to Byte 127.
Information about the participant with node number 2 (= address)
will be available in Byte 2. Node number 1 is assigned to the XC-
NET-CAN module by the configuration.
Byte 129 can not be used for diagnosis, since it does not contain
a general message, as is the case with PROFIBUS-DP.
Function block DiagGetState
The structure GETBUSSTATE (EXTENDEDINFO) provides
information on all the participant in the segment. It is used in
conjunction with the function block DiagGetState (
a
Example
programs). The DiagGetState function block must be called for
each participant/node (BUSMEMBERID). Special diagnostic data
can be interrogated at the output array EXTENDEDINFO.
Function
After the parameters have been applied to the function block
inputs DRIVERNAME, DEVICENUMBER and BUSMEMBERID, a “1”
must be applied to the ENABLE input.
If the function block output READY has a “1” and the STATE
output has a “2” (comparison with the defined constants
NDSTATE_DIAGINFO_AVAILABLE = 2), then the output array
EXTENDEDINFO can be interrogated.
Description
h
The EXTENDEDINFO output of the DiagGetState function
block is independent of the EXTENDEDINFO ouput of the
GETBUSSTATE structure.
FUNCTION_BLOCK DiagGetState
VAR_INPUT
ENABLE:
BOOL;
DRIVERNAME:
POINTER TO STRING;
DEVICENUMBER:
INT;
BUSMEMBERID:
DWORD ;
END_VAR
VAR_OUTPUT
READY:
BOOL;
STATE:
INT;
EXTENDEDINFO:
ARRAY[0..99] OF BYTE ;
END_VAR
Inputs
ENABLE
1 = activate
0 = deactivate
DRIVERNAME
The following names are used for the individual
drivers:
Local XI/ON:
XcXion
PROFIBUS-DP:
XcNetIo
CANopen:
XcNetIo
DEVICENUMBER
(0, 1, 2) number that is assigned to the
PROFIBUS-DP or CANopen module address. As
a rule, “0” must be entered for local XI/ON.
(“0” must also be entered for an additional
PROFIBUS-DP/CANopen module with the
address CE000. The local XI/ON and PROFIBUS-
DP/CANopen have different driver names)
Number
Hardware address of the
module
0
CE000
1
CC000
2
D4000
BUSMEMBERID
(Node-) number/address of the participant.
As a rule, a “0” must be entered for local XI/ON.
In a PROFIBUS-DP segment, the first slave
normally receives address 2.
When using CANopen, the addressing (Node
ID) of the participants can start at 1. In the
attached example, the XC-NET-CAN module
receives Node ID 1. Please note with CANopen
the lowest addresses have the highest priority.
Outputs
READY
0 = POU (function block) inactive
1 = block active
STATE
The constants are predefined for the values –1,
0, 1, 2, 3:
–1: NDSTATE_INVALID_INPUTPARAM
0: NDSTATE_NOTENABLED
1: NDSTATE_GETDIAG_INFO
2: NDSTATE_DIAGINFO_AVAILABLE
3: NDSTATE_DIAGINFO_ NOTAVAILABLE
EXTENDEDINFO
Additional diagnostics data is present in the
100 bytes.
Summary of Contents for XControl XC600
Page 4: ...II...
Page 8: ...07 04 AWB2700 1428GB 4...
Page 30: ...07 04 AWB2700 1428GB 26...
Page 40: ...07 04 AWB2700 1428GB 36...
Page 74: ...07 04 AWB2700 1428GB 70...
Page 78: ...07 04 AWB2700 1428GB 74...