Пример #1
0
        private void InitAxises()
        {
            if (!VsmdController.GetVsmdController().IsInitialized())
            {
                StatusBar.DisplayMessage(MessageType.Error, "设备未连接!");
                DisableAllControls();
                return;
            }

            VsmdInfoSync ax = VsmdController.GetVsmdController().GetAxis(VsmdAxis.X);

            txtCidX.Text   = ax.Cid.ToString();
            txtPosX.Text   = ax.curPos.ToString();
            txtSpeedX.Text = ax.GetAttributeValue(VsmdAttribute.Spd).ToString();
            txtZsdX.Text   = ax.GetAttributeValue(VsmdAttribute.Zsd).ToString();

            VsmdInfoSync ay = VsmdController.GetVsmdController().GetAxis(VsmdAxis.Y);

            txtCidY.Text   = ay.Cid.ToString();
            txtPosY.Text   = ay.curPos.ToString();
            txtSpeedY.Text = ay.GetAttributeValue(VsmdAttribute.Spd).ToString();
            txtZsdY.Text   = ay.GetAttributeValue(VsmdAttribute.Zsd).ToString();

            VsmdInfoSync az = VsmdController.GetVsmdController().GetAxis(VsmdAxis.Z);

            txtCidZ.Text   = az.Cid.ToString();
            txtPosZ.Text   = az.curPos.ToString();
            txtSpeedZ.Text = az.GetAttributeValue(VsmdAttribute.Spd).ToString();
            txtZsdZ.Text   = az.GetAttributeValue(VsmdAttribute.Zsd).ToString();
        }
Пример #2
0
        private async void  GoHome()
        {
            VsmdInfoSync ax     = VsmdController.GetVsmdController().GetAxis(VsmdAxis.X);
            var          speedX = ax.GetAttributeValue(VsmdAttribute.Spd);
            var          zsdX   = ax.GetAttributeValue(VsmdAttribute.Zsd);

            VsmdInfoSync ay     = VsmdController.GetVsmdController().GetAxis(VsmdAxis.Y);
            var          speedY = ay.GetAttributeValue(VsmdAttribute.Spd);
            var          zsdY   = ay.GetAttributeValue(VsmdAttribute.Zsd);

            VsmdInfoSync az     = VsmdController.GetVsmdController().GetAxis(VsmdAxis.Z);
            var          speedZ = az.GetAttributeValue(VsmdAttribute.Spd);
            var          zsdZ   = az.GetAttributeValue(VsmdAttribute.Zsd);

            await VsmdController.GetVsmdController().SetZsd(VsmdAxis.Z, zsdZ);

            await VsmdController.GetVsmdController().ZeroStart(VsmdAxis.Z);

            await VsmdController.GetVsmdController().SetZsd(VsmdAxis.X, zsdX);

            VsmdController.GetVsmdController().ZeroStart(VsmdAxis.X);

            await VsmdController.GetVsmdController().SetZsd(VsmdAxis.Y, zsdY);

            await VsmdController.GetVsmdController().ZeroStart(VsmdAxis.Y);

            //set positive limit register
            ax.cfgPsr(3);
            ay.cfgPsr(3);
            az.cfgPsr(3);
        }