📄 frmmain.frm
字号:
VERSION 5.00
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "Dipattn"
ClientHeight = 4710
ClientLeft = 1665
ClientTop = 1725
ClientWidth = 7845
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4710
ScaleWidth = 7845
StartUpPosition = 2 'CenterScreen
Begin VB.Timer EventTimer
Enabled = 0 'False
Interval = 1
Left = 6480
Top = 2520
End
Begin VB.Timer ScanTimer
Enabled = 0 'False
Interval = 1000
Left = 5625
Top = 2520
End
Begin VB.Frame frmChannel
Caption = "P&ortl"
Height = 1260
Left = 120
TabIndex = 11
Top = 3195
Width = 5025
Begin VB.CommandButton cmdStopScan
Caption = "St&op Scan I/O"
Enabled = 0 'False
Height = 375
Left = 3180
TabIndex = 31
Top = 735
Width = 1620
End
Begin VB.CommandButton cmdStartScan
Caption = "S&tart Scan I/O"
Height = 375
Left = 3180
TabIndex = 30
Top = 255
Width = 1620
End
Begin VB.TextBox txtScanTime
Height = 315
Left = 1230
TabIndex = 28
Text = "1000"
Top = 780
Width = 1095
End
Begin VB.TextBox txtChannelNo
Height = 315
Left = 225
TabIndex = 12
Text = "0"
Top = 270
Width = 630
End
Begin VB.Label Label1
Caption = "Scan Time : mS"
Height = 255
Left = 255
TabIndex = 29
Top = 840
Width = 2460
End
Begin VB.Label labValue
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Height = 315
Left = 1710
TabIndex = 14
Top = 270
Width = 1035
End
Begin VB.Label Label2
Caption = "Value :"
Height = 210
Left = 1080
TabIndex = 13
Top = 322
Width = 555
End
End
Begin VB.CommandButton cmdStop
Caption = "St&op"
Enabled = 0 'False
Height = 375
Left = 5520
TabIndex = 10
Top = 1935
Width = 1095
End
Begin VB.CommandButton cmdStart
Caption = "S&tart"
Height = 375
Left = 5520
TabIndex = 9
Top = 1320
Width = 1095
End
Begin VB.Frame Frame2
Caption = "&Event Type"
Height = 2145
Left = 120
TabIndex = 4
Top = 945
Width = 4935
Begin VB.CheckBox chkStatus
Caption = "&Status Change :"
Height = 255
Left = 240
TabIndex = 8
Top = 1740
Width = 1455
End
Begin VB.CheckBox chkCounter
Caption = "&Counter Match Channel :"
Height = 255
Left = 240
TabIndex = 7
Top = 1072
Width = 2250
End
Begin VB.CheckBox chkPattern
Caption = "&Pattern Match Count :"
Height = 255
Left = 240
TabIndex = 6
Top = 701
Width = 1890
End
Begin VB.CheckBox chkFilter
Caption = "&Filter"
Height = 255
Left = 240
TabIndex = 5
Top = 330
Width = 855
End
Begin VB.Label labOverflowCount
BorderStyle = 1 'Fixed Single
Height = 285
Left = 3915
TabIndex = 27
Top = 1391
Width = 885
End
Begin VB.Label Label10
Caption = "Count :"
Height = 240
Left = 3330
TabIndex = 26
Top = 1413
Width = 510
End
Begin VB.Label labMatchCount
BorderStyle = 1 'Fixed Single
Height = 285
Left = 3915
TabIndex = 25
Top = 1057
Width = 885
End
Begin VB.Label Label8
Caption = "Count :"
Height = 240
Left = 3330
TabIndex = 24
Top = 1079
Width = 510
End
Begin VB.Label labOverflowChannel
BorderStyle = 1 'Fixed Single
Height = 285
Left = 2535
TabIndex = 23
Top = 1391
Width = 660
End
Begin VB.Label labMatchChannel
BorderStyle = 1 'Fixed Single
Height = 285
Left = 2535
TabIndex = 22
Top = 1057
Width = 660
End
Begin VB.Label Label4
Caption = "Counter Overflow Channel :"
Height = 180
Left = 510
TabIndex = 21
Top = 1443
Width = 1950
End
Begin VB.Label labStatusCount
BorderStyle = 1 'Fixed Single
Height = 285
Left = 4230
TabIndex = 20
Top = 1725
Width = 645
End
Begin VB.Label Label5
Caption = "Count :"
Height = 195
Left = 3645
TabIndex = 19
Top = 1770
Width = 510
End
Begin VB.Label labChannelNo
BorderStyle = 1 'Fixed Single
Height = 285
Left = 3030
TabIndex = 18
Top = 1725
Width = 495
End
Begin VB.Label Label3
Caption = "Ch# :"
Height = 210
Left = 2580
TabIndex = 17
Top = 1762
Width = 420
End
Begin VB.Label labStatus
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Height = 285
Left = 1725
TabIndex = 16
Top = 1725
Width = 750
End
Begin VB.Label labPatternMatchCount
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Height = 285
Left = 2115
TabIndex = 15
Top = 686
Width = 1215
End
End
Begin VB.CommandButton cmdExit
Caption = "E&xit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5280
TabIndex = 3
Top = 3330
Width = 1575
End
Begin VB.Frame Frame1
Caption = "Device Name:"
Height = 735
Left = 120
TabIndex = 0
Top = 120
Width = 6855
Begin VB.CommandButton btnSelectDevice
Caption = "Select &Device"
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 = 5160
TabIndex = 2
Top = 240
Width = 1575
End
Begin VB.Label labDeviceName
BorderStyle = 1 'Fixed Single
Caption = "Device Name"
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 = 120
TabIndex = 1
Top = 240
Width = 4935
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'test descrption:
'Computer : Pentium II 266Hz
'Input Source : function generator
'this program can run PCI-1760 safely under 500Hz DI input in Windows NT
'but due to OS windows 95, this program only can run PCi-1760 safely under
'200 Hz DI input
'So if you want more high speed performance please use VC++ language to write
'you project or run this program under Windows NT OS
'Note:
'1.project property in compile item you must select compile to native code
'2.If you use VB We do not support Counter Overflow function and counter match only
'support to 32767
'
Public DeviceNum As Long
Public DeviceHandle As Long
Public ErrorNum As Long
Public bPattern As Boolean
Public bStatus As Boolean
Public bFilter As Boolean
Public bCounter As Boolean
Public bRun As Boolean
Public PatternValue As Integer
Public PatternEnableMask As Integer
Public RisingEdge As Integer
Public FallingEdge As Integer
Public StatusEnableMask As Integer
Dim HiValue(0 To 7) As Long
Dim LoValue(0 To 7) As Long
Public FilterEnableMask As Integer
Public Direction As Integer
Public TrigEdge As Integer
Public MatchEnableMask As Integer
Public OverflowEnableMask As Integer
Public CounterEnableMask As Integer
Dim PresetValue(0 To 7) As Integer
Dim MatchValue(0 To 7) As Integer
Public RisingEventCount As Long
Public FallingEventCount As Long
Public PatternEventCount As Long
Public CountMatchEventCount As Long
Public CountOverflowEventCount As Long
Dim ptFilter As PT_DIFilter
Dim ptDIPattern As PT_DIPattern
Dim ptDICounter As PT_DICounter
Dim ptDIStatus As PT_DIStatus
Dim ptFDITransfer As PT_FDITransfer
Dim ptDioReadPortByte As PT_DioReadPortByte
Dim fCounter As New frmCounter
Dim fFilter As New frmFilter
Dim fPattern As New frmPattern
Dim fStatus As New frmStatus
Dim EventThreadHandle As Long
Dim EventThreadId As Long
Dim ExitCode As Long
Private Sub btnSelectDevice_Click()
Dim Description As String
Description = String(80, vbNullChar)
ErrorNum = DRV_SelectDevice(hWnd, False, DeviceNum, Description)
labDeviceName.Caption = Description
End Sub
Private Sub chkCounter_Click()
Dim i As Integer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -