VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form FrmDeviceInfo 
   Caption         =   "Device Inforamtion"
   ClientHeight    =   8385
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   12825
   BeginProperty Font 
      Name            =   "Times New Roman"
      Size            =   14.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   8385
   ScaleWidth      =   12825
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Command1 
      Caption         =   "Power Off"
      Height          =   855
      Left            =   7080
      TabIndex        =   75
      Tag             =   "93"
      Top             =   6960
      Width           =   2535
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   12
      Left            =   4080
      TabIndex        =   72
      Top             =   7080
      Width           =   615
   End
   Begin VB.Frame Frame3 
      Caption         =   "Net Module Info"
      Height          =   3735
      Left            =   7080
      TabIndex        =   55
      Tag             =   "60"
      Top             =   2880
      Width           =   5175
      Begin VB.TextBox AyIAFarendIP 
         Height          =   285
         Left            =   2040
         MaxLength       =   23
         TabIndex        =   71
         Top             =   1800
         Width           =   2430
      End
      Begin VB.TextBox AyIAGatewayIP 
         Height          =   285
         Left            =   2040
         MaxLength       =   23
         TabIndex        =   70
         Top             =   1440
         Width           =   2430
      End
      Begin VB.TextBox AyIASubnetMask 
         Height          =   285
         Left            =   2040
         MaxLength       =   23
         TabIndex        =   69
         Top             =   1080
         Width           =   2430
      End
      Begin VB.TextBox AyIAIPAddress 
         Height          =   285
         Left            =   2040
         MaxLength       =   23
         TabIndex        =   68
         Top             =   360
         Width           =   2430
      End
      Begin VB.ComboBox cboFarLimit 
         Height          =   435
         Left            =   2040
         Style           =   2  'Dropdown List
         TabIndex        =   60
         Top             =   2160
         Width           =   2415
      End
      Begin VB.CommandButton cmdSetNetModuleInfo 
         Caption         =   "Set"
         Height          =   375
         Left            =   1680
         TabIndex        =   59
         Tag             =   "92"
         Top             =   3120
         Width           =   1215
      End
      Begin VB.CommandButton cmdReadNetModuleInfo 
         Caption         =   "Read"
         Height          =   375
         Left            =   240
         TabIndex        =   58
         Tag             =   "93"
         Top             =   3120
         Width           =   1215
      End
      Begin VB.TextBox txtMACAddress 
         Height          =   285
         Left            =   2040
         MaxLength       =   23
         TabIndex        =   57
         Top             =   720
         Width           =   2430
      End
      Begin VB.ComboBox cboLimitChangeMAC 
         Height          =   435
         Left            =   2040
         Style           =   2  'Dropdown List
         TabIndex        =   56
         Top             =   2580
         Width           =   2415
      End
      Begin VB.Label Label11 
         Caption         =   "IP Address:"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   67
         Tag             =   "328"
         Top             =   360
         Width           =   1815
      End
      Begin VB.Label Label12 
         Caption         =   "MAC Address:"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   66
         Tag             =   "329"
         Top             =   720
         Width           =   1815
      End
      Begin VB.Label Label13 
         Caption         =   "Subnet Mask:"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   65
         Tag             =   "330"
         Top             =   1080
         Width           =   1815
      End
      Begin VB.Label Label14 
         Caption         =   "Gateway IP:"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   64
         Tag             =   "331"
         Top             =   1440
         Width           =   1815
      End
      Begin VB.Label Label15 
         Caption         =   "Far end IP:"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   63
         Tag             =   "332"
         Top             =   1800
         Width           =   1815
      End
      Begin VB.Label Label16 
         Caption         =   "Far Limit:"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   62
         Tag             =   "333"
         Top             =   2190
         Width           =   1815
      End
      Begin VB.Label Label17 
         Caption         =   "Change MACIddress:"
         Height          =   255
         Index           =   1
         Left            =   240
         TabIndex        =   61
         Tag             =   "334"
         Top             =   2610
         Width           =   1815
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "Device Info"
      Height          =   1215
      Left            =   7080
      TabIndex        =   47
      Tag             =   "58"
      Top             =   1320
      Width           =   5175
      Begin VB.TextBox txtCompanyName 
         Height          =   285
         Left            =   2040
         MaxLength       =   10
         TabIndex        =   52
         Top             =   360
         Width           =   1710
      End
      Begin VB.CommandButton cmdSetCompanyName 
         Caption         =   "Set"
         Height          =   285
         Left            =   3720
         TabIndex        =   51
         Tag             =   "92"
         Top             =   360
         Width           =   615
      End
      Begin VB.TextBox txtSerialNumber 
         Height          =   285
         Left            =   2040
         MaxLength       =   10
         TabIndex        =   50
         Top             =   720
         Width           =   1710
      End
      Begin VB.CommandButton cmdGetSerialNumber 
         Caption         =   "Get"
         Height          =   285
         Left            =   3720
         TabIndex        =   49
         Tag             =   "91"
         Top             =   720
         Width           =   615
      End
      Begin VB.CommandButton cmdSetSerialNumber 
         Caption         =   "Set"
         Height          =   285
         Left            =   4320
         TabIndex        =   48
         Tag             =   "92"
         Top             =   720
         Width           =   615
      End
      Begin VB.Label Label2 
         Caption         =   "Company Name:"
         Height          =   255
         Left            =   240
         TabIndex        =   54
         Tag             =   "317"
         Top             =   375
         Width           =   1695
      End
      Begin VB.Label Label1 
         Caption         =   "Serial Number:"
         Height          =   255
         Left            =   240
         TabIndex        =   53
         Tag             =   "318"
         Top             =   735
         Width           =   1695
      End
   End
   Begin VB.ComboBox CmbLock 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   10.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "FrmDeviceInfo.frx":0000
      Left            =   3240
      List            =   "FrmDeviceInfo.frx":000A
      Style           =   2  'Dropdown List
      TabIndex        =   46
      Top             =   2880
      Width           =   1815
   End
   Begin VB.ComboBox CmbBPS 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   10.5
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   360
      ItemData        =   "FrmDeviceInfo.frx":0017
      Left            =   3240
      List            =   "FrmDeviceInfo.frx":0024
      Style           =   2  'Dropdown List
      TabIndex        =   45
      Top             =   4320
      Width           =   1815
   End
   Begin VB.ComboBox CmbLanguage 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      ItemData        =   "FrmDeviceInfo.frx":003C
      Left            =   3240
      List            =   "FrmDeviceInfo.frx":0049
      Style           =   2  'Dropdown List
      TabIndex        =   44
      Top             =   2400
      Width           =   1815
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   11
      Left            =   4080
      TabIndex        =   43
      Top             =   7560
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   10
      Left            =   4080
      TabIndex        =   42
      Top             =   6600
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   9
      Left            =   4080
      TabIndex        =   41
      Top             =   6120
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   8
      Left            =   4080
      TabIndex        =   40
      Top             =   5640
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   7
      Left            =   4080
      TabIndex        =   39
      Top             =   5160
      Width           =   615
   End
   Begin VB.CommandButton CmdPut 
      Caption         =   "Put"
      Height          =   255
      Index           =   6
      Left            =   6000
      TabIndex        =   37
      Top             =   4320
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   6
      Left            =   5280
      TabIndex        =   36
      Top             =   4320
      Width           =   615
   End
   Begin VB.CommandButton CmdPut 
      Caption         =   "Put"
      Height          =   255
      Index           =   5
      Left            =   6000
      TabIndex        =   35
      Top             =   3840
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   5
      Left            =   5280
      TabIndex        =   34
      Top             =   3840
      Width           =   615
   End
   Begin VB.CommandButton CmdPut 
      Caption         =   "Put"
      Height          =   255
      Index           =   4
      Left            =   6000
      TabIndex        =   33
      Top             =   3360
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   4
      Left            =   5280
      TabIndex        =   32
      Top             =   3360
      Width           =   615
   End
   Begin VB.CommandButton CmdPut 
      Caption         =   "Put"
      Height          =   255
      Index           =   3
      Left            =   6000
      TabIndex        =   31
      Top             =   2880
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   3
      Left            =   5280
      TabIndex        =   30
      Top             =   2880
      Width           =   615
   End
   Begin VB.CommandButton CmdPut 
      Caption         =   "Put"
      Height          =   255
      Index           =   2
      Left            =   6000
      TabIndex        =   29
      Top             =   2400
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   2
      Left            =   5280
      TabIndex        =   28
      Top             =   2400
      Width           =   615
   End
   Begin VB.CommandButton CmdPut 
      Caption         =   "Put"
      Height          =   255
      Index           =   1
      Left            =   6000
      TabIndex        =   27
      Top             =   1920
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   1
      Left            =   5280
      TabIndex        =   26
      Top             =   1920
      Width           =   615
   End
   Begin VB.CommandButton CmdPut 
      Caption         =   "Put"
      Height          =   255
      Index           =   0
      Left            =   6000
      TabIndex        =   25
      Top             =   1440
      Width           =   615
   End
   Begin VB.CommandButton CmdGet 
      Caption         =   "Get"
      Height          =   255
      Index           =   0
      Left            =   5280
      TabIndex        =   24
      Top             =   1440
      Width           =   615
   End
   Begin VB.TextBox txtSpacingTime 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3240
      TabIndex        =   16
      Top             =   3840
      Width           =   1815
   End
   Begin VB.TextBox txtGLogAlarm 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3240
      TabIndex        =   15
      Top             =   3360
      Width           =   1815
   End
   Begin VB.TextBox txtMachineNo 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3240
      TabIndex        =   14
      Top             =   1920
      Width           =   1815
   End
   Begin VB.TextBox txtMaxManagerNumber 
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   3240
      TabIndex        =   13
      Top             =   1440
      Width           =   1815
   End
   Begin VB.CommandButton CmdGetDeviceTime 
      Caption         =   "GetDeviceTime"
      Height          =   375
      Left            =   9000
      TabIndex        =   1
      Top             =   360
      Width           =   2295
   End
   Begin VB.CommandButton CmdSetDeviceTime 
      Caption         =   "SetDeviceTime"
      Height          =   375
      Left            =   6600
      TabIndex        =   0
      Top             =   360
      Width           =   2295
   End
   Begin MSComCtl2.DTPicker DTPicker 
      Height          =   375
      Left            =   3360
      TabIndex        =   2
      Top             =   360
      Width           =   3015
      _ExtentX        =   5318
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Times New Roman"
         Size            =   11.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      CustomFormat    =   "yyy'-'MM'-'dd  HH':'mm':'ss"
      Format          =   84475907
      CurrentDate     =   38565.7097337963
      MaxDate         =   51501
      MinDate         =   36526
   End
   Begin VB.Label lblEnrollIDCards 
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   74
      Top             =   7080
      Width           =   735
   End
   Begin VB.Label Label16 
      Alignment       =   1  'Right Justify
      Caption         =   "Enroll Passwords:"
      Height          =   255
      Index           =   2
      Left            =   360
      TabIndex        =   73
      Top             =   7080
      Width           =   2655
   End
   Begin VB.Label lbl 
      Alignment       =   1  'Right Justify
      Caption         =   "Time:"
      Height          =   255
      Left            =   240
      TabIndex        =   38
      Top             =   360
      Width           =   3015
   End
   Begin VB.Label Label12 
      Alignment       =   1  'Right Justify
      Caption         =   "BPS:"
      Height          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   23
      Top             =   4320
      Width           =   3015
   End
   Begin VB.Label Label11 
      Alignment       =   1  'Right Justify
      Caption         =   "Spacing Time:"
      Height          =   375
      Index           =   0
      Left            =   120
      TabIndex        =   22
      Top             =   3840
      Width           =   3015
   End
   Begin VB.Label Label10 
      Alignment       =   1  'Right Justify
      Caption         =   "General Log Alarm:"
      Height          =   375
      Left            =   120
      TabIndex        =   21
      Top             =   3360
      Width           =   3015
   End
   Begin VB.Label Label9 
      Alignment       =   1  'Right Justify
      Caption         =   "Lock:"
      Height          =   255
      Left            =   120
      TabIndex        =   20
      Top             =   2880
      Width           =   3015
   End
   Begin VB.Label Label8 
      Alignment       =   1  'Right Justify
      Caption         =   "Language:"
      Height          =   375
      Left            =   120
      TabIndex        =   19
      Top             =   2400
      Width           =   3015
   End
   Begin VB.Label Label7 
      Alignment       =   1  'Right Justify
      Caption         =   "MachineNo:"
      Height          =   255
      Left            =   120
      TabIndex        =   18
      Top             =   1920
      Width           =   3015
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      Caption         =   "Max Manager Number:"
      Height          =   375
      Left            =   0
      TabIndex        =   17
      Top             =   1440
      Width           =   3135
   End
   Begin VB.Label Label13 
      Alignment       =   1  'Right Justify
      Caption         =   "Manager Number:"
      Height          =   375
      Index           =   0
      Left            =   360
      TabIndex        =   12
      Top             =   5160
      Width           =   2655
   End
   Begin VB.Label lblManagerNumbers 
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   11
      Top             =   5160
      Width           =   735
   End
   Begin VB.Label Label14 
      Alignment       =   1  'Right Justify
      Caption         =   "User Numbers:"
      Height          =   255
      Index           =   0
      Left            =   360
      TabIndex        =   10
      Top             =   5640
      Width           =   2655
   End
   Begin VB.Label lblUserNumbers 
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   9
      Top             =   5640
      Width           =   735
   End
   Begin VB.Label Label15 
      Alignment       =   1  'Right Justify
      Caption         =   "Enroll Fingers:"
      Height          =   375
      Index           =   0
      Left            =   360
      TabIndex        =   8
      Top             =   6120
      Width           =   2655
   End
   Begin VB.Label lblEnrollFingers 
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   7
      Top             =   6120
      Width           =   735
   End
   Begin VB.Label Label16 
      Alignment       =   1  'Right Justify
      Caption         =   "Enroll Passwords:"
      Height          =   255
      Index           =   0
      Left            =   360
      TabIndex        =   6
      Top             =   6600
      Width           =   2655
   End
   Begin VB.Label lblEnrollPasswords 
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   5
      Top             =   6600
      Width           =   735
   End
   Begin VB.Label Label17 
      Alignment       =   1  'Right Justify
      Caption         =   "General Log Number:"
      Height          =   375
      Index           =   0
      Left            =   360
      TabIndex        =   4
      Top             =   7560
      Width           =   2655
   End
   Begin VB.Label lblGLogNumber 
      BorderStyle     =   1  'Fixed Single
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3240
      TabIndex        =   3
      Top             =   7560
      Width           =   735
   End
