Evaluate "IsMasterCommunicationActive" flag
This instruction returns the value of the "IsMasterCommunicationActive" flag.
Input
Specifies the communication ports depending on the PLC type:
COM port e.g. SYS_COM0_PORT
Ethernet port e.g. SYS_ETHERNET_USER_CONNECTION_1
MCU/SCU e.g. 16#xx01 (xx = slot number) in COM01
The flag "IsMasterCommunicationActive" can be evaluated using one of the following system variables:
sys_bIsComPort0MasterCommunicationActive
sys_bIsComPort1MasterCommunicationActive
sys_bIsComPort2MasterCommunicationActive
For communication ports not supporting the master function, the flag is always TRUE.
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
iPort: INT:=0;
bIsMasterCommunicationActive: BOOL:=FALSE;
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_F,IsMasterCommunicationActive!,,5,1,19,4,,?DPort?C);
B(B_VARIN,,iPort,3,2,5,4,);
B(B_VAROUT,,bIsMasterCommunicationActive,19,2,21,4,);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
bIsMasterCommunicationActive:=IsMasterCommunicationActive(Port := iPort);