📄 实验2.frm
字号:
VERSION 5.00
Begin VB.Form 实验2
Caption = "LAB2"
ClientHeight = 3255
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3255
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command6
Caption = "灯控"
Height = 375
Left = 2760
TabIndex = 8
Top = 2520
Width = 975
End
Begin VB.CommandButton Command5
Caption = "退出"
Height = 375
Left = 2760
TabIndex = 7
Top = 2160
Width = 975
End
Begin VB.CommandButton Command4
Caption = "读版本号"
Height = 375
Left = 1800
TabIndex = 6
Top = 2520
Width = 975
End
Begin VB.CommandButton Command3
Caption = "连接"
Height = 375
Left = 1800
TabIndex = 5
Top = 2160
Width = 975
End
Begin VB.CommandButton Command2
Caption = "断开连接"
Height = 375
Left = 840
TabIndex = 4
Top = 2520
Width = 975
End
Begin VB.CommandButton Command1
Caption = "清屏"
Height = 375
Left = 840
TabIndex = 3
Top = 2160
Width = 975
End
Begin VB.ListBox List1
Height = 1035
ItemData = "实验2.frx":0000
Left = 240
List = "实验2.frx":0002
TabIndex = 2
Top = 840
Width = 4095
End
Begin VB.TextBox Text1
Height = 375
Left = 1920
TabIndex = 1
Top = 240
Width = 2415
End
Begin VB.Frame Frame1
Caption = "卡序列号"
Height = 375
Left = 240
TabIndex = 0
Top = 240
Width = 1455
End
End
Attribute VB_Name = "实验2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim flag As Integer
Dim status As Long
Dim i As Long
Dim ReadBuff(16) As Byte
Dim wtdata As String * 32
Public Sub lianjie() '连接子程序
Dim Port As Long
Dim mcmno As Long
mcmno = 17
status = AutoLinkCom(Port)
List1.AddItem "正在连接!"
If status = 0 Then
MsgBox "已连接!!!", vbExclamation, "状态"
status = RFMifare_Mcmno(mcmno)
If status = 0 Then
List1.AddItem "系统与CE06 MIFARE读写器连接成功!"
Command6.Enabled = True
Command4.Enabled = True
Else
List1.AddItem "系统连接的不是CE06 MIFARE读写器,连接失败!"
Command6.Enabled = False
Command4.Enabled = False
End If
Else
List1.AddItem "通信接口连接失败!检查读写器连接是否正常!!"
End If
End Sub
Public Sub duanlianjie() '断开连接
If status = 0 Then
List1.Clear
List1.AddItem ""
List1.AddItem "断开连接成功!"
Else
List1.Clear
List1.AddItem ""
List1.AddItem "断开连接失败!"
End If
End Sub
Private Sub Command1_Click() '清屏
'MousePointer = 99
List1.Clear
'MousePointer = 0
End Sub
Private Sub Command2_Click() '断开连接
Call duanlianjie
Command4.Enabled = False
Command6.Enabled = False
End Sub
Private Sub Command3_Click() '连接
Call lianjie
End Sub
Private Sub Command4_Click() '模块版本号
Dim mcmver(20) As Byte
Dim temp As String
Dim i As Byte
status = DEVVER(mcmver(0))
If status = 0 Then
List1.Clear
List1.AddItem ""
List1.AddItem "读控制软件版本号成功!"
temp = ""
For i = 0 To 7
temp = temp + Hex(mcmver(i)) '??????
Next i
List1.AddItem temp
Else
List1.AddItem ""
List1.AddItem "读控制软件版本号失败!"
End If
End Sub
Private Sub Command5_Click() '退出
Call duanlianjie
End
End Sub
Private Sub Command6_Click() '灯控
Dim mode As Long
Dim actiontime As Long
Dim intervaltime As Long
Dim count As Long
mode = 7
actiontime = 30
intervaltime = 30
count = 3
status = ALARM(mode, actiontime, intervaltime, count)
If status = 0 Then
List1.Clear
List1.AddItem ""
List1.AddItem "读控制软件版本号成功!"
Else
List1.Clear
List1.AddItem ""
List1.AddItem "读控制软件版本号失败!"
End If
End Sub
Private Sub Form_Load()
List1.Clear
Command6.Enabled = False
Command4.Enabled = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -