FP_CLEAR_UNIT_ERROR

Clear error/warning of units

This FP instruction clears an error or warning in the unit attached to the slot number specified by s1_Slot if the trigger EN is TRUE. The instruction can be used for the following types of units: High-speed counter unit, positioning unit, pulse output unit, motion control unit, serial communication unit.

Parameters

Input

s1_Slot (WORD, INT, UINT)

Slot number

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the area specified using the index modifier exceeds the limit.

  • if the slot number is outside the permissible range

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the area specified using the index modifier exceeds the limit.

  • if the slot number is outside the permissible range

Example

POU headerCopy code to clipboard

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

	VAR
		bClearError: BOOL:=FALSE;
		iSlot: INT:=1;
	END_VAR

POU body

When the variable bClearError is set to TRUE, the instruction is carried out.

LD bodyCopy code to clipboard

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 6 ;
        NETWORK_BODY
B(B_F,FP_CLEAR_UNIT_ERROR!,,10,0,22,4,,?DEN?Ds1_Slot?AENO);
B(B_VARIN,,iSlot,8,2,10,4,);
B(B_CONTACT,,bClearError,4,1,6,3,);
L(1,2,4,2);
L(6,2,10,2);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST bodyCopy code to clipboard

IF bClearError then
    FP_CLEAR_UNIT_ERROR(iSlot);
END_IF;

Modified on: 2022-05-13Feedback on this pagePanasonic hotline