i'm using visual studio and trying to understanding this coding. is there anybody could translate this for me??
Begin VB.Form Form1
Caption = "Demo"
ClientHeight = 3570
ClientLeft = 60
ClientTop = 450
ClientWidth = 6315
LinkTopic = "Form1"
ScaleHeight = 3570
ScaleWidth = 6315
StartUpPosition = 3 'Windows Default
Begin VB.ComboBox cbCOM
Height = 315
ItemData = "Form1.frx":0000
Left = 1560
List = "Form1.frx":005E
TabIndex = 10
Top = 360
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "OpenCOM"
Height = 495
Left = 120
TabIndex = 9
Top = 240
Width = 1215
End
Begin VB.TextBox Text3
Height = 285
Left = 1560
TabIndex = 8
Top = 1080
Width = 615
End
Begin VB.TextBox Text2
Height = 285
Left = 1560
TabIndex = 6
Top = 3000
Width = 3855
End
Begin VB.TextBox Text1
Height = 735
Left = 1560
MultiLine = -1 'True
TabIndex = 3
Top = 1800
Width = 4695
End
Begin VB.CommandButton cmdInventory
Caption = "Inventory / Scan Tag"
Height = 495
Left = 120
TabIndex = 2
Top = 2040
Width = 1215
End
Begin VB.CommandButton cmdVerNo
Caption = "Ver No."
Height = 495
Left = 120
TabIndex = 1
Top = 840
Width = 1215
End
Begin VB.CommandButton cmdRFOnOff
Caption = "RF On"
Height = 495
Left = 120
TabIndex = 0
Top = 1440
Width = 1215
End
Begin VB.Label Label3
Caption = "RxData Byte"
Height = 255
Left = 1560
TabIndex = 7
Top = 840
Width = 1455
End
Begin VB.Label Label2
Caption = "Tag UID"
Height = 255
Left = 1560
TabIndex = 5
Top = 2760
Width = 615
End
Begin VB.Label Label1
Caption = "RxD"
Height = 255
Left = 1560
TabIndex = 4
Top = 1560
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Type RespInventory
Res As Byte
DSFID As Byte
UID(7) As Byte
End Type
Private Type RespInventoryRead
Res As Byte
UID(7) As Byte
Data(3, 3) As Byte
End Type
Private Sub cmdInventory_Click()
Dim bytMask(7) As Byte
Dim iLen As Integer
Dim bytResp(15) As RespInventory
Dim i As Integer
Dim s As String
Dim TagID As String
Dim i2 As Integer
bytMask(0) = 8
For i = 1 To 7
bytMask(i) = 0
Next
Res = EMR300_Inventory(&H26, 0, 0, bytMask(0), iLen, bytResp(0).Res)
If Res = RES_OK Then
For i = 0 To 0
s = s & Right("0" & Hex(bytResp(i).Res), 2) & " " & Right("0" & Hex(bytResp(i).DSFID), 2) & " "
For i2 = 0 To 7
s = s & Right("0" & Hex(bytResp(i).UID(i2)), 2) & " "
Next
For i2 = 7 To 0 Step -1
TagID = TagID & Right("0" & Hex(bytResp(i).UID(i2)), 2) & " "
Next
Next
Me.Text1.Text = s
Me.Text2.Text = TagID
Me.Text3.Text = iLen
End If
End Sub
Private Sub cmdRFOnOff_Click()
If Me.cmdRFOnOff.Caption = "RF On" Then
Res = EMR300_RFControl(1)
If Res = RES_OK Then
Me.cmdRFOnOff.Caption = "RF Off"
End If
Else
Res = EMR300_RFControl(0)
If Res = RES_OK Then
Me.cmdRFOnOff.Caption = "RF On"
End If
End If
End Sub
Private Sub cmdVerNo_Click()
Dim iLen As Integer
Dim bytStr(22) As Byte
Dim i As Integer
Dim s As String
Res = EMR300_ReadVer(iLen, bytStr(0))
If Res = RES_OK Then
For i = 0 To iLen - 1
s = s & Hex(bytStr(i)) & " "
Next
Me.Text1.Text = s
Me.Text3.Text = iLen
End If
End Sub
Private Sub Command1_Click()
Res = EMR300_ComOpen(cbCOM.ListIndex + 1)
End Sub
Private Sub Form_Load()
cbCOM.ListIndex = 0
End Sub
Begin VB.Form Form1
Caption = "Demo"
ClientHeight = 3570
ClientLeft = 60
ClientTop = 450
ClientWidth = 6315
LinkTopic = "Form1"
ScaleHeight = 3570
ScaleWidth = 6315
StartUpPosition = 3 'Windows Default
Begin VB.ComboBox cbCOM
Height = 315
ItemData = "Form1.frx":0000
Left = 1560
List = "Form1.frx":005E
TabIndex = 10
Top = 360
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "OpenCOM"
Height = 495
Left = 120
TabIndex = 9
Top = 240
Width = 1215
End
Begin VB.TextBox Text3
Height = 285
Left = 1560
TabIndex = 8
Top = 1080
Width = 615
End
Begin VB.TextBox Text2
Height = 285
Left = 1560
TabIndex = 6
Top = 3000
Width = 3855
End
Begin VB.TextBox Text1
Height = 735
Left = 1560
MultiLine = -1 'True
TabIndex = 3
Top = 1800
Width = 4695
End
Begin VB.CommandButton cmdInventory
Caption = "Inventory / Scan Tag"
Height = 495
Left = 120
TabIndex = 2
Top = 2040
Width = 1215
End
Begin VB.CommandButton cmdVerNo
Caption = "Ver No."
Height = 495
Left = 120
TabIndex = 1
Top = 840
Width = 1215
End
Begin VB.CommandButton cmdRFOnOff
Caption = "RF On"
Height = 495
Left = 120
TabIndex = 0
Top = 1440
Width = 1215
End
Begin VB.Label Label3
Caption = "RxData Byte"
Height = 255
Left = 1560
TabIndex = 7
Top = 840
Width = 1455
End
Begin VB.Label Label2
Caption = "Tag UID"
Height = 255
Left = 1560
TabIndex = 5
Top = 2760
Width = 615
End
Begin VB.Label Label1
Caption = "RxD"
Height = 255
Left = 1560
TabIndex = 4
Top = 1560
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Type RespInventory
Res As Byte
DSFID As Byte
UID(7) As Byte
End Type
Private Type RespInventoryRead
Res As Byte
UID(7) As Byte
Data(3, 3) As Byte
End Type
Private Sub cmdInventory_Click()
Dim bytMask(7) As Byte
Dim iLen As Integer
Dim bytResp(15) As RespInventory
Dim i As Integer
Dim s As String
Dim TagID As String
Dim i2 As Integer
bytMask(0) = 8
For i = 1 To 7
bytMask(i) = 0
Next
Res = EMR300_Inventory(&H26, 0, 0, bytMask(0), iLen, bytResp(0).Res)
If Res = RES_OK Then
For i = 0 To 0
s = s & Right("0" & Hex(bytResp(i).Res), 2) & " " & Right("0" & Hex(bytResp(i).DSFID), 2) & " "
For i2 = 0 To 7
s = s & Right("0" & Hex(bytResp(i).UID(i2)), 2) & " "
Next
For i2 = 7 To 0 Step -1
TagID = TagID & Right("0" & Hex(bytResp(i).UID(i2)), 2) & " "
Next
Next
Me.Text1.Text = s
Me.Text2.Text = TagID
Me.Text3.Text = iLen
End If
End Sub
Private Sub cmdRFOnOff_Click()
If Me.cmdRFOnOff.Caption = "RF On" Then
Res = EMR300_RFControl(1)
If Res = RES_OK Then
Me.cmdRFOnOff.Caption = "RF Off"
End If
Else
Res = EMR300_RFControl(0)
If Res = RES_OK Then
Me.cmdRFOnOff.Caption = "RF On"
End If
End If
End Sub
Private Sub cmdVerNo_Click()
Dim iLen As Integer
Dim bytStr(22) As Byte
Dim i As Integer
Dim s As String
Res = EMR300_ReadVer(iLen, bytStr(0))
If Res = RES_OK Then
For i = 0 To iLen - 1
s = s & Hex(bytStr(i)) & " "
Next
Me.Text1.Text = s
Me.Text3.Text = iLen
End If
End Sub
Private Sub Command1_Click()
Res = EMR300_ComOpen(cbCOM.ListIndex + 1)
End Sub
Private Sub Form_Load()
cbCOM.ListIndex = 0
End Sub