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

📄 formcounter.vb

📁 使用研华DAQ和VB.net实现研华数据采集卡的多种功能.包括数据输入输出。内含多个源码
💻 VB
📖 第 1 页 / 共 2 页
字号:
Public Class frmCounter
    Inherits System.Windows.Forms.Form
    Dim IsInitializing As Boolean

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        IsInitializing = True
        InitializeComponent()
        IsInitializing = False

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents cmdSelectDevice As System.Windows.Forms.Button
    Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
    Friend WithEvents txtDeviceName As System.Windows.Forms.TextBox
    Friend WithEvents txtDeviceNum As System.Windows.Forms.TextBox
    Friend WithEvents cmbChannel As System.Windows.Forms.ComboBox
    Friend WithEvents cmbGateMode As System.Windows.Forms.ComboBox
    Friend WithEvents txtScanTime As System.Windows.Forms.TextBox
    Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
    Friend WithEvents cmdCounterStart As System.Windows.Forms.Button
    Friend WithEvents cmdCounterStop As System.Windows.Forms.Button
    Friend WithEvents txtCounter As System.Windows.Forms.TextBox
    Friend WithEvents ScanTimer As System.Windows.Forms.Timer
    Friend WithEvents cmdExit As System.Windows.Forms.Button
    Friend WithEvents txtError As System.Windows.Forms.TextBox
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Friend WithEvents DAQCounter1 As AxDAQCounterLib.AxDAQCounter
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmCounter))
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.cmdSelectDevice = New System.Windows.Forms.Button
        Me.txtDeviceNum = New System.Windows.Forms.TextBox
        Me.txtDeviceName = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label1 = New System.Windows.Forms.Label
        Me.GroupBox2 = New System.Windows.Forms.GroupBox
        Me.Label11 = New System.Windows.Forms.Label
        Me.Label6 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.txtScanTime = New System.Windows.Forms.TextBox
        Me.cmbGateMode = New System.Windows.Forms.ComboBox
        Me.cmbChannel = New System.Windows.Forms.ComboBox
        Me.GroupBox3 = New System.Windows.Forms.GroupBox
        Me.Label8 = New System.Windows.Forms.Label
        Me.Label7 = New System.Windows.Forms.Label
        Me.txtError = New System.Windows.Forms.TextBox
        Me.txtCounter = New System.Windows.Forms.TextBox
        Me.cmdCounterStop = New System.Windows.Forms.Button
        Me.cmdCounterStart = New System.Windows.Forms.Button
        Me.ScanTimer = New System.Windows.Forms.Timer(Me.components)
        Me.cmdExit = New System.Windows.Forms.Button
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.DAQCounter1 = New AxDAQCounterLib.AxDAQCounter
        Me.GroupBox1.SuspendLayout()
        Me.GroupBox2.SuspendLayout()
        Me.GroupBox3.SuspendLayout()
        CType(Me.DAQCounter1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.cmdSelectDevice)
        Me.GroupBox1.Controls.Add(Me.txtDeviceNum)
        Me.GroupBox1.Controls.Add(Me.txtDeviceName)
        Me.GroupBox1.Controls.Add(Me.Label2)
        Me.GroupBox1.Controls.Add(Me.Label1)
        Me.GroupBox1.Location = New System.Drawing.Point(16, 8)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(368, 80)
        Me.GroupBox1.TabIndex = 1
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "Select Device :"
        '
        'cmdSelectDevice
        '
        Me.cmdSelectDevice.Location = New System.Drawing.Point(248, 16)
        Me.cmdSelectDevice.Name = "cmdSelectDevice"
        Me.cmdSelectDevice.Size = New System.Drawing.Size(88, 23)
        Me.cmdSelectDevice.TabIndex = 4
        Me.cmdSelectDevice.Text = "SelectDevice"
        Me.ToolTip1.SetToolTip(Me.cmdSelectDevice, "Select the device")
        '
        'txtDeviceNum
        '
        Me.txtDeviceNum.Location = New System.Drawing.Point(96, 24)
        Me.txtDeviceNum.Name = "txtDeviceNum"
        Me.txtDeviceNum.Size = New System.Drawing.Size(56, 20)
        Me.txtDeviceNum.TabIndex = 3
        Me.txtDeviceNum.Text = "-1"
        Me.ToolTip1.SetToolTip(Me.txtDeviceNum, "Device Number")
        '
        'txtDeviceName
        '
        Me.txtDeviceName.Location = New System.Drawing.Point(96, 48)
        Me.txtDeviceName.Name = "txtDeviceName"
        Me.txtDeviceName.ReadOnly = True
        Me.txtDeviceName.Size = New System.Drawing.Size(256, 20)
        Me.txtDeviceName.TabIndex = 2
        Me.txtDeviceName.Text = "No Device!"
        Me.ToolTip1.SetToolTip(Me.txtDeviceName, "Device name")
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(16, 48)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(80, 16)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "Device Name :"
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(16, 24)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(64, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Device No. :"
        '
        'GroupBox2
        '
        Me.GroupBox2.Controls.Add(Me.Label11)
        Me.GroupBox2.Controls.Add(Me.Label6)
        Me.GroupBox2.Controls.Add(Me.Label5)
        Me.GroupBox2.Controls.Add(Me.Label4)
        Me.GroupBox2.Controls.Add(Me.Label3)
        Me.GroupBox2.Controls.Add(Me.txtScanTime)
        Me.GroupBox2.Controls.Add(Me.cmbGateMode)
        Me.GroupBox2.Controls.Add(Me.cmbChannel)
        Me.GroupBox2.Location = New System.Drawing.Point(16, 96)
        Me.GroupBox2.Name = "GroupBox2"
        Me.GroupBox2.Size = New System.Drawing.Size(256, 128)
        Me.GroupBox2.TabIndex = 2
        Me.GroupBox2.TabStop = False
        Me.GroupBox2.Text = "Property Settings:"
        '
        'Label11
        '
        Me.Label11.Location = New System.Drawing.Point(152, 67)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(96, 16)
        Me.Label11.TabIndex = 11
        Me.Label11.Text = "(only for PCL830)"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(163, 99)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(24, 16)
        Me.Label6.TabIndex = 6
        Me.Label6.Text = "ms"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(8, 96)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(64, 16)
        Me.Label5.TabIndex = 5
        Me.Label5.Text = "Scan Time: "
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(8, 68)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(64, 16)
        Me.Label4.TabIndex = 4
        Me.Label4.Text = "Gate Mode:"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(8, 40)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(64, 16)
        Me.Label3.TabIndex = 3
        Me.Label3.Text = "Channel:"
        '
        'txtScanTime
        '
        Me.txtScanTime.Location = New System.Drawing.Point(73, 96)
        Me.txtScanTime.Name = "txtScanTime"
        Me.txtScanTime.Size = New System.Drawing.Size(80, 20)
        Me.txtScanTime.TabIndex = 2
        Me.txtScanTime.Text = "200"
        '
        'cmbGateMode
        '
        Me.cmbGateMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbGateMode.Items.AddRange(New Object() {"no gating", "high level", "low level", "rising edge", "falling edge"})
        Me.cmbGateMode.Location = New System.Drawing.Point(73, 64)
        Me.cmbGateMode.Name = "cmbGateMode"
        Me.cmbGateMode.Size = New System.Drawing.Size(80, 21)
        Me.cmbGateMode.TabIndex = 1
        '
        'cmbChannel
        '
        Me.cmbChannel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbChannel.Location = New System.Drawing.Point(73, 32)
        Me.cmbChannel.Name = "cmbChannel"
        Me.cmbChannel.Size = New System.Drawing.Size(80, 21)
        Me.cmbChannel.TabIndex = 0
        '
        'GroupBox3
        '
        Me.GroupBox3.Controls.Add(Me.Label8)
        Me.GroupBox3.Controls.Add(Me.Label7)
        Me.GroupBox3.Controls.Add(Me.txtError)
        Me.GroupBox3.Controls.Add(Me.txtCounter)
        Me.GroupBox3.Controls.Add(Me.cmdCounterStop)
        Me.GroupBox3.Controls.Add(Me.cmdCounterStart)
        Me.GroupBox3.Location = New System.Drawing.Point(280, 96)
        Me.GroupBox3.Name = "GroupBox3"
        Me.GroupBox3.Size = New System.Drawing.Size(192, 128)
        Me.GroupBox3.TabIndex = 3
        Me.GroupBox3.TabStop = False
        Me.GroupBox3.Text = "Counter Read:"
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(8, 96)

⌨️ 快捷键说明

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