我在监控S7-318的plc是看到一段程序我傻眼了!那位高手教教我啊!解释一下!这段程序是在FC块中的如下:
O(
A #TEMP59.TEMP76.TEMP91
AN #TEMP59.TEMP121.TEMP138
)
O(
A #TEMP59.TEMP76.TEMP92
AN #TEMP59.TEMP121.TEMP137
)
A #TEMP59.TEMP76.TEMP87
A IN15
S #TEMP59.TEMP76.TEMP95
离线打开的程序为:
// Fehler Bewegungs黚erwachung "Richtung"
BU_R: O(
A #Variablen.Statuswort.Achse_faehrt_MIN
AN #Variablen.COUNT_OUT.STS_C_DN
)
O(
A #Variablen.Statuswort.Achse_faehrt_MAX
AN #Variablen.COUNT_OUT.STS_C_UP
)
A #Variablen.Statuswort.Motor_laeuft
A #Bewegungsueberwachung
S #Variablen.Statuswort.Err_Richtung
当然你也可以建立如下的程序,起到的效果是一样的
VAR_TEMP
temp59 : STRUCT
temp76 : STRUCT
temp87 : BOOL ;
temp92 : BOOL ;
temp95 : BOOL ;
END_STRUCT ;
temp121 : STRUCT
temp137 : BOOL ;
temp138 : BOOL ;
END_STRUCT ;
END_STRUCT ;
END_VAR
BEGIN
NETWORK
TITLE =
A #temp59.temp76.temp87;
A #temp59.temp76.temp92;
= #temp59.temp121.temp137;