User`s manual
http://www.adtechcn.com 76
Setup_Speed 1, m_nStartV(0).Text, m_nSpeed(0).Text, m_nAdd(0).Text
Interp_Move2 1, 4, m_nPulse(0).Text, m_nPulse(3).Text
'********************** interpolation of axis Y and Z******************************
ElseIf m_bY.value = vbChecked And m_bZ.value = vbChecked Then
Setup_Speed 2, m_nStartV(1).Text, m_nSpeed(1).Text, m_nAdd(1).Text
Interp_Move2 2, 3, m_nPulse(1).Text, m_nPulse(2).Text
'********************** interpolation of axis Y and A********************************
ElseIf m_bY.value = vbChecked And m_bA.value = vbChecked Then
Setup_Speed 2, m_nStartV(1).Text, m_nSpeed(1).Text, m_nAdd(1).Text
Interp_Move2 2, 4, m_nPulse(1).Text, m_nPulse(3).Text
'*********************** interpolation of axis Z and A*******************************
ElseIf m_bZ.value = vbChecked And m_bA.value = vbChecked Then
Setup_Speed 3, m_nStartV(2).Text, m_nSpeed(2).Text, m_nAdd(2).Text
Interp_Move2 3, 4, m_nPulse(2).Text, m_nPulse(3).Text
Else
MsgBox "Please select the interpolation axis", "prompt"
End If
End Sub
1.4 Monitoring module
The monitoring module is used to get the information on axis’ drive and display the information
on motion, and at the same time, prevent the system from sending new drive commands during the
drive process. The monitoring module performs its functions through the timer, whose codes are
described as follows:
Private Sub Timer1_Timer()
Dim nLogPos As Long 'logic position
Dim nActPos As Long 'actual position
Dim nSpeed As Long 'running speed
Dim nStatus(4) As Long 'drive status of axis
Dim value As Integer 'IO status
For i = 1 To 4
Get_CurrentInf i, nLogPos, nActPos, nSpeed
m_nLogPos(i - 1).Caption = nLogPos
m_nActPos(i - 1).Caption = nActPos
m_nRunSpeed(i - 1).Caption = nSpeed
Get_MoveStatus i, nStatus(i - 1), 0
'detect limit signal and stop0 signal
Read_Input (i - 1) * 2 + 4, value
If value = 0 Then