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.
Input
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
Communication parameters defined in the predefined DUT
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
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
(*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;