一区二区三区成人-一区二区三区www-一区二区三区 日韩-一区二区日韩欧美-一区二区日韩精品中文字幕-一区二区日韩

dingzyi
級別: 家園常客
精華主題: 0
發帖數量: 688 個
工控威望: 840 點
下載積分: 9290 分
在線時間: 461(小時)
注冊時間: 2011-05-29
最后登錄: 2024-11-23
查看dingzyi的 主題 / 回貼
樓主  發表于: 2015-07-15 21:00
宏指令1

macro_command main()
short count,Realcount,i,baseaddress,getaddress,baseadd2,getadd2,on,baseadd3,getadd3,view,PLCAddr
int tempdata,realdata
unsigned char RealName[8]

//view=34
i=0
count=0
//temp baseaddr
baseaddress=910
// realdata baseaddr
Realcount=0
//PLC Addr
PLCAddr=2000
//SetData(view, "Local HMI", LW, 0, 1)
for i=0 to 7 step 1
RealName=''
next i
//獲取當前配方序號
GetData(count, "Local HMI", RW, 900, 1)
//設置載入當前配方序號
SetData(count, "Local HMI", RW, 900, 1)
//獲取實際數據基地址
getaddress= baseaddress+100*count
//獲取實際數據點數及配方名稱
GetData(Realcount, "Local HMI", RW, getaddress-9, 1)
GetData(RealName[0], "Local HMI", RW,getaddress-8, 8)
//設置實際數據點數及配方名稱
SetData(Realcount, "Local HMI", RW, 901, 1)
SetData(RealName[0], "Local HMI", RW, 902, 8)
DELAY(5)
//load other configure data for  XYZW
for i=0 to 60 step 2
     GetData(realdata, "Local HMI", RW,getaddress+i, 1)
     SetData(realdata, "Local HMI", RW,baseaddress+i, 1)  
next i
DELAY(1000)
//send data to PLC
SetData(Realcount, "DELTA DVP", D, 200, 1)
SetData(count, "DELTA DVP", D, 214, 1)
SetData(RealName[0], "DELTA DVP", D, 216, 8)
for i=0 to 60 step 2
     GetData(realdata, "Local HMI", RW,baseaddress+i, 1)
     SetData(realdata, "DELTA DVP", D, PLCAddr+i, 1)  
next i
DELAY(500)
//send exit cmd
on=1
SetData(on, "DELTA DVP", M, 1001, 1)


//view=0
//SetData(view, "Local HMI", LW, 0, 1)
//on=1
//SetData(on, "Local HMI", RW_Bit, 0, 1)
//SetData(on, "Local HMI", LB, 2, 1)

end macro_command




第二個宏指令
macro_command main()
short count,Realcount,i,number
short baseaddress,getaddress,view
int realdata,PLCAddr
unsigned char RealName[8]
i=0
count=0
baseaddress=910
Realcount=0
PLCAddr=2000
view=20
SetData(view, "Local HMI", LW, 10000, 1)
for i=0 to 7 step 1
RealName=''
next i
//view=35
//SetData(view, "Local HMI", LW, 0, 1)
//獲取PLC中實際配方數據,配方號,配方點數,配方名稱
//GetData(number, "DELTA DVP", D, 200, 1)
//GetData(Realcount, "DELTA DVP", D, 214, 1)
//GetData(RealName[0], "DELTA DVP", D, 216, 8)
//保存至HMI中臨時配方號,配方點數,配方名稱
//SetData(number, "Local HMI", RW, 900, 1)
//SetData(Realcount, "Local HMI", RW, 901, 1)
//SetData(RealName[0], "Local HMI", RW, 902, 8)
//保存至XYZ數據至臨時區域中
for i=0 to 60 step 2
     GetData(realdata, "DELTA DVP", D, PLCAddr+i, 1)
     SetData(realdata, "Local HMI", RW,baseaddress+i, 1)  
next i
DELAY(500)

//保存臨時數據至配方區域中
//***
GetData(number, "Local HMI", RW, 900, 1)
GetData(Realcount, "Local HMI", RW, 901, 1)
GetData(RealName[0], "Local HMI", RW, 902, 8)
SetData(number, "Local HMI", RW, baseaddress-10+100*number, 1)
SetData(Realcount, "Local HMI", RW, baseaddress-10+100*number+1, 1)
SetData(RealName[0], "Local HMI", RW, baseaddress-10+100*number+2, 8)
for i=0 to 60 step 2
     GetData(realdata, "Local HMI", RW, baseaddress+i, 1)
     SetData(realdata, "Local HMI", RW, baseaddress+100*number+i, 1)  
next i
DELAY(500)
view=0
SetData(view, "Local HMI", LW, 10000, 1)

end macro_command
看看這兩個宏指令,大家給點意見
plc
忍緣善
獨自漂泊
級別: 論壇先鋒

精華主題: 0
發帖數量: 892 個
工控威望: 1807 點
下載積分: 20025 分
在線時間: 3995(小時)
注冊時間: 2010-12-17
最后登錄: 2024-11-29
查看忍緣善的 主題 / 回貼
1樓  發表于: 2015-07-15 21:20
學習啦。謝謝!
獨自漂泊

主站蜘蛛池模板: 亚洲国产在线播放| japanesepooping脱粪| 国产精品久久久久影视不卡 | 朝鲜女人性猛交| 亚洲精品一二区| 娇妻被健身教练挺进小说阅读| 黑人巨大和日本娇小中出| 亚洲AV无码国产精品色午夜情| 欧美日韩高清一区| 国内精品久久久久久久久| 日韩资源| 动漫美女羞羞视频| 桃乃木香奈作品在线观看| 久久免费国产视频| 亚洲成年| 2021日本三级理论影院| 亚洲白拍| 97福利社| 无人在线高清免费看| 亚洲国产视频网站| 国产3p绿奴在线视频| 私人影院免费观看| 紧身牛仔裤美女被啪啪久久网| 秀婷程仪公欲息肉婷在线观看 | 亚洲精品九色在线网站| 日韩一级免费毛片| 美日韩一区二区三区| 久久久黄色片| 日韩在线视精品在亚洲| 国产探花视频| 褪色的憎恨| blacked黑人| 亚洲羞羞视频| 男人女人日批| 精品视频二区| 色播开心网| 美女毛片老太婆bbb80岁| 国产精品亚洲精品日韩已满| 2022国产麻豆剧果冻传媒入口| 欧美大片一区二区三区| 香蕉91xj.cc|