📄 frmmain.frm
字号:
EndProperty
Height = 3015
Left = 4080
TabIndex = 1
Top = 600
Width = 3735
Begin VB.CheckBox chkAccInpMove
Caption = "加减速插补(默认匀速)"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 120
TabIndex = 44
Top = 525
Width = 2175
End
Begin VB.CommandButton btnDetailSetting
Caption = "详细设置..."
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2520
TabIndex = 7
Top = 500
Width = 1095
End
Begin VB.OptionButton optnCircleInpMove
Caption = "圆弧插补"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1920
TabIndex = 6
Top = 240
Width = 1335
End
Begin VB.OptionButton optnLineInpMove
Caption = "直线插补"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 5
Top = 240
Width = 1095
End
Begin VB.Frame frmeMoveType
Caption = "运动类型"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2055
Left = 120
TabIndex = 4
Top = 840
Width = 3495
Begin VB.CheckBox chkSymmetryAcc_w
Caption = "W轴非对称加减速(默认对称)"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 31
Top = 1680
Width = 2895
End
Begin VB.CheckBox chkSymmetryAcc_z
Caption = "Z轴非对称加减速(默认对称)"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 30
Top = 1320
Width = 2775
End
Begin VB.CheckBox chkSymmetryAcc_y
Caption = "Y轴非对称加减速(默认对称)"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 29
Top = 960
Width = 2775
End
Begin VB.CheckBox chkSymmetryAcc_x
Caption = "X轴非对称加减速(默认对称)"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 28
Top = 600
Width = 2775
End
Begin VB.CheckBox chkCurve_S
Caption = "S曲线加减速(默认为直线)"
Enabled = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 27
Top = 240
Width = 2655
End
End
End
Begin VB.Frame Frame1
Caption = "逻辑位置"
BeginProperty Font
Name = "MS Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2775
Left = 120
TabIndex = 0
Top = 600
Width = 3735
Begin VB.TextBox txtLogicPos_w
BackColor = &H8000000B&
Height = 375
Left = 1800
Locked = -1 'True
TabIndex = 22
Text = "0"
Top = 2040
Width = 1695
End
Begin VB.TextBox txtLogicPos_z
BackColor = &H8000000B&
Height = 375
Left = 1800
Locked = -1 'True
TabIndex = 21
Text = "0"
Top = 1442
Width = 1695
End
Begin VB.TextBox txtLogicPos_y
BackColor = &H8000000B&
Height = 375
Left = 1800
Locked = -1 'True
TabIndex = 20
Text = "0"
Top = 846
Width = 1695
End
Begin VB.TextBox txtLogicPos_x
BackColor = &H8000000B&
Height = 375
Left = 1800
Locked = -1 'True
TabIndex = 19
Text = "0"
Top = 250
Width = 1695
End
Begin VB.Label Label5
Caption = "W轴的逻辑位置:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 14
Top = 2160
Width = 1575
End
Begin VB.Label Label4
Caption = "Z轴的逻辑位置:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 13
Top = 1560
Width = 1575
End
Begin VB.Label Label3
Caption = "Y轴的逻辑位置:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 12
Top = 960
Width = 1575
End
Begin VB.Label Label2
Caption = "X轴的逻辑位置:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 11
Top = 360
Width = 1575
End
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "850卡插补运动演示"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2520
TabIndex = 10
Top = 120
Width = 2655
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim m_nLogicPos_w As Long
Dim m_nLogicPos_x As Long
Dim m_nLogicPos_y As Long
Dim m_nLogicPos_z As Long
Dim m_nCurrentSpeed_w As Long
Dim m_nCurrentSpeed_x As Long
Dim m_nCurrentSpeed_y As Long
Dim m_nCurrentSpeed_z As Long
Dim m_nPulseCount_w As Long
Dim m_nPulseCount_x As Long
Dim m_nPulseCount_y As Long
Dim m_nPulseCount_z As Long
Dim m_bEnableDemo_w As Boolean
Dim m_bEnableDemo_x As Boolean
Dim m_bEnableDemo_y As Boolean
Dim m_bEnableDemo_z As Boolean
Dim m_bIsContinueInp As Boolean
Dim m_bIsInpLine As Boolean
Dim m_bIsTwoAxisInp As Boolean
Dim m_bIsThreeAxisInp As Boolean
Dim m_bIsFourAxisInp As Boolean
Dim m_bEnableSymmetry_Acc_w As Boolean
Dim m_bEnableSymmetry_Acc_x As Boolean
Dim m_bEnableSymmetry_Acc_y As Boolean
Dim m_bEnableSymmetry_Acc_z As Boolean
Dim cardno As Long
Private Sub btnClear_Click()
set_command_pos cardno, 1, 0
set_command_pos cardno, 2, 0
set_command_pos cardno, 3, 0
set_command_pos cardno, 4, 0
End Sub
Private Sub btnContinueMove_Click()
If Not m_bEnableDemo_x And Not m_bEnableDemo_z And m_bIsTwoAxisInp Then
MsgBox "请选择插补轴!"
Exit Sub
End If
If Timer1.Enabled = False Then Timer1.Enabled = True
m_bIsContinueInp = True
Dim nstate1 As Long
Dim nstate2 As Long
'范围设定数据更新
set_range cardno, 1, 8000000 / m_nRatio_x
set_range cardno, 2, 8000000 / m_nRatio_y
set_range cardno, 3, 8000000 / m_nRatio_z
set_range cardno, 4, 8000000 / m_nRatio_w
'三轴插补和四轴插补时Z的倍率应设置成与X轴一样
If Not m_bIsTwoAxisInp Then set_range cardno, 3, 8000000 / m_nRatio_x
SetSpeed
Dim no As Integer
Dim ch As Integer
If m_bEnableDemo_x Then
no = 1
ch = 1
End If
If m_bEnableDemo_z And m_bIsTwoAxisInp Then
no = 2
ch = 3
End If
If m_bEqualityVelocity Then SetAddSpeed
'第一段
inp_dec_disable cardno, no
DemoInpMove
Do While True
get_stopdata cardno, ch, nstate1
If nstate1 <> 0 Then GoTo err
get_inp_status2 cardno, no, nstate2
If nstate2 <> 0 Then Exit Do
DoEvents
Loop
'第二段
DemoInpMove
Do While True
get_stopdata cardno, ch, nstate1
If nstate1 <> 0 Then GoTo err
get_inp_status2 cardno, no, nstate2
If nstate2 <> 0 Then Exit Do
DoEvents
Loop
'第三段
DemoInpMove
Do While True
get_stopdata cardno, ch, nstate1
If nstate1 <> 0 Then GoTo err
get_inp_status2 cardno, no, nstate2
If nstate2 <> 0 Then Exit Do
DoEvents
Loop
'第四段
DemoInpMove
Do While True
get_stopdata cardno, ch, nstate1
If nstate1 <> 0 Then GoTo err
get_inp_status2 cardno, no, nstate2
If nstate2 <> 0 Then Exit Do
DoEvents
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -