以下为进给系统的运动控制程序。 Private Sub Timer2_Timer() Dim ch_status As Long Dim a, b As Long ch_status = check_status(1) /利用check_status函数读取冲床原点开关的状态/ a = 4 b = a And ch_status /判断原点开关是否闭合/ If b = 4 Then /如果原点开关闭合/ set_conspeed 1, 100000 调用速度设置函数set_conspeed来设置伺服电机的运行速度./ con_pmove 1,Mdis* 835.8978246155 调用点位运动函数con_pmove来设置伺服电机的运转方向和运行距离/ End If End Sub