就不知道程序改怎么寫了,問(wèn)問(wèn)大佬們。
I0.0輸入的時(shí)候,LB0指示燈亮
I0.1有信號(hào),I0.2沒(méi)信號(hào),等待3S采集Q0.3,Q0.3有信號(hào),LB1亮.
這個(gè)程序需要怎么寫,這個(gè)延遲函數(shù)感覺(jué)放不進(jìn)去啊
macro_command main()
bool i00,i01,i02,q03
GetData(i00, "Siemens S7-200 PPI", I, 0.0, 1)
GetData(i01, "Siemens S7-200 PPI", I, 0.1, 1)
GetData(i02, "Siemens S7-200 PPI", I, 0.2, 1)
GetData(q03, "Siemens S7-200 PPI", Q, 0.3, 1)
if i00==1 then
SetData(i00, "Local HMI", LB, 0, 1)
else if i00==0 then
SetData(i00, "Local HMI", LB, 0, 1)
end if
if i01==1 and i02==0 and DELAY(3000) q03==1 then
SetData(i01, "Local HMI", LB, 1, 1)
else if i01==0 then
SetData(i01, "Local HMI", LB, 1, 1)
end if