| | |
| | | int sts = MotionCard.GetAxisStatus(MotionCardMovingOption.AxisIndex); |
| | | if ((sts & 0x200) == 0)//关闭状态 |
| | | { |
| | | MotionCard.AxisOnAsync(MotionCardMovingOption.AxisIndex).GetAwaiter().GetResult(); |
| | | MotionCard.AxisOnAsync(MotionCardMovingOption.AxisIndex); |
| | | buttonServoEnable.Text = "伺服已开启"; |
| | | } |
| | | else |
| | | { |
| | | MotionCard.AxisOffAsync(MotionCardMovingOption.AxisIndex).GetAwaiter().GetResult(); |
| | | MotionCard.AxisOffAsync(MotionCardMovingOption.AxisIndex); |
| | | buttonServoEnable.Text = "伺服已关闭"; |
| | | } |
| | | } |
| | |
| | | |
| | | private void buttonSmoothStop_Click(object sender, EventArgs e) |
| | | { |
| | | MotionCard.MoveStop(MotionCardMovingOption.AxisIndex, 0).GetAwaiter().GetResult(); |
| | | MotionCard.MoveStop(MotionCardMovingOption.AxisIndex, 0); |
| | | } |
| | | |
| | | private void buttonEmergencyStop_Click(object sender, EventArgs e) |
| | | { |
| | | MotionCard.MoveStop(MotionCardMovingOption.AxisIndex, 1).GetAwaiter().GetResult(); |
| | | MotionCard.MoveStop(MotionCardMovingOption.AxisIndex, 1); |
| | | } |
| | | |
| | | } |