y4620148
級別: 探索解密
|
就不知道程序改怎么寫了,問問大佬們。 I0.0輸入的時候,LB0指示燈亮 I0.1有信號,I0.2沒信號,等待3S采集Q0.3,Q0.3有信號,LB1亮. 這個程序需要怎么寫,這個延遲函數感覺放不進去啊 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 |
---|---|
|