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

📄 frmdi.frm

📁 使用研华DAQ实现研华数据采集卡的多种功能。包括数据输入输出等。内含多个源码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Caption         =   "Bit5"
         Height          =   255
         Index           =   4
         Left            =   3720
         TabIndex        =   30
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label7 
         Caption         =   "Bit6"
         Height          =   255
         Index           =   3
         Left            =   4320
         TabIndex        =   29
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label7 
         Caption         =   "Bit7"
         Height          =   255
         Index           =   2
         Left            =   4920
         TabIndex        =   28
         Top             =   720
         Width           =   375
      End
      Begin VB.Label Label7 
         Caption         =   "Bit1"
         Height          =   252
         Index           =   1
         Left            =   1320
         TabIndex        =   27
         Top             =   720
         Width           =   252
      End
      Begin VB.Label Label7 
         Caption         =   "Bit0"
         Height          =   255
         Index           =   0
         Left            =   720
         TabIndex        =   26
         Top             =   720
         Width           =   375
      End
   End
   Begin VB.Frame Frame5 
      Caption         =   "ByteScan or BitScan"
      Height          =   2412
      Left            =   3840
      TabIndex        =   17
      Top             =   1440
      Width           =   2552
      Begin VB.CommandButton cmdEventScan 
         Caption         =   "Event Scan"
         Height          =   375
         Left            =   220
         TabIndex        =   76
         Top             =   1800
         Width           =   975
      End
      Begin VB.CommandButton cmdEventStop 
         Caption         =   "Event Stop"
         Enabled         =   0   'False
         Height          =   375
         Left            =   1400
         TabIndex        =   75
         Top             =   1800
         Width           =   972
      End
      Begin VB.TextBox txtScanTime 
         Height          =   285
         Left            =   1200
         TabIndex        =   23
         Top             =   360
         Width           =   735
      End
      Begin VB.CommandButton cmdBitStop 
         Caption         =   "Bit Stop"
         Enabled         =   0   'False
         Height          =   375
         Left            =   1400
         TabIndex        =   21
         Top             =   1320
         Width           =   972
      End
      Begin VB.CommandButton cmdBitScan 
         Caption         =   "Bit Scan"
         Height          =   375
         Left            =   220
         TabIndex        =   20
         Top             =   1320
         Width           =   975
      End
      Begin VB.CommandButton cmdByteStop 
         Caption         =   "Byte Stop"
         Enabled         =   0   'False
         Height          =   375
         Left            =   1400
         TabIndex        =   19
         Top             =   840
         Width           =   972
      End
      Begin VB.CommandButton cmdByteScan 
         Caption         =   "Byte Scan"
         Height          =   375
         Left            =   220
         TabIndex        =   18
         Top             =   840
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "ms"
         Height          =   252
         Left            =   2040
         TabIndex        =   24
         Top             =   360
         Width           =   252
      End
      Begin VB.Label Label5 
         Caption         =   "Scan Time :"
         Height          =   252
         Left            =   240
         TabIndex        =   22
         Top             =   360
         Width           =   852
      End
   End
   Begin VB.Frame Frame4 
      Caption         =   "Single Read"
      Height          =   1335
      Left            =   2280
      TabIndex        =   13
      Top             =   1440
      Width           =   1455
      Begin VB.CommandButton cmdBitRead 
         Caption         =   "Bit Read"
         Height          =   375
         Left            =   240
         TabIndex        =   15
         Top             =   840
         Width           =   975
      End
      Begin VB.CommandButton cmdByteRead 
         Caption         =   "Byte Read"
         Height          =   375
         Left            =   240
         TabIndex        =   14
         Top             =   360
         Width           =   975
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "Return Data"
      Height          =   975
      Left            =   120
      TabIndex        =   10
      Top             =   2880
      Width           =   3612
      Begin VB.TextBox txtMatchNum 
         Enabled         =   0   'False
         Height          =   288
         Left            =   2520
         TabIndex        =   46
         Top             =   600
         Width           =   972
      End
      Begin VB.TextBox txtEventNum 
         Enabled         =   0   'False
         Height          =   288
         Left            =   2520
         TabIndex        =   45
         Top             =   240
         Width           =   972
      End
      Begin VB.TextBox Text1 
         Height          =   288
         Left            =   120
         TabIndex        =   11
         Top             =   360
         Width           =   972
      End
      Begin VB.Label Label8 
         Caption         =   "Event Count :"
         Height          =   252
         Left            =   1320
         TabIndex        =   48
         Top             =   240
         Width           =   972
      End
      Begin VB.Label Label9 
         Caption         =   "Match Count :"
         Height          =   252
         Left            =   1320
         TabIndex        =   47
         Top             =   600
         Width           =   1092
      End
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "Close"
      Height          =   372
      Left            =   4920
      TabIndex        =   9
      Top             =   840
      Width           =   1335
   End
   Begin VB.Frame Frame2 
      Caption         =   "Port , Bit Settings"
      Height          =   1335
      Left            =   120
      TabIndex        =   6
      Top             =   1440
      Width           =   2052
      Begin VB.ComboBox cmbBit 
         Height          =   288
         ItemData        =   "frmDI.frx":0000
         Left            =   840
         List            =   "frmDI.frx":001C
         TabIndex        =   16
         Top             =   840
         Width           =   1092
      End
      Begin VB.ComboBox cmbPort 
         Height          =   288
         ItemData        =   "frmDI.frx":0038
         Left            =   840
         List            =   "frmDI.frx":0048
         TabIndex        =   12
         Top             =   360
         Width           =   1092
      End
      Begin VB.Label Label4 
         Caption         =   "Bit :"
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   840
         Width           =   495
      End
      Begin VB.Label Label3 
         Caption         =   "Port :"
         Height          =   255
         Left            =   240
         TabIndex        =   7
         Top             =   360
         Width           =   495
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "Select Device :"
      Height          =   1208
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   4452
      Begin VB.TextBox txtDeviceNum 
         Height          =   285
         Left            =   720
         TabIndex        =   3
         Text            =   "-100"
         ToolTipText     =   "Device Number"
         Top             =   360
         Width           =   855
      End
      Begin VB.TextBox txtDeviceName 
         Height          =   285
         Left            =   720
         TabIndex        =   2
         Text            =   "AdvanTech"
         ToolTipText     =   "Device Name"
         Top             =   720
         Width           =   3375
      End
      Begin VB.CommandButton cmdSelectDevice 
         Caption         =   "&Select Device"
         Default         =   -1  'True
         Height          =   372
         Left            =   2640
         TabIndex        =   1
         ToolTipText     =   "Selecting device to operation"
         Top             =   240
         Width           =   1455
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "No. :"
         Height          =   192
         Left            =   120
         TabIndex        =   5
         Top             =   408
         Width           =   324
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Name :"
         Height          =   192
         Left            =   120
         TabIndex        =   4
         Top             =   768
         Width           =   516
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim bRet As Boolean
Dim nTemp(10) As Integer


