首页 上一页 1 2 3 下一页 尾页

omron CP1H PLC 程序块 st语言程序块 请高手来看看是怎么用的 点击:12124 | 回复:51



shuishou250

    
  • 精华:0帖
  • 求助:1帖
  • 帖子:4帖 | 25回
  • 年度积分:15
  • 历史总积分:603
  • 注册:2011年3月28日
发表于:2012-05-13 22:10:50
楼主

if xtagp > xfinp then;
                xl := xtagp - xfinp;
  if xl > 20 then xen := 1;
  else xen :=0;
  end_if;
         if xtagp > int_to_dint(winpx) then ;
                 xcomp:= xtagp - int_to_dint(winpx);
   else xcomp:= xtagp -50;
   end_if ;
                 xmidp := xtagp - (xl / 2);
else xl := xfinp - xtagp ;
  if xl > 20 then xen := 2 ;
  else xen :=0;
  end_if;
                xcomp:= xtagp +int_to_dint( winpx);
                  xmidp := xtagp + (xl / 2);

end_if;


(*;********************************)
if ytagp > yfinp then ;
            yl := ytagp - yfinp;
 if yl > 20 then yen := 1 ;
 else yen :=0 ;
 end_if;
  if ytagp > int_to_dint(winpy) then;
      ycomp:= ytagp - int_to_dint(winpy);
   else ycomp := ytagp -50;
   end_if ;
                   ymidp := ytagp - (yl / 2);
  else yl := yfinp - ytagp ;
 if yl > 20 then yen := 2 ;
   else yen :=0;
         end_if;
  ycomp:= ytagp + int_to_dint(winpy);
 ymidp := ytagp + (yl / 2);

 end_if;
(*;********************************)
 
if ztagp > zfinp then;
  zl := ztagp - zfinp;
 if zl > 20 then zen := 1 ;
 else zen :=0;
 end_if;
 
   if ztagp > int_to_dint(winpz) then;
  zcomp:= ztagp -int_to_dint(winpz);
  else zcomp := ztagp - 50;
  end_if ;
 zmidp := ztagp - (zl / 2);
  else zl := zfinp - ztagp ;
 if zl > 20 then zen := 2 ;
        else zen :=0;
   end_if;
 zcomp:= ztagp +int_to_dint( winpz);
 zmidp := ztagp - (zl / 2);

 end_if;
(*;********************************)
 
if utagp > ufinp then ;
 ul := utagp - ufinp;
 if ul > 20 then uen := 1;
 else uen :=0;
 end_if;
 
 
    if utagp >int_to_dint( winpu) then ;
  ucomp:= utagp - int_to_dint(winpu);
  else ucomp := utagp - 50;
 umidp := utagp - (ul / 2);
 end_if ;
  else ul := ufinp - utagp ;
 if ul > 20 then uen := 2;
 
 else uen :=0;
 end_if;
 ucomp:= utagp + int_to_dint(winpu);
 umidp := utagp - (ul / 2);

 end_if;
(*;********************************)
 
    if xl > yl then max1:= xl ;
       else max1 := yl;
       end_if;
    if zl > ul then max2:= zl ;
      else max2 := ul;
      end_if;
   if max1 >max2  then maxd := max1;
 else maxd :=max2;
 end_if;
(*;****************************************)
comvelb := comvel / 10 ;
if tcode > 31 & tcode < 51 then
    xvela := int_to_dint((xspd *spdb)/ spda);
    yvela := int_to_dint((yspd *spdb)/ spda);
    zvela := int_to_dint((zspd *spdb)/ spda);
    rvela := int_to_dint((rspd *spdb)/ spda);
else
    xvela := (comvelb *xl) / maxd;
    yvela := (comvelb *yl) / maxd;
    zvela := (comvelb *zl) / maxd;
    rvela:= (comvelb *ul) / maxd;
end_if  ;

