예제 #1
0
        private void AsuMotionAddCircleWithSyncIO(object sender, EventArgs e)
        {
            AsuDll.AsuMotionAxisData end = new AsuDll.AsuMotionAxisData()
            {
                x = 0, y = 0, z = 0, a = 0, b = 0, c = 0, u = 0, v = 0, w = 0
            };                                                                                                                               // 坐标轴数据
            AsuDll.AsuMotionCartesian center = new AsuDll.AsuMotionCartesian()
            {
                x = 1, y = 1, z = 1
            };
            AsuDll.AsuMotionCartesian normal = new AsuDll.AsuMotionCartesian()
            {
                x = 2, y = 2, z = 2
            };
            int    turn       = 1;
            double vel        = 1;
            double ini_maxvel = 1;
            double acc        = 1;

            int ret = AsuInvoke.AsuMotion_AddCircleWithSyncIO(handle, ref end, ref center, ref normal, turn, vel, ini_maxvel, acc, Digital, Analog);

            switch (ret)
            {
            case 0:
                Print("添加同步IO空间圆弧插补规划 成功");
                break;

            case 1:
                Print("添加同步IO空间圆弧插补规划 失败,设备句柄为空指针,一般因为没有打开设备导致");
                break;

            case 2:
                Print("添加同步IO空间圆弧插补规划 失败");
                break;

            case 5:
                Print("添加同步IO空间圆弧插补规划 失败,缓冲区已满");
                break;

            default:
                Print("添加同步IO空间圆弧插补规划 失败,当前状态下不能进行PC的规划,因为前面提交的其他操作还未完成");
                break;
            }
        }