End
Attribute VB_Name = "FrmDeviceInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdGetDeviceInfo_Click()

End Sub

Private Sub CmdGet_Click(Index As Integer)
    Dim Value As Long
    With MDIFrm
    Select Case Index
    Case 0:
        txtMaxManagerNumber.Text = ""
       If .BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_ManagerMaxNumber, Value) Then
            txtMaxManagerNumber.Text = CStr(Value)
        Else
            MsgBox "Get device information error"
       End If
    Case 1:
        txtMachineNo.Text = ""
        If .BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_MachineNo, Value) Then
            txtMachineNo.Text = CStr(Value)
        Else
            MsgBox "Get device information error"
        End If
    Case 2:
       CmbLanguage.ListIndex = -1
       If .BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_LanguageType, Value) Then
            CmbLanguage.ListIndex = Value
        Else
            MsgBox "Get device information error"
       End If
    Case 3:
        CmbLock.ListIndex = -1
        If .BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_LockCtrl, Value) Then
            CmbLock.ListIndex = CStr(Value)
        Else
            MsgBox "Get device information error"
        End If
    Case 4:
        txtGLogAlarm.Text = ""
        If .BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_GLogAlarm, Value) Then
            txtGLogAlarm = CStr(Value)
        Else
            MsgBox "Get device information error"
        End If
    Case 5:
        txtSpacingTime.Text = ""
        If .BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_SpacingTime, Value) Then
            txtSpacingTime = CStr(Value)
        Else
            MsgBox "Get device information error"
        End If
    Case 6:
        CmbBPS.ListIndex = -1
        If .BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_BPS, Value) Then
            CmbBPS.ListIndex = Value - 1
        Else
            MsgBox "Get device information error"
        End If
    Case 7:
        lblManagerNumbers.Caption = ""
        If .BFLex1.GetDeviceStatus(MdlVar.DeviceNumber, BFLex_ManagerNumber, Value) Then
            lblManagerNumbers = CStr(Value)
        Else
            MsgBox "Get device status error"
        End If
    Case 8:
        lblUserNumbers.Caption = ""
        If .BFLex1.GetDeviceStatus(MdlVar.DeviceNumber, BFLex_UserNumber, Value) Then
           lblUserNumbers = CStr(Value)
        Else
           MsgBox "Get device status error"
        End If
    Case 9:
        lblEnrollFingers.Caption = ""
        If .BFLex1.GetDeviceStatus(MdlVar.DeviceNumber, BFLex_EnrollFingers, Value) Then
            lblEnrollFingers = CStr(Value)
        Else
            MsgBox "Get device status error"
        End If
    Case 10:
        lblEnrollPasswords.Caption = ""
        If .BFLex1.GetDeviceStatus(MdlVar.DeviceNumber, BFLex_EnrollPasswords, Value) Then
           lblEnrollPasswords = CStr(Value)
        Else
           MsgBox "Get device status error"
        End If
    Case 11:
        lblGLogNumber.Caption = ""
        If .BFLex1.GetDeviceStatus(MdlVar.DeviceNumber, BFLex_GLogNumber, Value) Then
            lblGLogNumber = CStr(Value)
        Else
            MsgBox "Get device status error"
        End If
    Case 12:
        lblEnrollIDCards.Caption = ""
        If .BFLex1.GetDeviceStatus(MdlVar.DeviceNumber, BFLex_IDCard, Value) Then
            lblEnrollIDCards = CStr(Value)
        Else
            MsgBox "Get device status error"
        End If
        
    End Select
    End With
