SetAxisMotionProfile

配置轴的运动设定。

语法

KsError SetAxisMotionProfile(
     int Index,
     McProfileType ProfileType,
     McProfileSettings Settings
);

参数

Index:轴的索引。索引以零为起点;别名将影响此参数。

ProfileType:确定加速度、减速度和加加速度的单位,请见 McProfileType 类型。

Settings:调整轴的运动设定,请见 McProfileSettings 结构。

回传值

如果此函式执行成功,会回传 errNoError,否则会传回错误码。如需更多有关错误码的资讯,请参阅 KsError 清单。

范例

复制
McProfileSettings Motion = {
    3,        //MINIMUM_ERROR
    360,      //MAXIMUM_ERROR
    3600,      //MAXIMUM_VELOCITY
    36000,      //MAXIMUM_ACCELERATION
    36000,      //MAXIMUM_DECELERATION
    3600000,  //MAXIMUM_JERK
    0         //MAXIMUM_JOLT
};

KsError nRet = SetAxisMotionProfile(0, McProfileType::profileUnitPerSecond, Motion);

使用需求

  RT Win32
最低支援版本 4.0 4.0
标头档 ksmotion.h ksmotion.h
程式库 KsApi_Rtss.lib KsApi.lib

参见

SetAxisMotionProfileOverride