FP_SET_ERROR

Set/reset self-diagnostic error

The error no. specified by n is copied into the system variable sys_iSelfDiagnosticErrorCode that reads the corresponding special data register.

Parameters

Input

n (INT)

must be a constant

  • Self-diagnostic error code number, range: 0 and 100 to 299

  • For FP7: range 0! and 1000–2999

Remarks

The contents of the system variable sys_iSelfDiagnosticErrorCode and the error no. can be read and checked using Control FPWIN Pro “Monitor” > “Special flags and registers” > “Basic error messages”.

Error number areas:

  • When n=0, all error numbers greater than 43 are cleared and the error LED turns off.

  • When n=100–199, the operation is halted.

  • When n=200–299, the operation is continued.

For FP7:

  • When n = 0!, no error

  • When n < 1000, operation error occurs

  • When 1000 < n < 1999, PLC stops

  • When 2000 < n < 2999, error occurs but PLC continues

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)

if n exceeds the limit.

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)

if n exceeds the limit.

Example

POU header

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
		bStart: BOOL:=FALSE;
			(*activates the function*)
	END_VAR

POU body

When the variable bStart is set to TRUE, the function is carried out.

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_F,FP_SET_ERROR!,,13,1,22,5,,?DEN?Dn?AENO);
B(B_CONTACT,,bStart,6,2,8,4,);
B(B_VARIN,,100,11,3,13,5,);
L(1,3,6,3);
L(8,3,13,3);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF bStart then
    (* Sets the self-diagnostic error 100 *)
    (* The ERROR/ALARM LED of the PLC is on,
    and operation stops. *)
    FP_SET_ERROR(100);
END_IF;

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