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

📄 form1.frm

📁 工控硬件读写ISA多功能卡823的VB例子程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BackColor       =   &H00808000&
   Caption         =   "DLL and Configuration Demo"
   ClientHeight    =   2484
   ClientLeft      =   2436
   ClientTop       =   2736
   ClientWidth     =   6312
   LinkTopic       =   "Form1"
   ScaleHeight     =   2484
   ScaleWidth      =   6312
   Begin VB.CommandButton Command2 
      Caption         =   "Exit"
      Height          =   372
      Left            =   4560
      TabIndex        =   15
      Top             =   1920
      Width           =   1572
   End
   Begin VB.CommandButton Command1 
      Caption         =   "T E S T"
      Height          =   372
      Left            =   4560
      TabIndex        =   11
      Top             =   1440
      Width           =   1572
   End
   Begin VB.TextBox Text6 
      BackColor       =   &H0080FFFF&
      Enabled         =   0   'False
      Height          =   288
      Left            =   5160
      TabIndex        =   10
      Top             =   360
      Width           =   972
   End
   Begin VB.TextBox Text7 
      BackColor       =   &H0080FFFF&
      Enabled         =   0   'False
      Height          =   288
      Left            =   5160
      TabIndex        =   9
      Top             =   720
      Width           =   972
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H00FFFFC0&
      Caption         =   "Function Test"
      Height          =   2052
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   3492
      Begin VB.TextBox a 
         BackColor       =   &H0000FF00&
         Height          =   288
         Left            =   2040
         TabIndex        =   4
         Text            =   "5"
         Top             =   360
         Width           =   852
      End
      Begin VB.TextBox b 
         BackColor       =   &H0000FF00&
         Height          =   288
         Left            =   2040
         TabIndex        =   3
         Text            =   "2"
         Top             =   720
         Width           =   852
      End
      Begin VB.TextBox ShortSub 
         BackColor       =   &H0080FFFF&
         Enabled         =   0   'False
         Height          =   288
         Left            =   2040
         TabIndex        =   2
         Top             =   1080
         Width           =   852
      End
      Begin VB.TextBox FloatSub 
         BackColor       =   &H0080FFFF&
         Enabled         =   0   'False
         Height          =   288
         Left            =   2040
         TabIndex        =   1
         Top             =   1440
         Width           =   852
      End
      Begin VB.Label Label13 
         BackColor       =   &H00FFFFC0&
         Caption         =   "(test a-b=?)"
         ForeColor       =   &H00FF0000&
         Height          =   252
         Left            =   360
         TabIndex        =   14
         Top             =   600
         Width           =   972
      End
      Begin VB.Label Label8 
         BackColor       =   &H00FFFFC0&
         Caption         =   "Short_Sub_2(a , b) "
         ForeColor       =   &H00FF0000&
         Height          =   252
         Left            =   240
         TabIndex        =   8
         Top             =   1080
         Width           =   1692
      End
      Begin VB.Label Label9 
         BackColor       =   &H00FFFFC0&
         Caption         =   "a"
         ForeColor       =   &H00FF0000&
         Height          =   252
         Left            =   1560
         TabIndex        =   7
         Top             =   360
         Width           =   252
      End
      Begin VB.Label Label10 
         BackColor       =   &H00FFFFC0&
         Caption         =   "b"
         ForeColor       =   &H00FF0000&
         Height          =   252
         Left            =   1560
         TabIndex        =   6
         Top             =   720
         Width           =   252
      End
      Begin VB.Label Label11 
         BackColor       =   &H00FFFFC0&
         Caption         =   "Float_Sub_2(a , b)"
         ForeColor       =   &H00FF0000&
         Height          =   252
         Left            =   240
         TabIndex        =   5
         Top             =   1440
         Width           =   1692
      End
   End
   Begin VB.Label Label6 
      BackColor       =   &H00808000&
      Caption         =   "DLL Ver[Hex]:"
      ForeColor       =   &H00FFFFFF&
      Height          =   252
      Left            =   3960
      TabIndex        =   13
      Top             =   360
      Width           =   1092
   End
   Begin VB.Label Label7 
      BackColor       =   &H00808000&
      Caption         =   "Driver Ver[Hex]:"
      ForeColor       =   &H00FFFFFF&
      Height          =   252
      Left            =   3960
      TabIndex        =   12
      Top             =   720
      Width           =   1692
   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 wTotalBoards As Integer
Dim dwDaNum, dwAdClk, wRtn As Integer


Private Sub Command1_Click()
    Dim nVal, wRetVal As Integer
    Dim rtn

    'Getting the DLL version
    Text6.Text = Hex(A823_Get_DLL_Version())
    
    'Getting the Driver version
    'Device driver must open before GetDriverVersion function calling
    wRetVal = A823_GetDriverVersion(nVal)
    Text7.Text = Hex(nVal)
    
    'Call a function to test if exact calling DLL
    ShortSub.Text = A823_SHORT_SUB_2(Int(Val(a.Text)), Int(Val(b.Text)))
    FloatSub.Text = A823_FLOAT_SUB_2(Val(a.Text), Val(b.Text))
   
End Sub


Private Sub Command2_Click()
    A823_DriverClose
    End
End Sub

Private Sub Form_Load()
    Dim rtn
    
    Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
    wRtn = A823_DriverInit(wTotalBoards)
    If wRtn <> A823_NoError Then
        rtn = MsgBox("Driver Open Error !!!", , "A823 Card Error")
        Command1.Enabled = False
    Else
        Command1.Enabled = True
    End If
End Sub

⌨️ 快捷键说明

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