Merker "IsMasterCommunicationActive" auswerten
Dieser Befehl liefert den Wert des Merkers "IsMasterCommunicationActive".
Eingang
Legt die Kommunikationsschnittstellen fest (je nach SPS-Typ):
COM-Schnittstelle z.B. SYS_COM0_PORT
Ethernet-Schnittstelle z.B. SYS_ETHERNET_USER_CONNECTION_1
MCU/SCU z.B. 16#xx01 (xx = Steckplatznummer) in COM01
Der Merker "IsMasterCommunicationActive" kann mit den folgenden Systemvariablen ausgewertet werden:
sys_bIsComPort0MasterCommunicationActive
sys_bIsComPort1MasterCommunicationActive
sys_bIsComPort2MasterCommunicationActive
Der Merker ist immer TRUE für die Kommunikationsschnittstellen, die die Master-Funktion nicht unterstützen
Im POE-Kopf werden alle Ein- und Ausgangsvariablen deklariert, die für die Programmierung dieser Funktion verwendet werden. Für alle Programmiersprachen wird der gleiche POE-Kopf verwendet.
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);