VBDumpPort32.frm
上传用户:gztxhy
上传日期:2020-04-03
资源大小:82k
文件大小:2k
- VERSION 5.00
- Begin VB.Form FrmVBDumpPort32
- BackColor = &H80000000&
- BorderStyle = 1 'Fixed Single
- Caption = "VBDumpPort32"
- ClientHeight = 1080
- ClientLeft = 2295
- ClientTop = 2385
- ClientWidth = 2220
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1080
- ScaleWidth = 2220
- Begin VB.CommandButton BtnSet
- Caption = "run"
- Height = 372
- Left = 360
- TabIndex = 0
- Top = 360
- Width = 1455
- End
- End
- Attribute VB_Name = "FrmVBDumpPort32"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub BtnSet_Click()
- Dim i As Byte
- Dim num(0 To 12) As Byte
- BtnSet.Enabled = False
- num(0) = &H1
- num(1) = &H2
- num(2) = &H4
- num(3) = &H8
- num(4) = &H10
- num(5) = &H20
- num(6) = &H40
- num(7) = &H80
- num(8) = &H0
- num(9) = &H55
- num(10) = &HAA
- num(11) = &H55
- num(12) = &HAA
- For i = 0 To 12
- send (num(i))
- TimeDelay (500)
- Next i
- send (0)
- BtnSet.Enabled = True
- End Sub
- Private Sub Form_Load()
- If InitializeWinIo = False Then
- MsgBox "Whoops ! There is a problem with InitializeWinIo.", vbOKOnly + vbCritical, "VBDumpPort32"
- Unload FrmVBDumpPort32
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Call ShutdownWinIo
- End Sub
- Private Sub send(dat As Byte)
- Dim Result As Boolean
- Result = SetPortVal(&H378, dat, 1)
- If (Result = False) Then
- MsgBox "Whoops ! There is a problem with SetPortByte.", vbOKOnly + vbCritical, "VBDumpPort32"
- Unload FrmVBDumpPort32
- End If
- End Sub