IsF145F146Error

Evaluate "F145/F146 error" flag

This instruction returns the value of the "F145/F146 error" flag. It is TRUE if the execution of an F145 or F146 instruction has terminated with an error.

Parameters

Input

Port (WORD, INT, UINT)

Communication port: 1,2

Remarks

Evaluation of the "F145/F146 error" flag

Evaluate the "F145/F146 error" flag to check whether transmission has completed normally or with an error. The flag can be evaluated using one of the following instructions or system variables:

  • IsF145F146Error

  • sys_bIsComPort1F145F146Error

  • sys_bIsComPort2F145F146Error

For communication ports not supporting the master function, the flag is always FALSE.

Evaluation of the F145/F146 error code

These system variables contain the error code if transmission has terminated with an error.

  • sys_wComPort1F145F146ErrorCode

  • sys_bIsComPort2F145F146ErrorCode

For detailed information, please refer to error codes. If the error code is 16#73, a communication timeout error has occurred. The timeout length can be set from 10.0ms–81.9s (in units of 10ms) using system register 32. The default value is 10s.

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
		iPort: INT:=0;
		bF145F146: BOOL:=FALSE;
	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 := 5 ;
        NETWORK_BODY
B(B_F,IsF145F146Error!,,5,1,14,4,,?DPort?C);
B(B_VARIN,,iPort,3,2,5,4,);
B(B_VAROUT,,bF145F146,14,2,16,4,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

bF145F146Error:=IsF145F146Error(Port := iPort);

Modified on: 2022-03-02Feedback on this pagePanasonic hotline