fsjnzhy
級別: 工控俠客

精華主題: 0
發(fā)帖數(shù)量: 1129 個
工控威望: 2294 點
下載積分: 109010 分
在線時間: 1309(小時)
注冊時間: 2011-12-15
最后登錄: 2022-09-28
查看fsjnzhy的 主題 / 回貼
樓主  發(fā)表于: 2014-01-14 10:42
下面是威綸通觸摸屏的宏指令本人大字體處不明白請大俠們解釋下,謝謝!

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