下面是威綸通觸摸屏的宏指令本人大字體處不明白請大俠們解釋下,謝謝!
macro_command main()
short page
int current_time,setting_time
int year,month,day,hour,minute,second,temp_day,temp_hour,temp_minute,temp
int year1,month1,day1,hour1
short a,b,c,d
bool on=true,off=false,bit
GetData(bit, "Local HMI", RW_Bit, 40, 1)
if bit <1 then
return
end if
GetData(a, "Local HMI", LW, 9022, 1)
GetData(b, "Local HMI", LW, 9021, 1)
GetData(c, "Local HMI", LW, 9020, 1)
GetData(d, "Local HMI", LW, 9019, 1)
year=a
month=b
day=c
hour=d
year=year-1800
year=year*12
month=month+year
month=month*30
day=day+month
day=day*24
hour=hour+day
GetData(a, "Local HMI", RW, 0, 1)
GetData(b, "Local HMI", RW, 1, 1)
GetData(c, "Local HMI", RW, 2, 1)
GetData(d, "Local HMI", RW, 3, 1)
year1=a
month1=b
day1=c
hour1=d
year1=year1-1800
year1=year1*12
month1=month1+year1
month1=month1*30
day1=day1+month1
day1=day1*24
hour1=hour1+day1
if hour>=hour1 then
page=186
// SetData(page, "MODBUS RTU", 4x, 300, 1)
SetData(on, "Local HMI", LB, 100, 1)
else if hour <hour1 then
// SetData(off, "Local HMI", LB, 100, 1)
end if
end macro_command