前辈们 帮忙解释一下 点击:1798 | 回复:6



zggdiyutc

    
  • 精华:0帖
  • 求助:14帖
  • 帖子:14帖 | 83回
  • 年度积分:0
  • 历史总积分:149
  • 注册:2013年3月14日
发表于:2013-05-09 09:31:10
楼主

前辈们  帮忙解释下 大体是什么意思  只要个大概意思就行  下面这些多是一起的

1.

macro_command main()

short a

bool zero=0

GetData(a, "Local HMI", LW, 9200, 1)

SetData(a, "Local HMI", RW, 1000, 1)



end macro_command


2.

macro_command main()

short a

bool zero=0

GetData(a, "Local HMI", LW, 9200, 1)

a=a+10

SetData(a, "Local HMI", RW, 1000, 1)

   


end macro_command


3.

macro_command main()

short a

bool zero=0

GetData(a, "Local HMI", LW, 9200, 1)

a=a+20

SetData(a, "Local HMI", RW, 1000, 1)


end macro_command


4.

macro_command main()

short m,c[10],i[180],name[5],index,temp,index1=0,count=0

bool zero=0


GetData(index, "Local HMI", RW, 1000, 1)

temp=index+10

count=180-index

GetData(i[0], "Local HMI", RW, index, count)

SetData(i[0], "Local HMI", RW, temp, count)


FILL(c[0], 0, 10)  

SetData(c[0], "Local HMI", RW, index, 10)


for m=0 to 17

 GetData(name[0], "Local HMI", RW, 0+index1, 5)

 SetData(name[0], "Local HMI", LW, 3000+index1, 5)  

 index1=index1+10                    

next


SetData(zero, "Local HMI", LB, 3, 1)    


end macro_command


5.

macro_command main()

short m,c[180],name[5],index,temp,index1=0,count=0

short clear[10]={0,0,0,0,0,0,0,0,0,0}

bool zero=0


GetData(index, "Local HMI", RW, 1000, 1)

temp=index+10

count=180-index


SetData(clear[0], "Local HMI", RW, 180, 10)    

           

GetData(c[0], "Local HMI", RW, temp, count)

SetData(c[0], "Local HMI", RW, index, count)  


for m=0 to 17

 GetData(name[0], "Local HMI", RW, 0+index1, 5)

 SetData(name[0], "Local HMI", LW, 3000+index1, 5)  

 index1=index1+10                    

next      


SetData(zero, "Local HMI", LB, 4, 1)    


end macro_command


6.

macro_command main()

short a,b[10],name[5],i,index=0

bool zero=0


GetData(a, "Local HMI", RW, 1000, 1)

a=a+5

GetData(b[0], "Local HMI", RW, a, 5)            

SetData(b[0], "Local HMI", RW, 1100, 5)

SetData(zero, "Local HMI", LB, 5, 1)

         

for i=0 to 17

 GetData(name[0], "Local HMI", RW, 0+index, 5)

 SetData(name[0], "Local HMI", LW, 3000+index, 5)  

 index=index+10                    

next




end macro_command


7.

macro_command main()

short a,b[10],name[5], i,index=0

bool zero=0


GetData(a, "Local HMI", RW, 1000, 1)

a=a+5

GetData(b[0], "Local HMI", RW, 1100, 5)

SetData(b[0], "Local HMI", RW, a, 5)

SetData(zero, "Local HMI", LB, 6, 1)

         

for i=0 to 17

 GetData(name[0], "Local HMI", RW, 0+index, 5)

 SetData(name[0], "Local HMI", LW, 3000+index, 5)  

 index=index+10                    

next


   

end macro_command


8.

macro_command main()

short a,b[3]

bool OFF


GetData(a, "Local HMI", LW, 9200, 1)

b[0]=1+a/10

b[1]=b[0]+1

b[2]=b[1]+1

SetData(b[0], "Local HMI", RW, 2000, 3)  

SetData(OFF, "Local HMI", LB, 10, 1)                    


end macro_command


9.

macro_command main()

short name[5],temp[5]

short i,var=0,b[5]

bool ON=true,OFF,flag=false


GetData(name[0], "Local HMI", LW, 0, 5)        // get name strings


