xueli521
生而無畏學至終章
級別: 探索解密
|
威綸通宏指令,使用while后,無法停止。 macro_command main() bool a,b,c = 1 ,d = 0 int e GetData(a,"HMI",LB,2,1) GetData(b,"HMI",LB,3,1) while (a == true and b == false) SetData(c,"HMI",LB,0,1) SetData(d,"HMI",LB,1,1) DELAY(1000) SetData(d,"HMI",LB,0,1) SetData(C,"HMI",LB,1,1) DELAY(1000) if b == true then break end if wend end macro_command |
---|---|
|
fjqz00
級別: 論壇先鋒
|
在 DELAY(1000)與 if b==true then之間,再加一句 GetData(b,"HMI",LB,3,1) 應該就可以了。 要不然你的b一直不會刷新,那么while就出不來了 |
---|---|
|
海你好咸
級別: 略有小成
|
如樓上所說,在while語句中間加“GetData(a,"HMI",LB,2,1),GetData(b,"HMI",LB,3,1)”讓“a,b”保持刷新即可 while (a == true and b == false) ~~~ GetData(a,"HMI",LB,2,1) GetData(b,"HMI",LB,3,1) ~~~ wend |
---|---|
|