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;
(*****************************)
(**********************************************)
我们电气的老大写的电气程序块,机器是用于五轴机械手的,脉冲的比较的一个程序块,本人看不懂什么意思,请高手来指点一下。还需要其他的我可以继续贴出来!
楼主最近还看过