Set communication parameters in RUN mode
Communication parameters in the predefined DUT MCU_PARA_DUT are written to the specified port of a Multi-Communication Unit.
Input
Communication parameters defined in the predefined DUT
Specification of slot number (high byte) and port number (low byte) of the MCU to which the data is transmitted.
To enable any settings made with the MCU Configurator, set DIP switches 3 and 4 of the MCU to ON for COM port 1. For COM port 2 set switches 7 and 8 to ON.
if the MCU unit does not exist in the specified slot or zero bytes should be sent.
if the MCU unit does not exist in the specified slot or zero bytes should be sent.
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
WriteCommunicationParameter: 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 := 7 ;
NETWORK_BODY
B(B_VARIN,,WriteCommunicationParameter,15,3,17,5,);
B(B_COMMENT,,The communication parameter MCU_PARA are written to port 1 of the MCU in slot 2:,2,1,38,2,);
B(B_VARIN,,16#0201,15,5,17,7,);
B(B_VARIN,,McuPara,15,4,17,6,);
B(B_F,F159_MWRT_PARA!,,17,2,27,7,,?DEN?Ds_Para?Dd_Port?AENO);
L(1,0,1,7);
END_NETWORK_BODY
END_NET_WORK
END_BODY
(*The 10 bytes beginning with Data are sent from port 1 of the MCU in slot 2:*)
if WriteCommunicationParameter then
F159_MWRT_PARA(s_Para := McuPara, d_Port := 16#0201);
end_if;