Dim glEventCount As Long
Dim glMatchCount As Long

Private Sub chkBit_Click(Index As Integer)
    CheckFilter (Index)
End Sub

Private Sub chkMatchEnabled_Click()
    DisplayPattern
End Sub

Private Sub cmbBit_Click()
   DAQDI1.Bit = cmbBit.ListIndex
End Sub

Private Sub cmbPort_Click()
   DAQDI1.Port = cmbPort.ListIndex
End Sub

Private Sub cmdBitRead_Click()
    bRet = DAQDI1.OpenDevice
    If bRet Then
      MsgBox DAQDI1.ErrorMessage, vbOKOnly
      Exit Sub
    End If
    DAQDI1.Port = cmbPort.ListIndex
    DAQDI1.Bit = cmbBit.ListIndex
    Text1.Text = DAQDI1.BitInput
    bRet = DAQDI1.CloseDevice
    If bRet Then
      MsgBox DAQDI1.ErrorMessage, vbOKOnly
      Exit Sub
    End If
End Sub

Private Sub cmdBitScan_Click()
    bRet = DAQDI1.OpenDevice
    If bRet Then
      MsgBox DAQDI1.ErrorMessage, vbOKOnly
      Exit Sub
    End If
    cmdSelectDevice.Enabled = False
    cmdBitScan.Enabled = False
    cmdByteScan.Enabled = False
    cmdEventScan.Enabled = False
    DAQDI1.Port = cmbPort.ListIndex
    DAQDI1.Bit = cmbBit.ListIndex
    
    bRet = DAQDI1.EnableBitScan(True)
    If bRet Then
      cmdBitScan.Enabled = True
      cmdByteScan.Enabled = True
      MsgBox DAQDI1.ErrorMessage, vbOKOnly
      Exit Sub
    End If
    
    cmdBitStop.Enabled = True
    cmdByteStop.Enabled = False
    cmdEventStop.Enabled = False
    cmdExit.Enabled = False
    
    
    
End Sub

Private Sub cmdBitStop_Click()
    'leon.jin add

    
    cmdBitStop.Enabled = False

⌨️ 快捷键说明

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