for i=0 to 17 step 1      

  GetData(temp[0], "Local HMI", RW, var, 5)


  if name[0]==temp[0] and name[1]==temp[1] and name[2]==temp[2] and name[3]==temp[3] and name[4]==temp[4]  then

  GetData(b[0], "Local HMI", RW, var+5, 5)      

  SetData(b[0], "Local HMI", LW, 5, 5)

  flag=true

  SetData(flag, "Local HMI", LB, 10, 1)            

  else

  var=var+10

 

  end if    

SetData(i, "Local HMI", LW, 100, 1)    

SetData(var, "Local HMI", LW, 101, 1)  

                       

next i

       

SetData(ON, "Local HMI", LB, 9, 1)  

SetData(OFF, "Local HMI", LB, 7, 1)                          

     

end macro_command


10.

macro_command main()

char a[10]

bool OFF=false


GetData(a[0], "Local HMI", LW, 0, 10)

SetData(a[0], "Local HMI", LW, 200, 10)                        

SetData(OFF, "Local HMI", LB, 8, 1)

           

end macro_command


11.

macro_command main()

bool alarm=true,OFF=false,flag


GetData(flag, "Local HMI", LB, 10, 1)

 if flag==false then            

    SetData(alarm, "Local HMI", LB, 11, 1)                    

 end if


 SetData(OFF, "Local HMI", LB, 10, 1)                    

 SetData(OFF, "Local HMI", LB, 9, 1)  

end macro_command


12.

macro_command main()

bool OFF=false

char name[10]


GetData(name[0], "Local HMI", LW, 200, 10)    

SetData(name[0], "Local HMI", LW, 0, 10)                  

SetData(OFF, "Local HMI", LB, 12, 1)                    


end macro_command


13.

macro_command main()

short name[5],temp[5]

short i,j,m,var=0,index

bool OFF=false,flag=false


GetData(index, "Local HMI", LW, 9200, 1)  

GetData(name[0], "Local HMI", LW, 3000+index, 5)      

for i=0 to 17 step 1  

  GetData(temp[0], "Local HMI", RW, var, 5)

  if name[0]==temp[0] and name[1]==temp[1] and name[2]==temp[2] and name[3]==temp[3] and name[4]==temp[4]  then  

      flag=true

      SetData(flag, "Local HMI", LB, 20, 1)    

      SetData(name[0], "Local HMI", LW, 100, 5)                    

  else

  var=var+10            

  end if                          

next i


if flag==false then

  SetData(name[0], "Local HMI", RW, 0+index, 5)

end if            

       

SetData(OFF, "Local HMI", LB, 21, 1)                          


end macro_command


14.

macro_command main()

short name[5]

short i,index=0


         

for i=0 to 17

 GetData(name[0], "Local HMI", RW, 0+index, 5)

 SetData(name[0], "Local HMI", LW, 3000+index, 5)  

 index=index+10                    

next



                 

end macro_command


15.


macro_command main()


char a[10],b[10],c[10]

bool OFF=false

short index


GetData(index, "Local HMI", LW, 9200, 1)            

GetData(a[0], "Local HMI", RW, 0+index, 10)

GetData(b[0], "Local HMI", RW, 10+index, 10)

GetData(c[0], "Local HMI", RW, 20+index, 10)


SetData(a[0], "Local HMI",LW, 3000+index, 10)

SetData(b[0], "Local HMI", LW, 3010+index, 10)

SetData(c[0], "Local HMI", LW, 3020+index, 10)

SetData(OFF, "Local HMI", LB, 33, 1)


end macro_command


16.

macro_command main()

short name[5],oldname[5],temp[5]

short i,var=0,index

bool OFF=false,flag=false


GetData(index, "Local HMI", LW, 9200, 1)  

GetData(name[0], "Local HMI", LW, 3010+index, 5)          


for i=0 to 17 step 1    

  GetData(temp[0], "Local HMI", RW, var, 5)  

  if name[0]==temp[0] and name[1]==temp[1] and name[2]==temp[2] and name[3]==temp[3] and name[4]==temp[4]  then  

      flag=true

      SetData(flag, "Local HMI", LB, 20, 1)    

      SetData(name[0], "Local HMI", LW, 100, 5)            

  else

  var=var+10            

  end if    

                       

next i


if flag==false then

  SetData(name[0], "Local HMI", RW, 10+index, 5)

end if    

       

