FUNCTION_BLOCK UpdateDiagnosisEntry
This function block is used by a Profinet-Device application to add and remove Profinet diagnosis-data.
The device application adds or removes diagnosis information according to the status of its real periphery.
The real periphery is specified through the diagnosis source (API, Slot, Subslot, Channel, Direction, Accumulative).
A diagnosis information (ChannelErrorType, optionally ExtChannelErrorType) exist only once per diagnosis source.
If severity or ExtChannelErrorAddValue changes, the diagnosis information is updated regarding these values.
If the diagnosis of a particular submodule changes during operation (submodule is in data-exchange), a diagnosis alarm is issued to the IO controller owning this submodule.
Update Diagnosis
PROGRAM PLC_PRG VAR ID : UDINT; exec : BOOL; appears : BOOL; updateDiag : ProfinetCommon.UpdateDiagnosisEntry; END_VAR ID := CommFB.SUBSLOT_ID(EN := TRUE, ID := PN_Device.DeviceID, SLOT := 2, SUBSLOT := 1); updateDiag.ID := ID; updateDiag.xAppears := appears; updateDiag.ChannelNumber := 1; updateDiag.ChannelProperties.ChannelType := ProfinetCommon.ChannelProperties_Type.BitSize1; updateDiag.ChannelProperties.Direction := ProfinetCommon.DiagnosisDirection.In; updateDiag.Diagnosis.Severity := ProfinetCommon.DiagnosisSeverity.Fault; updateDiag.Diagnosis.ChannelErrorType := ProfinetCommon.ChannelErrorType.Line_break; //0x0006 Line break updateDiag(xExecute := exec); IF(updateDiag.xDone OR updateDiag.xError) THEN exec := FALSE; END_IF
InOut: |
|