451621206
級(jí)別: 探索解密
精華主題: 0
發(fā)帖數(shù)量: 8 個(gè)
工控威望: 129 點(diǎn)
下載積分: 966 分
在線時(shí)間: 18(小時(shí))
注冊(cè)時(shí)間: 2014-03-04
最后登錄: 2023-04-10
查看451621206的 主題 / 回貼
樓主  發(fā)表于: 2015-06-15 22:11

macro_command main()
//顯示元件條件
bool a=true
bool b=false
//定義比較條件
short n1,n2
short m1,m2
//定義比較時(shí)間段
//時(shí)
short s0,s1,s2
//分
short f0,f1,f2
GetData(f1, "Local HMI", LW, 80, 1)

//時(shí)間自加
f2=f0+f1
//系統(tǒng)時(shí)間傳輸
GetData(n1, "Local HMI", LW, 9012, 1)
GetData(n2, "Local HMI", LW, 9011, 1)

//自加系數(shù)
short j1,j2
if n1==s0 and n2>=f0 and n2<= f2 then
SetData(a, "Local HMI", LB, 55, 1)
j1=j1+1
else
SetData(b, "Local HMI", LB, 55, 1)
end if
//比較傳輸
if  j1==0  then
GetData(s0, "Local HMI", LW, 50, 1)
GetData(f0, "Local HMI", LW, 60, 1)
else
end if
if  j1==1  then
GetData(s0, "Local HMI", LW, 51, 1)
GetData(f0, "Local HMI", LW, 61, 1)
else
end if
if  j1==2  then
GetData(s0, "Local HMI", LW, 52, 1)
GetData(f0, "Local HMI", LW, 62, 1)
else
end if
if  j1==3  then
GetData(s0, "Local HMI", LW, 53, 1)
GetData(f0, "Local HMI", LW, 63, 1)
else
end if
if  j1==3  then
GetData(s0, "Local HMI", LW, 53, 1)
GetData(f0, "Local HMI", LW, 63, 1)
else
end if
if  j1==4  then
GetData(s0, "Local HMI", LW, 54, 1)
GetData(f0, "Local HMI", LW, 64, 1)
else
end if
if  j1==5  then
GetData(s0, "Local HMI", LW, 55, 1)
GetData(f0, "Local HMI", LW, 65, 1)
else
end if
if  j1==6  then
GetData(s0, "Local HMI", LW, 56, 1)
GetData(f0, "Local HMI", LW, 66, 1)
else
end if
if  j1==7  then
GetData(s0, "Local HMI", LW, 57, 1)
GetData(f0, "Local HMI", LW, 67, 1)
else
end if
if  j1==8  then
GetData(s0, "Local HMI", LW, 58, 1)
GetData(f0, "Local HMI", LW, 68, 1)
else
end if
if  j1==9  then
GetData(s0, "Local HMI", LW, 59, 1)
GetData(f0, "Local HMI", LW, 69, 1)
else
end if
if  j1>9  then
j1==0
else
end if






if n1==s0 and n2>=f0 and n2<= f2 then
SetData(a, "Local HMI", LB, 55, 1)
j1=j1+1
else
SetData(b, "Local HMI", LB, 55, 1)
end if

這個(gè)j1如何在這個(gè)條件接通的情況下只加一次!



選擇周期執(zhí)行!



求大師解答!!謝謝!