xvel := xvela *10 * int_to_dint(xspdrate) ;
yvel := yvela *10 * int_to_dint(yspdrate) ;
zvel := zvela *10 * int_to_dint(zspdrate) ;
rvel:=  rvela *10 * int_to_dint(rspdrate)  ;

 

if xvel < 50 then xvel :=50;
end_if  ;
if xvel > 100000 then xvel :=100000 ;
end_if;
if yvel < 50  then yvel := 50;
end_if;
if zvel < 50 then zvel := 50 ;
end_if;
if rvel < 50 then rvel := 50;
 end_if;
if yvel > 100000 then yvel :=100000 ;
end_if;
if zvel > 100000 then zvel :=100000 ;
end_if;
if rvel > 100000 then rvel :=100000 ;
end_if;

(*****************************)


(**********************************************)

我们电气的老大写的电气程序块,机器是用于五轴机械手的,脉冲的比较的一个程序块,本人看不懂什么意思,请高手来指点一下。还需要其他的我可以继续贴出来!

 

正在下载,请等待……
下载附件需0积分!



楼主最近还看过



FEI022688

  • 精华:0帖
  • 求助:1帖
  • 帖子:2帖 | 364回
  • 年度积分:0
  • 历史总积分:62
  • 注册:2011年3月29日
发表于:2019-12-16 16:46:41
41楼

谢谢楼主的分享,这个都已经好久了

FEI022688

  • 精华:0帖
  • 求助:1帖
  • 帖子:2帖 | 364回
  • 年度积分:0
  • 历史总积分:62
  • 注册:2011年3月29日
发表于:2020-01-03 13:26:37
42楼

关注了,学习学习

ju691031

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 2258回
  • 年度积分:0
  • 历史总积分:106
  • 注册:2010年7月16日
发表于:2020-03-28 09:18:51
43楼

感谢楼主无私共享

ju691031

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 2258回
  • 年度积分:0
  • 历史总积分:106
  • 注册:2010年7月16日
发表于:2020-03-29 14:13:26
44楼

感谢楼主分享感谢楼主分享感谢楼主分享感谢楼主分享

ju691031

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 2258回
  • 年度积分:0
  • 历史总积分:106
  • 注册:2010年7月16日
发表于:2020-04-09 20:17:22
45楼

感谢分享资料,学习中。

wocaonima1314

  • 精华:0帖
  • 求助:3帖
  • 帖子:6帖 | 609回
  • 年度积分:0
  • 历史总积分:303
  • 注册:2014年5月25日
发表于:2020-09-25 19:36:52
46楼

投入与如图与i哟i哟i要投入如此

gk2017

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 32回
  • 年度积分:0
  • 历史总积分:117
  • 注册:2018年4月26日
发表于:2020-11-02 23:24:39
47楼

感谢分享功德无量

黑豹380

  • 精华:0帖
  • 求助:0帖
  • 帖子:0帖 | 7回
  • 年度积分:0
  • 历史总积分:21
  • 注册:2005年8月06日
发表于:2021-02-04 15:52:40
48楼

这个程序是四轴脉冲比较指令,虽然有四个轴脉冲  但是只要读明白一个轴就可以啦,这个应该是封装为FB块了,要结合工艺,以及I/O分配才能读明白这个程序。

@舉

  • 精华:0帖
  • 求助:1帖
  • 帖子:8帖 | 92回
  • 年度积分:0
  • 历史总积分:267
  • 注册:2018年9月23日
发表于:2022-08-31 15:06:40
49楼

多谢分享,学习下

LICLIN

  • 精华:0帖
  • 求助:0帖
  • 帖子:2帖 | 426回
  • 年度积分:8
  • 历史总积分:410
  • 注册:2017年3月14日
发表于:2022-10-13 14:24:24
50楼

羡慕英语好的,程序都是用的英文注释!


热门招聘
相关主题

官方公众号

智造工程师
    首页 上一页 1 2 3 下一页 尾页