Festo CPX-CEC Series Manual page 51

Modular valve terminal with integrated controller codesys
Table of Contents

Advertisement

In the Extendedinfo array, one diagnostic byte is available for each connected CANopen slave. The
CANopen node ID of the slaves is used as an index in the array. The evaluation of bit 2 (slave has
diagnosis) must be edge sensitive because it is toggled internally in the system.
Example:
Diagnosis for the slave with CANopen node ID 4.
VAR
CanDriverName:STRING:='CAN Driver';
CanDiag AT%MB196: GETBUSSTATE;
CanDiagNode : DiagGetState;
END_VAR
IF (CanDiag.EXTENDEDINFO[4] AND 16#04) = 16#04 THEN
CanDiagNode.ENABLE := TRUE;
CanDiagNode.DEVICENUMBER := pCANopenMaster[0].wDrvNr;
CanDiagNode.DRIVERNAME := ADR(CanDriverName);
CanDiagNode.BUSMEMBERID := 4;
CanDiagNode();
END_IF
Fieldbus master diagnosis via function block
Alternatively, the diagnostic information of the fieldbus master can be read out via the module call
DiagGetBusState().
Input parameter
ENABLE
DRIVERNAME
DEVICENUMBER
Return parameter
READY
STATE
EXTENDEDINFO
Modular valve terminal with integrated controller CPX-CEC-...
Values
Meaning
FALSE
Diagnostic function is not executed
TRUE
Diagnostic function is executed
"CAN DRIVER"
Driver name
0
CAN master index
Values
Meaning
0
Diagnostic function has not yet been executed
1
Diagnostic function has been executed
1
BUS OK
2
BUS faulty
3
No BUS communication
4
BUS stopped
Bit0:=1
Slave configured
Bit1:=1
Slave actually available
Bit2:=1
Slave has diagnostic info
49

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cpx-cecCpx-cec-c1Cpx-cec-m1

Table of Contents