Diagnostics for the local XI/
ON-BUS and the PROFIBUS-DP /
CANopen bus
07/04 AWB2700-1428GB
60
In the status display, the individual elements of EXTENDEDINFO
are shown after the simulation of an error (short-circuit on the 1st
output module):
Program for the CANopen bus
Subprogram 2:
Diagnostics program: (Observe the highlighted changes!)
:
Figure 71 : Status display of EXTENDEDINFO after a short-circuit on the
1st output module
PROGRAM CANIO2
VAR
Ausg_b1 AT%QB6: BYTE;
Ausg_b2 AT%QB7: BYTE;
Ausg_b11 AT%QB8: BYTE;
Ausg_b12 AT%QB9: BYTE;
END_VAR
LD
255
ST
Ausg_b1
ST
Ausg_b2
ST
Ausg_b11
ST
Ausg_b12
CAL DIAGCAN
(*Diagnostics program for the CANopen segment*)
PROGRAM DIAGCAN
(* Diagnostics for CANopen *)
VAR
Diagstate_CAN:DiagGetState;
(* Instance creation of POU DiagGetState() *)
FeldDiag_can: ARRAY[0..23] OF BYTE;
(* Additional field for diagnosis data (optional) *)
Adresse_CAN: DWORD;
nDword: DWORD;
wHelp_can:UINT;
END_VAR
VAR CONSTANT
Adr_max_CAN: DWORD := 3 ;
(* Entry: highest participant address (1..127) e.g. 3
*)
END_VAR
CANSTAT.DRIVERNAME:=ADR(CANDrvName);
CANSTAT.DEVICENUMBER:=1;
IF Diagstate_CAN.ENABLE = FALSE THEN
Adresse_CAN:=128;
(*Invalid CAN address*)
FOR nDword:=2 TO Adr_max_CAN BY 1 DO
(*Look for participant with diagnosis*)
IF CANSTAT.EXTENDEDINFO[nDword] >=4 THEN
Adresse_CAN:=nDWORD;
EXIT;
END_IF
END_FOR
IF(Adresse_CAN<=Adr_max_CAN) THEN
IF CANSTAT.EXTENDEDINFO[Adresse_CAN] >=4 THEN
IF Diagstate_CAN.ENABLE = FALSE THEN
(* Function block (FB) DiagGetState is deactivated?*)
(* Input parameter of the FB*)
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...