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

📄 jsform.frm

📁 基于数据采集卡的测试程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form JsForm 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "计数测试界面"
   ClientHeight    =   3090
   ClientLeft      =   3480
   ClientTop       =   2160
   ClientWidth     =   2655
   BeginProperty Font 
      Name            =   "System"
      Size            =   12
      Charset         =   134
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3090
   ScaleWidth      =   2655
   ShowInTaskbar   =   0   'False
   Begin VB.Timer JsTimer 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   0
      Top             =   2280
   End
   Begin VB.CommandButton Exit 
      Cancel          =   -1  'True
      Caption         =   "返    回"
      Default         =   -1  'True
      Height          =   495
      Left            =   360
      TabIndex        =   4
      Top             =   2520
      Width           =   1815
   End
   Begin VB.Frame Frame1 
      Caption         =   "计数显示区"
      Height          =   2175
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2415
      Begin VB.TextBox jsdata 
         Height          =   360
         Index           =   2
         Left            =   1080
         TabIndex        =   3
         Top             =   1680
         Width           =   1215
      End
      Begin VB.TextBox jsdata 
         Height          =   360
         Index           =   1
         Left            =   1080
         TabIndex        =   2
         Top             =   1065
         Width           =   1215
      End
      Begin VB.TextBox jsdata 
         Height          =   330
         Index           =   0
         Left            =   1080
         TabIndex        =   1
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label3 
         Caption         =   "计数器 3:"
         Height          =   240
         Left            =   120
         TabIndex        =   7
         Top             =   1680
         Width           =   960
      End
      Begin VB.Label Label2 
         Caption         =   "计数器 2:"
         Height          =   240
         Left            =   120
         TabIndex        =   6
         Top             =   1080
         Width           =   960
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "计数器 1:"
         Height          =   240
         Left            =   120
         TabIndex        =   5
         Top             =   480
         Width           =   960
      End
   End
End
Attribute VB_Name = "JsForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim oldjs(3) As Long
Private Sub Exit_Click()
If hplx <> 1 Then
hplx = pci7483close(hplx)
Unload JsForm
End If
End Sub
'计数测试初始化函数
Private Sub Form_Load()
 Dim sd(3) As Byte
 sd(0) = &H34
 sd(1) = &H74
 sd(2) = &HB4
 For i = 0 To 2
  jsdata(i) = 0
  oldjs(i) = 0
 Next i
 '设置计数器
    hplx = 0
    hplx = pci7483check(0, 0, False, 1)

 'Call pc7484_jsset(sd(0), Port, Delay)
  Call pci7483jsset(hplx, False, sd(0))
 '取计数器初始值
 'Call pc7484_js(oldjs(0), Port, Delay)
  Call pci7483js(hplx, False, oldjs(0))
 '允许计数定时器工作
 JsTimer.Enabled = True
End Sub
'计数定时器函数
Private Sub JsTimer_Timer()
 Dim njs(2) As Long
 '取新的计数器的值
 Call pci7483js(hplx, False, njs(0))
 For i = 0 To 2
 '计算出计数器的差值
  'jsdata(i) = njs(i)
  jsdata(i) = Abs(njs(i) - oldjs(i))
 Next i
End Sub

⌨️ 快捷键说明

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