End Sub

Private Sub CmdGetDeviceTime_Click()
    Dim dt As Date, bRet As Boolean
    bRet = MDIFrm.BFLex1.GetDeviceTime(MdlVar.DeviceNumber, dt)
    
    If bRet Then
        DTPicker = dt
    Else
        MsgBox "Get time error!"
    End If
End Sub

Private Sub cmdGetSerialNumber_Click()

    Dim bRet As Boolean
    Dim serialnumber1 As String
    
    bRet = MDIFrm.BFLex1.GetSerialNumber(MdlVar.DeviceNumber, serialnumber1)
    If bRet Then
        MsgBox "Get Serial Number succeed"
        txtSerialNumber.Text = serialnumber1
    Else
        MsgBox "Get Serial Number error"
    End If

End Sub

Private Sub CmdPut_Click(Index As Integer)
    With MDIFrm
    Select Case Index
    Case 0:
        
       If .BFLex1.SetDeviceInfo(MdlVar.DeviceNumber, BFLex_ManagerMaxNumber, CLng(txtMaxManagerNumber.Text)) Then
            MsgBox "Set device information succeed"
        Else
            MsgBox "Set device information error"
       End If
    Case 1:
        If .BFLex1.SetDeviceInfo(MdlVar.DeviceNumber, BFLex_MachineNo, CLng(txtMachineNo.Text)) Then
            MsgBox "Set device information succeed"
            MdlVar.DeviceNumber = CLng(txtMachineNo)
        Else
            MsgBox "Get device information error"
        End If
    Case 2:
       If .BFLex1.SetDeviceInfo(MdlVar.DeviceNumber, BFLex_LanguageType, CmbLanguage.ListIndex + 1) Then
            MsgBox "Set device information succeed"
        Else
            MsgBox "Get device information error"
       End If
    Case 3:
        
         If .BFLex1.SetDeviceInfo(MdlVar.DeviceNumber, BFLex_LockCtrl, CmbLock.ListIndex) Then
            MsgBox "Set device information succeed"
        Else
            MsgBox "Get device information error"
        End If
    Case 4:
         
        If .BFLex1.SetDeviceInfo(MdlVar.DeviceNumber, BFLex_GLogAlarm, CLng(txtGLogAlarm.Text)) Then
            MsgBox "Set device information succeed"
        Else
            MsgBox "Get device information error"
        End If
    Case 5:
        If .BFLex1.SetDeviceInfo(MdlVar.DeviceNumber, BFLex_SpacingTime, CLng(txtSpacingTime.Text)) Then
            MsgBox "Set device information succeed"
        Else
            MsgBox "Get device information error"
        End If
    Case 6:
        If .BFLex1.SetDeviceInfo(MdlVar.DeviceNumber, BFLex_BPS, CmbBPS.ListIndex + 1) Then
            MsgBox "Set device information succeed"
            If .BFLex1.ConnectStatus = BFLex_SerialConnect Then
                .BFLex1.CloseCom
                .BFLex1.OpenCom PCCom, CLng(CmbBPS.Text)
            End If
        Else
            MsgBox "Get device information error"
        End If
    End Select
    End With
    
