macro_command main()
//定義變量
bool status,OFF=false,ON=true
short page
//讀取lb 9060的狀態(tài)值
GetData(status, "Local HMI", LB, 9060, 1)
//判斷
如果狀態(tài)為 TRUE 將LB1 置1
if status==true then
SetData(ON, "Local HMI", LB, 1, 1)
else
//判斷 如果狀態(tài)為 FALSE 跳轉(zhuǎn)畫(huà)面到 31 同時(shí)將31數(shù)值傳輸?shù)?PLC D0中
if status==false then
page=31
SetData(page, "DELTA DVP", D, 0, 1)
end if
end if
SetData(OFF, "Local HMI", LB, 0, 1)
end macro_command