07/04 AWB2700-1428GB
Function block DiagGetState
57
Programs
Defining global variables
Main program with accessing of local XI/ON modules
Main program:
Diagnostics program:
VAR_GLOBAL
LXIONSTAT
AT %MB0: GETBUSSTATE;
(*Local XION*)
DPSTAT
AT%MB142: GETBUSSTATE;
(*PROFIBUS-DP*)
CANSTAT
AT%MB284: GETBUSSTATE;
(*CANopen*)
LXIONDRVNAME:STRING:=’XcXion’
(*Local XION*)
DPDRVNAME:STRING:=’XcNetIO’
(*PROFIBUS-DP*)
CANDRVNAME:STRING:=’XcNetIO’
(*CANopen*)
END_VAR
PROGRAM PLC_PRG
VAR
EING_0 AT %IX0.0: BOOL;
EING_1 AT %IX1.0: BOOL;
AUSG_0 AT %QX0.0: BOOL;
AUSG_2 AT %QX2.0: BOOL;
AUSG_3 AT %QX3.0: BOOL;
END_VAR
LD
EING_0
AND EING_1
ST
AUSG_0
ST
AUSG_2
ST
AUSG_3
CAL Diag (*Program for diagnosis of local XION modules*)
CAL DPIO1 (*Program for PROFIBUS DP*)
CAL CANIO2 (*Program for CANopen*)
PROGRAM DIAG (*Diagnosis for local XION bus*)
VAR
XionDiag:DiagGetState;
(* Instance creation of POU DiagGetState() *)
FeldDiag: ARRAY[0..99] OF BYTE;
(* Additional field for diagnosis data (optional) *)
wHelp:WORD;
END_VAR
LXIONSTAT.DRIVERNAME:=ADR(LXIONDrvName);
LXIONSTAT.DEVICENUMBER:=0;
IF (LXionStat.EXTENDEDINFO[0] >=4 )THEN
IF XionDiag.ENABLE = FALSE THEN
(* Function block (FB) DiagGetState is deactivated?*)
XionDiag.DRIVERNAME:=ADR(LXIONDrvName);
(* Input parameter of the FB*)
XionDiag.DEVICENUMBER:=0;
XionDiag.BUSMEMBERID:=0;
XionDiag.ENABLE:=TRUE;
XionDiag();
(* Call the FB DiagGetState*)
END_IF
END_IF
IF XionDiag.ENABLE = TRUE THEN
(* Cyclical call if the FB is active*)
IF XionDiag.READY THEN
(* FB ended? / Are diagnosis data available?*)
IF XionDiag.STATE=NDSTATE_DIAGINFO_AVAILABLE THEN
(*Diagdataabfrage_LX:=1*)
(*Set aux. marker:
If Diagdataabfrage=0->1, then the diagnosis data
are valid and can be accessed/interrogated. The marker must
be reset
in the application program.*)
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...