End Sub

Private Sub cmdReadNetModuleInfo_Click()

    Dim bRet As Boolean
    Dim dwValue As Long
    
    'device no
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MdlVar.DeviceNumber, BFLex_DeviceInfo.BFLex_MachineNo, dwValue)
    If bRet Then
        txtDeviceNo.Text = dwValue
    Else
        GoTo Defealt
    End If
    
    'managers
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_ManagerMaxNumber, dwValue)
    If bRet Then
        txtManagers.Text = dwValue
    Else
        GoTo Defealt
    End If
    
    'auto close time
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_AutoOff, dwValue)
    If bRet Then
        txtAutoCloseTime.Text = dwValue
    Else
        GoTo Defealt
    End If
    
    'space time
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_SpacingTime, dwValue)
    If bRet Then
        txtSpaceTime.Text = dwValue
    Else
        GoTo Defealt
    End If
    
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_MachineNo, dwValue)
    If bRet Then
        txtDeviceNo.Text = dwValue
    Else
        GoTo Defealt
    End If
    
    'alarm time
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_GLogAlarm, dwValue)
    If bRet Then
        txtAlarmCount.Text = dwValue
    Else
        GoTo Defealt
    End If
    
    'lock
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_LockCtrl, dwValue)
    If bRet Then
        cboLock.ListIndex = dwValue
    Else
        GoTo Defealt
    End If
    
    'language
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_LanguageType, dwValue)
    If bRet Then
        cboLanguage.ListIndex = dwValue - 1
    Else
        GoTo Defealt
    End If
    
    'baudrate
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_BPS, dwValue)
    If bRet Then
        cboBaudrate.ListIndex = dwValue - 1
    Else
        GoTo Defealt
    End If
    
    'realtime
    bRet = MDIFrm.BFLex1.GetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_Realtime, dwValue)
    If bRet Then
        cboRealtime.ListIndex = dwValue ' - 1
    Else
        GoTo Defealt
    End If
    MsgBox "succss", vbInformation + vbOKOnly, msgTitle
    Exit Sub
    
