FP_LOGTRACE_SAMPLE

Perform data recording triggered by instruction

This FP instruction creates a record with the data recording function (“Logging”/“Trace”) for the number specified by n_Number.

Parameters

Input

n_Number (WORD, INT, UINT)

Data recording number 0–15

e.g. SYS_LOG0SYS_LOG15

Remarks

Make sure to set “Instruction (FP_LOGTRACE_SAMPLE)” for “Sampling trigger” in the “Data recording” window to use the data recording function with instruction otherwise an error message is output.

Error flags

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

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the area specified using the index modifier 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
		bDataRecordingLog0Start: BOOL:=FALSE;
		bDataRecordingLog0TakeSample: BOOL:=FALSE;
		bDataRecordingLog0Stop: BOOL:=FALSE;
		iDataRecordingValue1: INT:=0;
		iDataRecordingValue2: INT:=0;
		iDataRecordingValue3: INT:=0;
		iDataRecordingValue4: INT:=0;
		iDataRecordingValue5: INT:=0;
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 4 ;
        NETWORK_BODY
B(B_CONTACT,,bDataRecordingLog0Start,7,1,9,3,R);
B(B_F,FP_LOGTRACE_START!,,20,0,32,4,,?DEN?Dn_Number?AENO);
B(B_VARIN,,SYS_LOG0,18,2,20,4,);
L(1,2,7,2);
L(9,2,20,2);
L(1,0,1,4);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 4 ;
        NETWORK_BODY
B(B_F,FP_LOGTRACE_STOP!,,20,0,31,4,,?DEN?Dn_Number?AENO);
B(B_VARIN,,SYS_LOG0,18,2,20,4,);
B(B_CONTACT,,bDataRecordingLog0Stop,7,1,9,3,R);
L(1,2,7,2);
L(9,2,20,2);
L(1,0,1,4);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 4 ;
        NETWORK_BODY
B(B_F,FP_LOGTRACE_SAMPLE!,,20,0,32,4,,?DEN?Dn_Number?AENO);
B(B_VARIN,,SYS_LOG0,18,2,20,4,);
B(B_CONTACT,,bDataRecordingLog0TakeSample,7,1,9,3,);
L(1,2,7,2);
L(9,2,20,2);
L(1,0,1,4);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF DF(bDataRecordingLog0Start) THEN
    FP_LOGTRACE_START(SYS_LOG0);
END_IF;
IF DF(bDataRecordingLog0Stop) THEN
    FP_LOGTRACE_STOP(SYS_LOG0);
END_IF;
IF (bDataRecordingLog0TakeSample) THEN
    FP_LOGTRACE_SAMPLE(SYS_LOG0);
END_IF;

Modified on: 2019-12-14Feedback on this pagePanasonic hotline