F161_MRD_STATUS

Get status data in RUN mode

Status data is read from the specified COM port of a Multi-Communication Unit.

Parameters

Input

s_Port (WORD, INT, UINT)

Specification of slot number (high byte) and port number (low byte) of the MCU to which the data is transmitted.

  • 16#xx01: COM1 on MCU in slot 16#xx

  • 16#xx02: COM2 on MCU in slot 16#xx

Output

d1_Status (MCU_STATUS_DUT)

Communication parameters defined in the predefined DUT

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the area specified using the index modifier exceeds the limit.
  • if the MCU unit does not exist in the specified slot or zero bytes should be sent.
  • if the specified communication port does not exist
sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the area specified using the index modifier exceeds the limit.
  • if the MCU unit does not exist in the specified slot or zero bytes should be sent.
  • if the specified communication port does not exist

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
		ReadCommunicationParameter: BOOL:=FALSE;
		McuStatus: MCU_STATUS_DUT;
	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 := 6 ;
        NETWORK_BODY
B(B_VARIN,,ReadCommunicationParameter,15,3,17,5,);
B(B_VARIN,,16#0201,15,4,17,6,);
B(B_COMMENT,,The status parameters MCU_STATUS_DUT of port 1 of the MCU in slot 2 are read:,2,1,34,2,);
B(B_VAROUT,,McuStatus,27,4,29,6,);
B(B_F,F161_MRD_STATUS!,,17,2,27,6,,?DEN?Ds_Port?AENO?Cd1_Status);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

(*The status parameters MCU_STATUS_DUT of port 1 of the MCU in slot 2 are read:*)
if (ReadCommunicationParameter) then
   F161_MRD_STATUS(s_Port := 16#0201, d1_Status => McuStatus);
end_if;

Modified on: 2022-01-18Feedback on this pagePanasonic hotline