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

dingzyi
級別: 家園常客
精華主題: 0
發(fā)帖數(shù)量: 688 個
工控威望: 840 點
下載積分: 9290 分
在線時間: 461(小時)
注冊時間: 2011-05-29
最后登錄: 2024-11-23
查看dingzyi的 主題 / 回貼
樓主  發(fā)表于: 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
//獲取當(dāng)前配方序號
GetData(count, "Local HMI", RW, 900, 1)
//設(shè)置載入當(dāng)前配方序號
SetData(count, "Local HMI", RW, 900, 1)
//獲取實際數(shù)據(jù)基地址
getaddress= baseaddress+100*count
//獲取實際數(shù)據(jù)點數(shù)及配方名稱
GetData(Realcount, "Local HMI", RW, getaddress-9, 1)
GetData(RealName[0], "Local HMI", RW,getaddress-8, 8)
//設(shè)置實際數(shù)據(jù)點數(shù)及配方名稱
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中實際配方數(shù)據(jù),配方號,配方點數(shù),配方名稱
//GetData(number, "DELTA DVP", D, 200, 1)
//GetData(Realcount, "DELTA DVP", D, 214, 1)
//GetData(RealName[0], "DELTA DVP", D, 216, 8)
//保存至HMI中臨時配方號,配方點數(shù),配方名稱
//SetData(number, "Local HMI", RW, 900, 1)
//SetData(Realcount, "Local HMI", RW, 901, 1)
//SetData(RealName[0], "Local HMI", RW, 902, 8)
//保存至XYZ數(shù)據(jù)至臨時區(qū)域中
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)

//保存臨時數(shù)據(jù)至配方區(qū)域中
//***
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

主站蜘蛛池模板: 日本色频| 日韩精品免费一级视频| 色男人网| 国产日韩精品一区二区在线观看| 亚洲精品久久7777777| 日本道高清| 91手机看片国产永久免费| 日韩一卡2卡3卡新区网站| 成人一区二区免费中文字幕| 日本免费观看95视频网站 | 99精品影院| 天天乐影院| 九九九九九九伊人| 免费一级毛片在线播放| a性片| 91理论片午午伦夜理片久久| 深夜福利入口| 波多野结衣52部合集在线观看 | 99国产自偷色久| 雪恋电影完整版免费观看| 亚洲精品国产成人| 草逼网站视频| 日本成人黄色网址| 熟睡迷j系列小说| 国产精品久久久久久搜索| 色亚洲视频| 色天天久久| 欧美午夜寂寞影院安卓列表| 国产成人亚洲精品91专区手机 | aⅴ视频在线免播放观看| 好姑娘完整版在线观看中文| 欧洲vodafonewi精品| 精品无人区乱码1区2区3区在线| 九二淫黄大片看片| 十大网站免费货源| 男人懂得网站| 男男按摩1069gⅴ| 91久操| 九九热国产视频| 1024亚洲精品国产| 亚洲国产精品热久久|