Get status data in RUN mode
Status data is read from the specified COM port of a Multi-Communication Unit.
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;
McuStatus: MCU_STATUS_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 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
(*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;