许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  雷赛codesys 03系列使用心得,踩过的坑告诉你

雷赛codesys 03系列使用心得,踩过的坑告诉你

阅读数 7
点赞 0
article_banner


LS_3AxisLine (Axis0:=轴号0, Axis1:=轴号1, Axis2:=轴号2, Exec:= 启动信号,

Halt:=暂停信号, Stop:=停止信号, IpoCycle:=插补周期,

PosMode:=坐标模式, EndPos:=终点坐标, VelocityMode:=速度曲线模式,

Velocity:=插补运动最大速度, Acceleration:=加速度, Deceleration:=减速度,

Jerk:=加加速度, Vel=>插补速度, Done=>插补运动结束, Busy=>插补运动中,

CommandAborted=>运动被终止, CommandHalt=>运动暂停,

Error=>指令出错, ErrorID=>错误代码 );

指令中:轴号0、轴号1、轴号2是参与三轴直线插补运动的轴号。

插补周期须设置为HSIO_Task任务相等周期。

坐标模式为0时,终点坐标是绝对坐标,为1时是相对坐标。

速度曲线模式为0时,速度曲线为梯形速度曲线;为1时是S形速度曲线;为3时是二次速度曲线。


直线插补例程

设置坐标模式为绝对坐标,即PosMode = 0,终点坐标为[1000,700,400];速度曲线为梯形,即VelocityMode = 0 ;插补运动的最大速度为1200 unit/s,加速度为5000unit/s2,减速度为10000unit/s2。程序代码如下代码。

PROGRAM PLC_PRG

VAR

Power: ARRAY [0..2] OF MC_POWER;

LineXYZ: LS_3AxisLine;

Linestart: BOOL;

Linedistance: ARRAY [0..2] OF LREAL:= [1000,700,400];

Linedone: BOOL;

Vel_0: LREAL;

END_VAR

//轴使能

Power[0](Axis:= X, Enable:= 1, bRegulatorOn:= 1, bDriveStart:= 1,

Status=> , bRegulatorRealState=> , bDriveStartRealState=> , Busy=> , Error=> , ErrorID=> );

Power[1](Axis:= Y, Enable:= 1, bRegulatorOn:= 1, bDriveStart:= 1,

Status=> , bRegulatorRealState=> , bDriveStartRealState=> , Busy=> , Error=> , ErrorID=> );

Power[2](Axis:= Z, Enable:= 1, bRegulatorOn:= 1, bDriveStart:= 1,

Status=> , bRegulatorRealState=> , bDriveStartRealState=> , Busy=> , Error=> , ErrorID=> );

(*直线插补

绝对坐标模式,终点坐标为[1000,700,400],速度曲线为梯形;

插补运动的最大速度为1200 unit/s,加速度为5000unit/s2,减速度为10000unit/s2

*)

LineXYZ(Axis0:=X, Axis1:=Y, Axis2:=Z, Exec:=Linestart, Halt:= , Stop:= , IpoCycle:= 4000,

PosMode:=0, EndPos:=Linedistance, VelocityMode:=0, Velocity:=1200, Acceleration:=5000,Deceleration:=10000, Jerk:=, Vel=>Vel_0, Done=>Linedone, Busy=> ,

CommandAborted=> , CommandHalt=> , Error=> , ErrorID=> );

两轴圆弧插补指令如下。

LS_2AxisCircle( Axis0:=轴号0, Axis1:=轴号1, Exec:=启动信号, Halt:=暂停信号,

Stop:=停止信号, IpoCycle:=插补周期, PosMode:=坐标模式,

ArcIpo_dir:=圆弧方向, Circle_Mode:=圆弧模式, StopAngle:=圆心角,

CircleRadiual:=半径, AuxPos:=辅助坐标, EndPos:= 终点坐标,

RunCycle:=圆弧循环次数, VelocityMode:=速度曲线模式,

Velocity:=插补运动最大速度, Acceleration:=加速度, Deceleration:=减速度,

Jerk:=加加速度, Vel=>插补速度, Done=>插补运动结束, Busy=>插补运动中,

CommandAborted=>运动被终止, CommandHalt=>运动暂停,

Error=>指令出错, ErrorID=>错误代码 );



直线插补

//轴使能

Power[0](Axis:= X, Enable:= 1, bRegulatorOn:= 1, bDriveStart:= 1,

Status=> , bRegulatorRealState=> , bDriveStartRealState=> , Busy=> , Error=> , ErrorID=> );

Power[1](Axis:= Y, Enable:= 1, bRegulatorOn:= 1, bDriveStart:= 1,

Status=> , bRegulatorRealState=> , bDriveStartRealState=> , Busy=> , Error=> , ErrorID=> );

Power[2](Axis:= Z, Enable:= 1, bRegulatorOn:= 1, bDriveStart:= 1,

Status=> , bRegulatorRealState=> , bDriveStartRealState=> , Busy=> , Error=> , ErrorID=> );

(*直线插补

绝对坐标模式,终点坐标为[1000,700,400],速度曲线为梯形;

插补运动的最大速度为1200 unit/s,加速度为5000unit/s2,减速度为10000unit/s2

*)

LineXYZ(Axis0:=X, Axis1:=Y, Axis2:=Z, Exec:=Linestart, Halt:= , Stop:= , IpoCycle:= 4000,

PosMode:=0, EndPos:=Linedistance, VelocityMode:=0, Velocity:=1200, Acceleration:=5000,

Deceleration:=10000, Jerk:=, Vel=>Vel_0, Done=>Linedone, Busy=> ,

CommandAborted=> , CommandHalt=> , Error=> , ErrorID=> );

(*圆弧插补

相对坐标模式,三点圆弧模式,终点坐标为[4000,-3300],中间点坐标为[5800,4200],速度曲线为梯形;

插补运动的最大速度为2000 unit/s,加速度为5000unit/s2,减速度为5000unit/s2

*)

circleXY( Axis0:=X, Axis1:=Y, Exec:=circleStart, Halt:= , Stop:= , IpoCycle:= 4000, PosMode:=1,

ArcIpo_dir:=, Circle_Mode:=0, StopAngle:= , CircleRadiual:= ,

AuxPos:=AuxPosition, EndPos:=EndPosition, RunCycle:=1, VelocityMode:=0,

Velocity:=2000, Acceleration:=5000, Deceleration:=5000, Jerk:= ,

Vel=>Vel_1, Done=>circleDone, Busy=> , CommandAborted=> ,

CommandHalt=> , Error=> , ErrorID=> );


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

相关文章
技术文档
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空