SetData(OFF, "Local HMI", LB, 22, 1)                          


end macro_command


17.

macro_command main()

short name[5],oldname[5],temp[5]

short i,var=0,index

bool OFF=false,flag=false


GetData(index, "Local HMI", LW, 9200, 1)  

GetData(name[0], "Local HMI", LW, 3020+index, 5)          

             

for i=0 to 17 step 1    

  GetData(temp[0], "Local HMI", RW, var, 5)    

  if name[0]==temp[0] and name[1]==temp[1] and name[2]==temp[2] and name[3]==temp[3] and name[4]==temp[4]  then  

      flag=true

      SetData(flag, "Local HMI", LB, 20, 1)  

      SetData(name[0], "Local HMI", LW, 100, 5)              

  else

  var=var+10            

  end if    

next i


if flag==false then

  SetData(name[0], "Local HMI", RW, 20+index, 5)

end if    

       

SetData(OFF, "Local HMI", LB, 23, 1)                          


end macro_command


18.

macro_command main()

short name[5]

short i,index=0,number[3]={1,2,3}

bool ON=true

         

for i=0 to 17

 GetData(name[0], "Local HMI", RW, 0+index, 5)

 SetData(name[0], "Local HMI", LW, 3000+index, 5)  

 index=index+10                    

next


SetData(number[0], "Local HMI", RW, 2000, 3)    

SetData(ON, "Local HMI", LB, 0, 1)

                 

end macro_command





zggdiyutc

  • 精华:0帖
  • 求助:14帖
  • 帖子:14帖 | 83回
  • 年度积分:0
  • 历史总积分:149
  • 注册:2013年3月14日
发表于:2013-05-09 09:31:56
1楼

是威纶通    宏程序

竹子--

  • 精华:0帖
  • 求助:9帖
  • 帖子:19帖 | 606回
  • 年度积分:0
  • 历史总积分:2154
  • 注册:2009年11月26日
发表于:2013-05-09 10:38:48
2楼

我看像宏程序的一种。

zggdiyutc

  • 精华:0帖
  • 求助:14帖
  • 帖子:14帖 | 83回
  • 年度积分:0
  • 历史总积分:149
  • 注册:2013年3月14日
发表于:2013-05-09 10:44:01
3楼

这鸡吧程序 困扰了我一个多月了  哪位高人指点迷津


双剑合璧

  • 精华:0帖
  • 求助:4帖
  • 帖子:30帖 | 218回
  • 年度积分:110
  • 历史总积分:2549
  • 注册:2009年6月11日
发表于:2013-05-09 23:38:38
4楼

宏程序,接上触摸屏一试便知,其实就是设置一些参数。可以联系我254489112@qq.com

通讯网-原创军团

  • 精华:11帖
  • 求助:1帖
  • 帖子:432帖 | 10265回
  • 年度积分:0
  • 历史总积分:24711
  • 注册:2004年7月09日
发表于:2013-05-10 07:25:44
5楼

我没有用过威伦宏指令,不过应该不难看懂:

macro_command main()


char a[10],b[10],c[10]

bool OFF=false

short index


GetData(index, "Local HMI", LW, 9200, 1)          

GetData(a[0], "Local HMI", RW, 0+index, 10)

GetData(b[0], "Local HMI", RW, 10+index, 10)

GetData(c[0], "Local HMI", RW, 20+index, 10)


SetData(a[0], "Local HMI",LW, 3000+index, 10)

SetData(b[0], "Local HMI", LW, 3010+index, 10)

SetData(c[0], "Local HMI", LW, 3020+index, 10)

SetData(OFF, "Local HMI", LB, 33, 1)


end macro_command


红色,是程序段或过程区域。绿色为定义段。。。。。程序都有这两部分。。中间getdata是读数,setdata是写数。。。

zggdiyutc

  • 精华:0帖
  • 求助:14帖
  • 帖子:14帖 | 83回
  • 年度积分:0
  • 历史总积分:149
  • 注册:2013年3月14日
发表于:2013-05-10 07:50:05
6楼

回复内容:

对: 通讯网-原创军团 我没有用过威伦宏指令,不过应该不难看懂:macro_c... 内容的回复!


前辈 我想修改这个宏程序  能帮我大体解释下吗


热门招聘
相关主题

官方公众号

智造工程师