宏指令目的是到达设定日期以后,跳出对话窗口。
提示错误如下:
C7:if语句没有配对的then
C1:出现此项错误时,一般是多了或者少了一个符号。
程序如下:
macro_command main()
int date1[3]
int date2[3]
int win
int password1[4]
int password2[4]
bool lb90_true=true,lb90_off=false
GetData(password1[0], "local HMI", rw, 70, 4)
GetData(password2[0], "local HMI", rw, 50, 4)
GetData(date1[0], "local HMI", rw, 90, 3)
GetData(date2[0], "local HMI", lw, 9020, 3)
if password1[0]==password2[0] and password1[1]==password2[1] and password1[2]==password2[2] and password1[3]==password2[3] then
SetData(lb90_true, "local HMI", LB, 90, 1)
else if date2[2]>date1[2] then
win=27
SetData (lb90_off, "local HMI", LB, 90, 1)
SetData(win, "MITSUBISHI FX3u/FX3G", D, 10, 1)
else if date2[2]=date1[2] and date2[1]>date1[1] then
win=27
SetData (lb90_off, "local HMI", LB, 90, 1)
SetData(win, "MITSUBISHI FX3u/FX3G", D, 10, 1)
else if date2[2]=date1[2] and date2[1]=date1[1] and date2[0]>=date1[0] then
win=27
SetData (lb90_off, "local HMI", LB, 90, 1)
SetData(win, "MITSUBISHI FX3u/FX3G", D, 10, 1)
end if
end macro_command |