F161_MRD_PARA

Get communication parameters in RUN mode

Communication parameters in the predefined DUT MCU_PARA_DUT are received from a port of a Multi-Communication Unit in a certain slot.

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_Para (MCU_PARA_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;
		McuPara: MCU_PARA_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 communication parameter MCU_PARA of port 1 of the MCU in slot 2 are read:,2,1,34,2,);
B(B_VAROUT,,McuPara,27,4,29,6,);
B(B_F,F161_MRD_PARA!,,17,2,26,6,,?DEN?Ds_Port?AENO?Cd1_Para);
L(1,0,1,6);
L(26,5,27,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

(*The communication parameter MCU_PARA of port 1 of the MCU in slot 2 are read:*)
if (ReadCommunicationParameter) then
   F161_MRD_PARA(s_Port := 16#0201, d1_Para => McuPara);
end_if;

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