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

📄 doform.vb

📁 使用研华DAQ和VB.net实现研华数据采集卡的多种功能.包括数据输入输出。内含多个源码
💻 VB
📖 第 1 页 / 共 4 页
字号:
Public Class frmDO
    Inherits System.Windows.Forms.Form
    Dim bOpen As Boolean
    Dim isInitializing As Boolean
    Dim MaskBits As New BitArray(8)
    Dim StatusBits As New BitArray(8)
    Dim cmdChannelArray(8) As Button
    Dim chkMaskArray(8) As CheckBox




#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
        cmdChannelArray(0) = cmdChannel0
        cmdChannelArray(1) = cmdChannel1
        cmdChannelArray(2) = cmdChannel2
        cmdChannelArray(3) = cmdChannel3
        cmdChannelArray(4) = cmdChannel4
        cmdChannelArray(5) = cmdChannel5
        cmdChannelArray(6) = cmdChannel6
        cmdChannelArray(7) = cmdChannel7

        chkMaskArray(0) = ChkMask0
        chkMaskArray(1) = ChkMask1
        chkMaskArray(2) = ChkMask2
        chkMaskArray(3) = ChkMask3
        chkMaskArray(4) = ChkMask4
        chkMaskArray(5) = ChkMask5
        chkMaskArray(6) = ChkMask6
        chkMaskArray(7) = ChkMask7


        '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.
    Public WithEvents Frame1 As System.Windows.Forms.GroupBox
    Public WithEvents txtDeviceNum As System.Windows.Forms.TextBox
    Public WithEvents txtDeviceName As System.Windows.Forms.TextBox
    Public WithEvents cmdSelectDevice As System.Windows.Forms.Button
    Public WithEvents Label1 As System.Windows.Forms.Label
    Public WithEvents Label2 As System.Windows.Forms.Label
    Public WithEvents cmdExit As System.Windows.Forms.Button
    Public WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Friend WithEvents DAQDO1 As AxDAQDOLib.AxDAQDO
    Public WithEvents cmdByteOut As System.Windows.Forms.Button
    Public WithEvents cmdReadBack As System.Windows.Forms.Button
    Public WithEvents framChannel As System.Windows.Forms.GroupBox
    Friend WithEvents ChkMask1 As System.Windows.Forms.CheckBox
    Friend WithEvents ChkMask7 As System.Windows.Forms.CheckBox
    Friend WithEvents ChkMask6 As System.Windows.Forms.CheckBox
    Friend WithEvents ChkMask5 As System.Windows.Forms.CheckBox
    Friend WithEvents ChkMask4 As System.Windows.Forms.CheckBox
    Friend WithEvents ChkMask3 As System.Windows.Forms.CheckBox
    Friend WithEvents ChkMask2 As System.Windows.Forms.CheckBox
    Friend WithEvents ChkMask0 As System.Windows.Forms.CheckBox
    Public WithEvents Label5 As System.Windows.Forms.Label
    Public WithEvents Label4 As System.Windows.Forms.Label
    Public WithEvents Label3 As System.Windows.Forms.Label
    Public WithEvents _labBit_7 As System.Windows.Forms.Label
    Public WithEvents _labBit_6 As System.Windows.Forms.Label
    Public WithEvents _labBit_5 As System.Windows.Forms.Label
    Public WithEvents _labBit_4 As System.Windows.Forms.Label
    Public WithEvents _labBit_3 As System.Windows.Forms.Label
    Public WithEvents _labBit_2 As System.Windows.Forms.Label
    Public WithEvents _labBit_1 As System.Windows.Forms.Label
    Public WithEvents _labBit_0 As System.Windows.Forms.Label
    Public WithEvents cmbPort As System.Windows.Forms.ComboBox
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Public WithEvents txtMask As System.Windows.Forms.TextBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Public WithEvents cmdChannel0 As System.Windows.Forms.Button
    Public WithEvents cmdChannel7 As System.Windows.Forms.Button
    Public WithEvents cmdChannel6 As System.Windows.Forms.Button
    Public WithEvents cmdChannel5 As System.Windows.Forms.Button
    Public WithEvents cmdChannel4 As System.Windows.Forms.Button
    Public WithEvents cmdChannel3 As System.Windows.Forms.Button
    Public WithEvents cmdChannel2 As System.Windows.Forms.Button
    Public WithEvents cmdChannel1 As System.Windows.Forms.Button
    Public WithEvents txtOutByte As System.Windows.Forms.TextBox
    Public WithEvents txtReadBack As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmDO))
        Me.DAQDO1 = New AxDAQDOLib.AxDAQDO
        Me.Frame1 = New System.Windows.Forms.GroupBox
        Me.txtDeviceNum = New System.Windows.Forms.TextBox
        Me.txtDeviceName = New System.Windows.Forms.TextBox
        Me.cmdSelectDevice = New System.Windows.Forms.Button
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.cmdExit = New System.Windows.Forms.Button
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.cmdByteOut = New System.Windows.Forms.Button
        Me.cmdReadBack = New System.Windows.Forms.Button
        Me.framChannel = New System.Windows.Forms.GroupBox
        Me.ChkMask1 = New System.Windows.Forms.CheckBox
        Me.ChkMask7 = New System.Windows.Forms.CheckBox
        Me.ChkMask6 = New System.Windows.Forms.CheckBox
        Me.ChkMask5 = New System.Windows.Forms.CheckBox
        Me.ChkMask4 = New System.Windows.Forms.CheckBox
        Me.ChkMask3 = New System.Windows.Forms.CheckBox
        Me.ChkMask2 = New System.Windows.Forms.CheckBox
        Me.ChkMask0 = New System.Windows.Forms.CheckBox
        Me.cmdChannel0 = New System.Windows.Forms.Button
        Me.cmdChannel7 = New System.Windows.Forms.Button
        Me.cmdChannel6 = New System.Windows.Forms.Button
        Me.cmdChannel5 = New System.Windows.Forms.Button
        Me.cmdChannel4 = New System.Windows.Forms.Button
        Me.cmdChannel3 = New System.Windows.Forms.Button
        Me.cmdChannel2 = New System.Windows.Forms.Button
        Me.cmdChannel1 = New System.Windows.Forms.Button
        Me.Label5 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me._labBit_7 = New System.Windows.Forms.Label
        Me._labBit_6 = New System.Windows.Forms.Label
        Me._labBit_5 = New System.Windows.Forms.Label
        Me._labBit_4 = New System.Windows.Forms.Label
        Me._labBit_3 = New System.Windows.Forms.Label
        Me._labBit_2 = New System.Windows.Forms.Label
        Me._labBit_1 = New System.Windows.Forms.Label
        Me._labBit_0 = New System.Windows.Forms.Label
        Me.cmbPort = New System.Windows.Forms.ComboBox
        Me.Label6 = New System.Windows.Forms.Label
        Me.txtMask = New System.Windows.Forms.TextBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.txtOutByte = New System.Windows.Forms.TextBox
        Me.txtReadBack = New System.Windows.Forms.TextBox
        CType(Me.DAQDO1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Frame1.SuspendLayout()
        Me.framChannel.SuspendLayout()
        Me.SuspendLayout()
        '
        'DAQDO1
        '
        Me.DAQDO1.Enabled = True
        Me.DAQDO1.Location = New System.Drawing.Point(440, 16)
        Me.DAQDO1.Name = "DAQDO1"
        Me.DAQDO1.OcxState = CType(resources.GetObject("DAQDO1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.DAQDO1.Size = New System.Drawing.Size(33, 33)
        Me.DAQDO1.TabIndex = 0
        '
        'Frame1
        '
        Me.Frame1.BackColor = System.Drawing.SystemColors.Control
        Me.Frame1.Controls.Add(Me.txtDeviceNum)
        Me.Frame1.Controls.Add(Me.txtDeviceName)
        Me.Frame1.Controls.Add(Me.cmdSelectDevice)
        Me.Frame1.Controls.Add(Me.Label1)
        Me.Frame1.Controls.Add(Me.Label2)
        Me.Frame1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Frame1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Frame1.Location = New System.Drawing.Point(8, 8)
        Me.Frame1.Name = "Frame1"
        Me.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Frame1.Size = New System.Drawing.Size(385, 89)
        Me.Frame1.TabIndex = 41
        Me.Frame1.TabStop = False
        Me.Frame1.Text = "Select Device :"
        '
        'txtDeviceNum
        '
        Me.txtDeviceNum.AcceptsReturn = True
        Me.txtDeviceNum.AutoSize = False
        Me.txtDeviceNum.BackColor = System.Drawing.SystemColors.Window
        Me.txtDeviceNum.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtDeviceNum.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtDeviceNum.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtDeviceNum.Location = New System.Drawing.Point(80, 24)
        Me.txtDeviceNum.MaxLength = 0
        Me.txtDeviceNum.Name = "txtDeviceNum"
        Me.txtDeviceNum.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtDeviceNum.Size = New System.Drawing.Size(65, 20)
        Me.txtDeviceNum.TabIndex = 3
        Me.txtDeviceNum.Text = "-1"
        Me.ToolTip1.SetToolTip(Me.txtDeviceNum, "Device Number")
        '
        'txtDeviceName
        '
        Me.txtDeviceName.AcceptsReturn = True
        Me.txtDeviceName.AutoSize = False
        Me.txtDeviceName.BackColor = System.Drawing.SystemColors.Window
        Me.txtDeviceName.Cursor = System.Windows.Forms.Cursors.IBeam
        Me.txtDeviceName.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtDeviceName.ForeColor = System.Drawing.SystemColors.WindowText
        Me.txtDeviceName.Location = New System.Drawing.Point(80, 56)
        Me.txtDeviceName.MaxLength = 0
        Me.txtDeviceName.Name = "txtDeviceName"
        Me.txtDeviceName.ReadOnly = True
        Me.txtDeviceName.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.txtDeviceName.Size = New System.Drawing.Size(289, 19)
        Me.txtDeviceName.TabIndex = 2
        Me.txtDeviceName.Text = "Advantech"
        Me.ToolTip1.SetToolTip(Me.txtDeviceName, "Device Name")
        '
        'cmdSelectDevice
        '
        Me.cmdSelectDevice.BackColor = System.Drawing.SystemColors.Control
        Me.cmdSelectDevice.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdSelectDevice.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdSelectDevice.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdSelectDevice.Location = New System.Drawing.Point(280, 24)
        Me.cmdSelectDevice.Name = "cmdSelectDevice"
        Me.cmdSelectDevice.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdSelectDevice.Size = New System.Drawing.Size(89, 25)
        Me.cmdSelectDevice.TabIndex = 1
        Me.cmdSelectDevice.Text = "&Select Device"
        Me.ToolTip1.SetToolTip(Me.cmdSelectDevice, "Selecting device to operation")
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.BackColor = System.Drawing.SystemColors.Control
        Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label1.Location = New System.Drawing.Point(8, 24)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label1.Size = New System.Drawing.Size(64, 16)
        Me.Label1.TabIndex = 5
        Me.Label1.Text = "Device No. :"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.BackColor = System.Drawing.SystemColors.Control
        Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
        Me.Label2.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.ForeColor = System.Drawing.SystemColors.ControlText
        Me.Label2.Location = New System.Drawing.Point(8, 56)
        Me.Label2.Name = "Label2"
        Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Label2.Size = New System.Drawing.Size(76, 16)
        Me.Label2.TabIndex = 4
        Me.Label2.Text = "Device Name :"
        '
        'cmdExit
        '
        Me.cmdExit.BackColor = System.Drawing.SystemColors.Control
        Me.cmdExit.Cursor = System.Windows.Forms.Cursors.Default
        Me.cmdExit.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdExit.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdExit.Location = New System.Drawing.Point(416, 64)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.cmdExit.Size = New System.Drawing.Size(81, 25)
        Me.cmdExit.TabIndex = 44
        Me.cmdExit.Text = "&Close"
        Me.ToolTip1.SetToolTip(Me.cmdExit, "Close application")

⌨️ 快捷键说明

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