⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmexcution.frm

📁 步进电机控制程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmExcution 
   AutoRedraw      =   -1  'True
   Caption         =   "执行"
   ClientHeight    =   6360
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8085
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   9.75
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   6360
   ScaleWidth      =   8085
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdSet 
      Caption         =   "设置 "
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   4095
      TabIndex        =   5
      Top             =   5670
      Width           =   1185
   End
   Begin VB.TextBox txtDisToMove 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   6030
      MaxLength       =   5
      TabIndex        =   3
      Text            =   "2000"
      Top             =   5085
      Width           =   1860
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "退出 "
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   6750
      TabIndex        =   2
      Top             =   5670
      Width           =   1185
   End
   Begin VB.CommandButton cmdExc 
      Caption         =   "执行"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   11.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   5355
      TabIndex        =   0
      Top             =   5670
      Width           =   1185
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "要移动的步数:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   4095
      TabIndex        =   4
      Top             =   5130
      Width           =   1680
   End
   Begin VB.Label lblwait 
      Caption         =   "执行中,请等待。。。"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   555
      Left            =   135
      TabIndex        =   1
      Top             =   5580
      Visible         =   0   'False
      Width           =   4245
   End
End
Attribute VB_Name = "frmExcution"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExc_Click()
    
    disToMove = Me.txtDisToMove
    pulseSendCount = 0

    cmdExc.Enabled = False
    cmdExit.Enabled = False
    cmdSet.Enabled = False
    lblwait.Visible = True

    Me.Cls
    Dim i As Integer
    
    Me.Print "----------------------------------------------------------------------------------"
    Me.Print "加速频率表", , "|"; "减速频率表"
    Me.Print "----------------------------------------------------------------------------------"
    Me.Print "频率(HZ)", "脉冲数", "|"; "频率(HZ)", "脉冲数"
    Me.Print "----------------------------------------------------------------------------------"
    For i = 1 To FQSubdiv
        Me.Print accFQTable(i), accPCTable(i), "|"; decFQtable(i), decPCtable(i)
    Next
    Me.Print "----------------------------------------------------------------------------------"
    
    
    
    Dim QPC As LARGE_INTEGER
    Dim QPF As LARGE_INTEGER
    Dim c As Long
    
    QueryPerformanceFrequency QPF
    QueryPerformanceCounter QPC
    c = QPC.lowpart
    
    ' 执行操作
    moveRel disToMove
    
    QueryPerformanceCounter QPC

    Me.Print
    Me.Print "执行结果:"
    Me.Print "----------------------------------------------------------------"
    Me.Print "所需脉冲数:"
    Me.Print "加速脉冲数", "匀速脉冲数", "减速脉冲数"
    Me.Print realAccPC, realPatrolPC, realDecPC
    Me.Print "----------------------------------------------------------------"
    Me.Print "实际执行时间(秒):"; (QPC.lowpart - c) / QPF.lowpart
    Me.Print "实际发送脉冲数(包括高低电平及一个方向脉冲):"
    Me.Print , pulseSendCount
    Me.Print "----------------------------------------------------------------"
    
    lblwait.Visible = False
    cmdExc.Enabled = True
    cmdExit.Enabled = True
    cmdSet.Enabled = True
    
End Sub


Private Sub cmdExit_Click()
    Unload frmExcution
    Unload frmSettings
End Sub

Private Sub cmdSet_Click()
    Me.Hide
    Me.Cls
    frmSettings.Show
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -