WINCC面板的關(guān)閉/打開(kāi)SV及KV柜Q1主空開(kāi)的控制原理
---------------------------------------------------------
FB100中使用:
R_TRIG_Anfo_Off_Halt (CLK:="DB_ARG".On_Off.Anfo_Off_Halt);
R_TRIG_Cancel (CLK:="DB_ARG".On_Off.Cancel);
R_TRIG_Anfo_Off (CLK:="DB_ARG".On_Off.Anfo_Off);
If (R_TRIG_SK90_ZutrittAnfo.Q Or R_TRIG_K90_ZutrittAnfo.Q)
And Not xHM_K90_ZutrittAnfo And ST_BA.K90_AnfoSG = WORD#0
OR MASTER_DIAG_STAT_REG_PF Or R_TRIG_Anfo_Off_Halt.Q Then
xHM_K90_ZutrittAnfo := True; 請(qǐng)求進(jìn)入
R_TRIG_SK90_ZutrittAnfo.Q:= False;
End_If; 請(qǐng)求進(jìn)入
If (R_TRIG_SK6_TE.Q And xHM_K6_TE) Or (ST_BA.K6_TE And Not ST_BA.K40) Or "DB_ARG".On_Off.Quitt Or R_TRIG_Cancel.Q Then 當(dāng)ON_OFF的送點(diǎn)ON功能激活時(shí)
xHM_K6_TE := False; 結(jié)束K6進(jìn)程停止
End_If; 停止
If (R_TRIG_SK90_ZutrittAnfo.Q Or F_TRIG_K90_ZutrittAnfo.Q Or "DB_ARG".On_Off.Quitt Or R_TRIG_Cancel.Q) And xHM_K90_ZutrittAnfo And Not MASTER_DIAG_STAT_REG_PF Then
xHM_K90_ZutrittAnfo := False;
End_If;
If (R_TRIG_SK6_TE.Q Or R_TRIG_Anfo_Off.Q) And Not xHM_K6_TE Then
xHM_K6_TE := True;
R_TRIG_SK6_TE.Q := False;
End_If;
---------------------------------------------------------
FB142系統(tǒng)賦值
xON := SVQxK AND (KVQxK OR Cfg.X1); SV及KV柜Q1空開(kāi)在接通狀態(tài)
xOFF := NOT SVQxK AND (NOT KVQxK OR Cfg.X1); SV及KV柜Q1空開(kāi)在關(guān)閉狀態(tài)
Cfg.X1:控制帶不帶KV柜,不帶為1 帶為0
xS_LS := (bVisutasten = Byte#2); 控制關(guān)閉/打開(kāi)按鈕。
R_Trig_S_LS(CLK := xS_LS); 觸發(fā)激活脈沖。
WINCC面板控制關(guān)閉:
IF FrgAnw AND R_Trig_S_LS.Q THEN 按鈕點(diǎn)了
IF xOFF AND NOT TP_MAZ.Q THEN 空開(kāi)已經(jīng)關(guān)閉了,而且間隔時(shí)間已經(jīng)滿(mǎn)足
IF NOT xOff_aktiv AND NOT xON_aktiv THEN 沒(méi)有處于激活開(kāi)電或關(guān)電
iSKette := 10; 去開(kāi)電步驟
ELSE
iSKette := 0;
END_IF;
ELSIF xON THEN
IF NOT xOff_aktiv AND NOT xON_aktiv THEN
iSKette := 110; 去關(guān)電步驟
END_IF;
ELSE
xF_MAZ := True; 空開(kāi)狀態(tài)不對(duì)故障
END_IF;
END_IF;
TP_MAZ(IN := On_Off.Qx_Off, PT := T#2m) 斷開(kāi)點(diǎn)后的間隔時(shí)間2m
打開(kāi)ON
CASE iSKette OF
10 : (*Start*)
xAnwOff := False;
xAnwOn := True; 選擇打開(kāi)模式
xOn_aktiv := True; 啟動(dòng)被激活
iSKette := 20;
20 : (*Kraftspeicher laden*)
TON_Timer.PT := T#2s; 激活延遲2s
xTimer := True;
SVKx := True; SVK1先保持打開(kāi)
IF TON_Timer.Q THEN 時(shí)間滿(mǎn)足后
xTimer := False;
SVKx := False; SVK1被關(guān)閉
xQx_On := True; ON狀態(tài)被激活
iSKette := 30;
END_IF;
30 : (*Verzoegerung Einschalten*)
IF xOn THEN 檢測(cè)NOVS,KV柜Q1開(kāi)關(guān)啟動(dòng)狀態(tài)
xQx_On := False;
TON_Timer.PT := Tver_On; 延遲啟動(dòng)時(shí)間開(kāi)始
xTimer := True;
IF TON_Timer.Q THEN 時(shí)間到達(dá)
xTimer := False;
iSKette := 40;
END_IF;
END_IF;
40 : (*Quitt Zutrittsanforderung, Halt bei Taktende*)
xQuitt := True; 復(fù)位
xQuitt_5s := True;
TON_Timer.PT := T#5s; 延遲5s
xTimer := True;
iSKette := 50;
50 : (*Quitt 5s Rueckfuehrkreis und Depassivierung*)
xQuitt := False ;
IF TON_Timer.Q THEN 時(shí)間到達(dá)后
xTimer := False;
xQuitt_5s := False;
xQuitt_Usr := True;
xSteuEin := True; 啟動(dòng)點(diǎn)激活
iSKette := 60;
END_IF;
60 : (*Quitt Usermeldungen*)
xQuitt_Usr := False;
xOn_aktiv := False; 返回初始化
iSKette := 0;
END_CASE;
關(guān)閉SVK1繼電器
CASE iSKette OF
110: (*Start*)
xAnwOn := False;
xAnwOff := True; 選擇打開(kāi)模式
xOff_aktiv := True; 關(guān)閉被激活
xF_AnlBerOff := False;
iSKette := 120;
120: (*Verzoegerung Ausschalten*)
TON_Timer.PT := Tver_Off; 延遲時(shí)間激活
xTimer := True;
xErrorOffClear := False;
IF ((TON_Timer.PT - TON_Timer.ET ) < T#10s) THEN ?剩余10S停止關(guān)閉請(qǐng)求 ?
xAnfo_Off_Halt := True; 發(fā)出請(qǐng)求關(guān)閉停止
END_IF;
IF TON_Timer.Q AND On_Off.Anl_Bereit_Off THEN 延時(shí)到達(dá)關(guān)閉準(zhǔn)備滿(mǎn)足
xTimer := False;
xAnfo_Off_1 := True; 前往下一步
iSKette := 140;
ELSIF TON_S_LS_Off.Q THEN
xTimer := False;
xAnfo_Off_1 := True;
iSKette := 135;
ELSIF TON_Timer.Q AND NOT On_Off.Anl_Bereit_Off THEN 時(shí)間到達(dá),結(jié)束
關(guān)閉報(bào)錯(cuò)
xTimer := False;
xAnfo_Off_1 := True;
xF_AnlBerOff := True; 發(fā)出關(guān)閉準(zhǔn)備錯(cuò)誤
iSKette := 130;
END_IF;
///////////////////////////////////////////////////////
TON_S_LS_Off.Q 的解析:
TON_S_LS_Off(IN := (xS_LS OR Sxx_Off) AND xOff_aktiv, PT := T#4s)
xS_LS: xS_LS := (bVisutasten = Byte#2) wincc按鈕一直按住
Sxx_Off:模塊外部輸入管腳,指按鈕。
按鈕信號(hào)一直被按住要超過(guò)4s
///////////////////////////////////////////////////////
On_Off.Anl_Bereit_Off 的解析:
On_Off.Anl_Off := xAnl_Off
On_Off.Anfo_Off := xON AND xAnwOff
FB200 機(jī)器人塊
_ST_ROB.E30_Anfo_Abschalt := ON_OFF.Anl_Off;
IF NOT AnwORob AND ON_OFF.Anfo_Off THEN
IF NOT _ST_ROB.A30_Abschaltung_erlaubt THEN 機(jī)器人沒(méi)有發(fā)出機(jī)器人停止
ON_OFF.Anl_Bereit_Off := False; 選擇OFF準(zhǔn)備將被關(guān)閉
IF ON_OFF.Anfo_Off_1 THEN
xF_AAE := True;
END_IF;
END_IF;
END_IF;
機(jī)器人控制ON_OFF能否被實(shí)施完成
130: (*nicht Bereit Ausschalten 1s Cancel ausgeben*) 結(jié)束關(guān)閉指令
xAnfo_Off_1 := False;
xAnwOn := xON;
xAnwOff := xOFF;
TON_Timer.PT := t#1s;
xTimer := True;
xCancel := True;
IF TON_Timer.Q THEN
xTimer := False;
xCancel := False;
iSKette := 0;
END_IF;
135: (*Ausschalten ohne Bereit 5s Warnung ausgeben*) 等待去第150步
xAnfo_Off_1 := False;
TON_Timer.PT := t#5s;
xTimer := True;
xOff_Visu := True;
IF TON_Timer.Q THEN
xTimer := False;
xOff_Visu := False;
iSKette := 150;
END_IF;
140: (*Anlage Bereit zum Ausschalten 30s Anl_Off ausgeben*)
xAnfo_Off_1 := False;
TON_Timer.PT := t#30s;
xTimer := True;
xAnl_Off := True; 請(qǐng)求OFF發(fā)出
IF TON_Timer.Q THEN
xTimer := False;
xAnl_Off := False;
iSKette := 150;
END_IF;
150: (*Leistungsschalter, Medien, Licht usw. Aus*)發(fā)出控制的VSK1為1
xSteuEin := False;
xQx_Off := True;
SVKx := True; VSK1為1
iSKette := 160;
160: (*Leistungsschalter Aus*)
xQx_Off := False; 返回0步
iSKette := 0;
END_CASE;
On_Off.Cancel
FB100
R_TRIG_Cancel (CLK:="DB_ARG".On_Off.Cancel);
If (R_TRIG_SK90_ZutrittAnfo.Q Or F_TRIG_K90_ZutrittAnfo.Q Or "DB_ARG".On_Off.Quitt Or R_TRIG_Cancel.Q) And xHM_K90_ZutrittAnfo
And Not MASTER_DIAG_STAT_REG_PF Then
xHM_K90_ZutrittAnfo := False;
End_If;
If (R_TRIG_SK6_TE.Q And xHM_K6_TE) Or (ST_BA.K6_TE And Not ST_BA.K40) Or "DB_ARG".On_Off.Quitt Or R_TRIG_Cancel.Q Then
xHM_K6_TE := False;
End_If;
關(guān)閉請(qǐng)求進(jìn)入K90和K6進(jìn)程停止
----------------------------------------------------------------
On_Off.Anfo_Off := xON AND xAnwOff;
On_Off.Anfo_Off_1 := xON AND xAnfo_Off_1;
On_Off.Anfo_Off_Halt := On_Off.Anfo_Off AND xAnfo_Off_Halt;請(qǐng)求停止
/////////////////////////////////////////////////////
FB100
R_TRIG_Anfo_Off_Halt (CLK:="DB_ARG".On_Off.Anfo_Off_Halt);
If (R_TRIG_SK90_ZutrittAnfo.Q Or R_TRIG_K90_ZutrittAnfo.Q)
And Not xHM_K90_ZutrittAnfo And ST_BA.K90_AnfoSG = WORD#0
OR MASTER_DIAG_STAT_REG_PF Or R_TRIG_Anfo_Off_Halt.Q Then
xHM_K90_ZutrittAnfo := True;
R_TRIG_SK90_ZutrittAnfo.Q:= False;
End_If;
請(qǐng)求停止發(fā)出后FB100請(qǐng)求進(jìn)入安全門(mén)發(fā)出
/////////////////////////////////////////////////////
On_Off.Qx_On := xQx_On;
On_Off.Qx_Off := xQx_Off;
On_Off.Quitt := xQuitt;
On_Off.Quitt_5s := xQuitt_5s;
On_Off.Quitt_USR := xQuitt_USR;
On_Off.STEUEIN := xON AND xSteuEin;
On_Off.On_aktiv := xOn_aktiv AND NOT On_Off.STEUEIN;
On_Off.Anl_Bereit_Off := On_Off.Anfo_Off;
On_Off.Anl_Off := xAnl_Off;
FB100中
R_TRIG_Anfo_Off (CLK:="DB_ARG".On_Off.Anfo_Off); 關(guān)閉請(qǐng)求
If (R_TRIG_SK90_ZutrittAnfo.Q Or R_TRIG_K90_ZutrittAnfo.Q)
And Not xHM_K90_ZutrittAnfo And ST_BA.K90_AnfoSG = WORD#0
OR MASTER_DIAG_STAT_REG_PF Or R_TRIG_Anfo_Off_Halt.Q Then
xHM_K90_ZutrittAnfo := True;
R_TRIG_SK90_ZutrittAnfo.Q:= False;
End_If;
請(qǐng)求關(guān)閉,F(xiàn)B100 的K90發(fā)出
On_Off.FS_Frg_Auto := F_Trig_Hupe.Q AND Mit;
On_Off.FS_LSP_Ein := (R_Trig_FS.Q OR R_Trig_LSP.Q) AND Mit;
On_Off.ErrorOffClear := NOT xF_AnlBerOff AND NOT On_Off.Anfo_Off AND NOT On_Off.Anfo_Off_1 OR Cfg.X0;
On_Off.Cancel := xCancel;
xON := SVQxK AND (KVQxK OR Cfg.X1); SV和KV柜的反饋/ 打開(kāi)繼電器
xAnwOff:選擇關(guān)閉繼電器
IF ((TON_Timer.PT - TON_Timer.ET ) < T#10s) THEN ?
xAnfo_Off_Halt := True;
END_IF;
-
WinCC
+關(guān)注
關(guān)注
6文章
204瀏覽量
47983 -
控制原理
+關(guān)注
關(guān)注
0文章
10瀏覽量
7064
原文標(biāo)題:你知道-ON_OFF的使用嗎?
文章出處:【微信號(hào):gh_a8b121171b08,微信公眾號(hào):機(jī)器人及PLC自動(dòng)化應(yīng)用】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論