FUNCTION_BLOCK RDIAG
Read Diagnosis data from DP Slave.
This service is for Profibus only, Profinet uses a different, more advanced Diagnosis.
Code-Example: Profibus DP Diagnosis
PROGRAM PLC_PRG VAR readDiag : CommfB.RDIAG; diag : CommFB.DP_DIAG; sMessage : STRING; END_VAR readDiag.REQ := TRUE; readDiag.ID := CommFB.ID(EN := TRUE, Master := CIFX_PB.MasterID, SEGMENT := 0, STATION := 3, SLOT := 0); readDiag.MLEN := TO_INT(SIZEOF(diag)); readDiag(DINFO := diag); IF(readDiag.VALID) THEN IF(diag.status1.Diag.Station_Non_Existent) THEN sMessage := 'Station with Address = 3 is not available !'; END_IF END_IF
InOut: |
|