Defealt:
    MsgBox "defeate", vbInformation + vbOKOnly, msgTitle

End Sub

Private Sub cmdSetCompanyName_Click()
    
    Dim bRet As Boolean
    
    bRet = MDIFrm.BFLex1.SetCompanyName(MdlVar.DeviceNumber, Trim(txtCompanyName.Text))
    If bRet Then
        MsgBox "Set Company Name succeed"
    Else
        MsgBox "Set Company Name error"
    End If
    
End Sub

Private Sub CmdSetDeviceTime_Click()
   Dim dt As Date
    dt = DTPicker
    If Not MDIFrm.BFLex1.SetDeviceTime(MdlVar.DeviceNumber, dt) Then
        MsgBox "Set time error"
    End If
End Sub

Private Sub cmdSetNetModuleInfo_Click()

    Dim bRet As Boolean
    Dim dwValue As Long
    
'        'device no
'        dwValue = Val(txtDeviceNo.text)
'        bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_MachineNo, dwValue)
'        If bRet Then
'
'        Else
'            GoTo Defealt
'        End If
    
    'managers
    dwValue = Val(txtManagers.Text)
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_ManagerMaxNumber, dwValue)
    If bRet Then
        
    Else
        GoTo Defealt
    End If
    
    'auto close time
    dwValue = Val(txtAutoCloseTime.Text)
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_AutoOff, dwValue)
    If bRet Then
        
    Else
        GoTo Defealt
    End If
    
    'space time
    dwValue = txtSpaceTime.Text
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_SpacingTime, dwValue)
    If bRet Then
         
    Else
        GoTo Defealt
    End If
    
    '
    dwValue = Val(txtDeviceNo.Text)
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_MachineNo, dwValue)
    If bRet Then
        
    Else
        GoTo Defealt
    End If
    
    'alarm time
    dwValue = Val(txtAlarmCount.Text)
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_GLogAlarm, dwValue)
    If bRet Then
        
    Else
        GoTo Defealt
    End If
    
    'lock
    dwValue = cboLock.ListIndex
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_LockCtrl, dwValue)
    If bRet Then
         
    Else
        GoTo Defealt
    End If
    
    'language
    dwValue = cboLanguage.ListIndex + 1
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_LanguageType, dwValue)
    If bRet Then
        
    Else
        GoTo Defealt
    End If
    
    'baudrate
    dwValue = cboBaudrate.ListIndex + 1
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_BPS, dwValue)
    If bRet Then

    Else
        GoTo Defealt
    End If
    
    'realtime
    dwValue = cboRealtime.ListIndex ' + 1
    bRet = MDIFrm.BFLex1.SetDeviceInfo(MyMachineInfo.tMachineInfo.No, BFLex_DeviceInfo.BFLex_Realtime, dwValue)
    If bRet Then
        
    Else
        GoTo Defealt
    End If
    MsgBox "Success", vbInformation + vbOKOnly, msgTitle
    Exit Sub
    
Defealt:
    MsgBox "defeate", vbInformation + vbOKOnly, msgTitle
    
End Sub

Private Sub cmdSetSerialNumber_Click()

    Dim bRet As Boolean
    
    bRet = MDIFrm.BFLex1.SetSerialNumber(MdlVar.DeviceNumber, Trim(txtSerialNumber.Text))
    If bRet Then
        MsgBox "Set Serial Number succeed"
    Else
        MsgBox "Set Serial Number error"
    End If

End Sub

Private Sub Command1_Click()
    
    MDIFrm.BFLex1.PowerOff MdlVar.DeviceNumber
    
End Sub

Private Sub Form_Load()
    
    
    cboFarLimit.AddItem "No"
    cboFarLimit.AddItem "Yes"
    cboFarLimit.ListIndex = 0
    
    cboLimitChangeMAC.AddItem "Limit Change"
    cboLimitChangeMAC.AddItem "Can Change"
    cboLimitChangeMAC.ListIndex = 0
    
End Sub
