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

📄 frmrun.frm

📁 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmRun 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Pulse Output Demo"
   ClientHeight    =   2940
   ClientLeft      =   3705
   ClientTop       =   1425
   ClientWidth     =   3690
   BeginProperty Font 
      Name            =   "MS Sans Serif"
      Size            =   8.25
      Charset         =   0
      Weight          =   700
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   ForeColor       =   &H80000008&
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   2940
   ScaleWidth      =   3690
   Begin VB.Frame frmCount 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "Gate Period Value"
      ForeColor       =   &H80000008&
      Height          =   855
      Left            =   240
      TabIndex        =   5
      Top             =   120
      Width           =   3135
      Begin VB.Label labCount 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         Caption         =   "0"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   24
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   495
         Left            =   480
         TabIndex        =   6
         Top             =   240
         Width           =   2175
      End
   End
   Begin VB.Frame frmGatePeriod 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "Gate Period"
      ForeColor       =   &H80000008&
      Height          =   1095
      Left            =   240
      TabIndex        =   4
      Top             =   1080
      Width           =   3255
      Begin VB.HScrollBar hscrlFreq 
         Height          =   375
         LargeChange     =   10
         Left            =   120
         Max             =   1000
         Min             =   1
         TabIndex        =   3
         Top             =   360
         Value           =   1
         Width           =   3015
      End
      Begin VB.Label labFreqHigh 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         Caption         =   "1000 ms"
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   2280
         TabIndex        =   1
         Top             =   720
         Width           =   855
      End
      Begin VB.Label labFrequencyLow 
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         Caption         =   "1"
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   120
         TabIndex        =   2
         Top             =   720
         Width           =   855
      End
   End
   Begin VB.CommandButton cmdExit 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      Caption         =   "E&xit"
      Height          =   495
      Left            =   1080
      TabIndex        =   0
      Top             =   2280
      Width           =   1455
   End
End
Attribute VB_Name = "frmRun"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub cmdExit_Click()
    ' Reset the output pulse
    ErrCde = DRV_CounterReset(DeviceHandle, ptCounterPulseStart.counter)
    If (ErrCde <> 0) Then
        DRV_GetErrorMessage ErrCde, szErrMsg
        Response = MsgBox(szErrMsg, vbOKOnly, "Error!!")
        Exit Sub
    End If
    frmRun.Hide
    frmDevSel.Show
    frmDevSel.cmdExit.SetFocus
End Sub



Private Sub Form_Activate()
    hscrlFreq.value = ptCounterPulseStart.Period * 1000
    hscrlFreq_Change
End Sub

Private Sub Form_Load()
    hscrlFreq.value = ptCounterPulseStart.Period * 1000
    hscrlFreq_Change
End Sub

Private Sub Form_Unload(Cancel As Integer)
    frmDevSel.Show
End Sub


Private Sub hscrlFreq_Change()
    ' Reset the output pulse
    ErrCde = DRV_CounterReset(DeviceHandle, ptCounterPulseStart.counter)
    If (ErrCde <> 0) Then
        DRV_GetErrorMessage ErrCde, szErrMsg
        Response = MsgBox(szErrMsg, vbOKOnly, "Error!!")
        Exit Sub
    End If
    
    ' Change the pulse period
    ptCounterPulseStart.Period = hscrlFreq.value / 1000
    ptCounterPulseStart.UpCycle = ptCounterPulseStart.Period / 2
    ' Change the pulse period value
    labCount.Caption = hscrlFreq.value
    ErrCde = DRV_CounterPulseStart(DeviceHandle, ptCounterPulseStart)
    If (ErrCde <> 0) Then
        DRV_GetErrorMessage ErrCde, szErrMsg
        Response = MsgBox(szErrMsg, vbOKOnly, "Error!!")
        Exit Sub
    End If
End Sub





⌨️ 快捷键说明

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