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

📄 frmsr31.frm

📁 加上一个GSM模块
💻 FRM
📖 第 1 页 / 共 4 页
字号:
         Caption         =   "命令类型"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   25
         Top             =   360
         Width           =   975
      End
      Begin VB.Label simNum 
         Caption         =   "远端SIM卡号码"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   24
         Top             =   960
         Width           =   1455
      End
      Begin VB.Label Label12 
         Caption         =   "OUTPUT"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   3840
         TabIndex        =   23
         Top             =   3360
         Width           =   855
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "返回数据"
      Height          =   1935
      Left            =   0
      TabIndex        =   7
      Top             =   3960
      Width           =   5055
      Begin VB.TextBox txtBack 
         Height          =   1575
         Left            =   240
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   8
         Top             =   240
         Width           =   4575
      End
   End
   Begin VB.Timer tiSR1 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   4320
      Top             =   6840
   End
   Begin VB.Timer tisr2 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   4800
      Top             =   6840
   End
   Begin VB.Frame Frame3 
      Height          =   735
      Left            =   0
      TabIndex        =   2
      Top             =   6000
      Width           =   9255
      Begin VB.CommandButton cmdEnd 
         Caption         =   "退     出"
         Height          =   375
         Left            =   6000
         TabIndex        =   6
         Top             =   240
         Width           =   1455
      End
      Begin VB.CommandButton cmdCHK 
         Caption         =   "计算CHKSUN"
         Height          =   375
         Left            =   960
         TabIndex        =   5
         Top             =   240
         Width           =   1455
      End
      Begin VB.CommandButton cmdSend 
         Caption         =   "发送数据"
         Height          =   375
         Left            =   2640
         TabIndex        =   4
         Top             =   240
         Width           =   1455
      End
      Begin VB.CommandButton cmdProcess 
         Caption         =   "保存数据"
         Height          =   375
         Left            =   4320
         TabIndex        =   3
         Top             =   240
         Width           =   1455
      End
   End
   Begin VB.Frame Frame4 
      Caption         =   "操作结果显示"
      Height          =   1935
      Left            =   5280
      TabIndex        =   0
      Top             =   3960
      Width           =   3975
      Begin VB.TextBox txtczxs 
         Height          =   1575
         Left            =   120
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   1
         Top             =   240
         Width           =   3615
      End
   End
   Begin VB.Timer tiSR3 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   5280
      Top             =   6840
   End
   Begin VB.Timer tiSR4 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   5880
      Top             =   6840
   End
   Begin VB.Timer tiQunFa1 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   7680
      Top             =   6960
   End
   Begin VB.Timer tiQunFa2 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   8280
      Top             =   6960
   End
   Begin VB.Timer tiQunfa 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   7080
      Top             =   6960
   End
   Begin VB.Timer tiQunFa3 
      Enabled         =   0   'False
      Interval        =   2000
      Left            =   8880
      Top             =   6960
   End
End
Attribute VB_Name = "frmSR31"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim E As Double
Dim m As Double
Public Function ChToFl(n As String) As Double
    E = Val(n) \ (2 ^ 23)
    m = Val(n) And &H7FFFFF
    If E >= 256 Then
        E = E - 256
        backValue = -(1 + m * (2 ^ (-23))) * (2 ^ (E - 127))
    Else
        backValue = (1 + m * (2 ^ (-23))) * (2 ^ (E - 127))
    End If
End Function
Public Function RecTemp() As String
    Dim buf$
    If frmMDI.comm.InBufferCount > 0 Then
        frmMDI.comm.InputLen = 0
        buf = frmMDI.comm.Input
    End If
End Function
Public Function GetData() As String
    Dim Count As Integer
    Dim Count1 As Integer
    Dim count2 As Integer
    Dim flag1 As Boolean
    Dim flag2 As Boolean
    flag1 = False
    flag2 = False
    Count = 0
    Count1 = 0
    count2 = 0
    phoneNum = ""
    phoneTime = ""
    receiveStr = ""
    frmMDI.comm.InputLen = 1
    While frmMDI.comm.InBufferCount > 0
        ReDim Preserve arr_return(Count + 1)
        arr_return(Count) = frmMDI.comm.Input
        If Count > 3 Then
            If arr_return(Count - 3) = "+" And arr_return(Count - 2) = "8" And arr_return(Count - 1) = "6" Then
                flag2 = True
            End If
        End If
        If flag2 = True Then
            If count2 < 11 Then
                phoneNum = phoneNum + arr_return(Count)
                'count2 = count2 + 1
            ElseIf count2 >= 15 And count2 < 32 Then
                phoneTime = phoneTime + arr_return(Count)
            ElseIf count2 >= 32 Then
                flag2 = False
            End If
            count2 = count2 + 1
        End If
        If Count > 0 Then
            If arr_return(Count - 1) = "7" And arr_return(Count) = "E" Then
                flag1 = True
                receiveStr = receiveStr + "7"
                mess_index(0) = "7"
            End If
        End If
        If flag1 = True Then
            ReDim Preserve mess_index(Count1 + 1)
            mess_index(Count1 + 1) = arr_return(Count)
            receiveStr = receiveStr + arr_return(Count)
            If arr_return(Count - 1) = "0" And arr_return(Count) = "D" Then
                flag1 = False
            End If
            Count1 = Count1 + 1
        End If
        Count = Count + 1
    Wend
End Function

Public Function GetData1() As String
    Dim Count As Integer
    Count = 0
    frmMDI.comm.InputLen = 1
    While frmMDI.comm.InBufferCount > 0
        ReDim Preserve arr_return(Count + 1)
        arr_return(Count) = frmMDI.comm.Input
        If Count > 2 Then
            If arr_return(Count - 1) = "O" And arr_return(Count) = "K" Then
                newFlag = True
            End If
        End If
        
        If Count > 4 Then
            If arr_return(Count - 4) = "S" And arr_return(Count - 3) = "M" And arr_return(Count - 1) = "," Then
                newNo(newCount) = arr_return(Count)
                newCount = newCount + 1
            End If
        End If
        Count = Count + 1
    Wend
End Function
Public Function ReadNo() As String
    receiveStr6 = ""
    Dim guoDu As Integer
    On Error Resume Next
    If frmMDI.comm.InBufferCount > 0 Then
        Dim Count As Integer
        Count = 0
        frmMDI.comm.InputLen = 1
        While frmMDI.comm.InBufferCount > 0
            ReDim Preserve mess_index(Count + 1)
            'mess_index(Count) = Hex(frmMDI.comm.Input)
            mess_index(Count) = frmMDI.comm.Input
            receiveStr6 = receiveStr6 + mess_index(Count)
            Count = Count + 1
        Wend
        Count = UBound(mess_index)
        'no = Val("&H" + mess_index(Count - 3))
        no = mess_index(Count - 3)
        Count4 = Val("&H" + mess_index(Count - 3))
        txtczxs.Text = txtczxs.Text + Chr(13) + Chr(10) + "新短信编号:" & no
        frmMDI.comm.Output = "AT+CMGR=" + Hex(no) + Chr(13) + Chr(10)
    End If
End Function
Private Sub cmbSon_Click()
    If cmbSon.Text = "设置蓄电池总电压上限" Then
        txtINFO.Text = "000080FFFF"
    End If
    If cmbSon.Text = "设置蓄电池总电压下限" Then
        txtINFO.Text = "000081FFFF"
    End If
    If cmbSon.Text = "设置蓄电池单体电压上限" Then
        txtINFO.Text = "000082FFFF"
    End If
    If cmbSon.Text = "设置蓄电池单体电压下限" Then
        txtINFO.Text = "000083FFFF"
    End If
    If cmbSon.Text = "电池自检时间长度" Then
        txtINFO.Text = "0000E0FFFF"
    End If
    If cmbSon.Text = "遥控关机延迟时间" Then
        txtINFO.Text = "0000E1FFFF"
    End If
    If cmbSon.Text = "UPS恢复延迟时间" Then
        txtINFO.Text = "0000E2FFFF"
    End If
    If cmbSon.Text = "是否自动重启机" Then
        txtINFO.Text = "0000E3FFFF"
    End If
    If cmbSon.Text = "是否允许均匀设置" Then
        txtINFO.Text = "0000E4FFFF"
    End If
    If cmbSon.Text = "主/从/单机设置" Then
        txtINFO.Text = "0000E5FFFF"
    End If
    If cmbSon.Text = "主从机交替工作时间" Then
        txtINFO.Text = "0000E6FFFF"
    End If
    
    If cmbSon.Text = "切旁路(切到旁路)" Then
        txtINFO.Text = "1001"
    End If
    If cmbSon.Text = "切旁路(切离旁路)" Then
        txtINFO.Text = "1002"
    End If
    If cmbSon.Text = "报警消音" Then
        txtINFO.Text = "2000"
    End If
    If cmbSon.Text = "报警声测试" Then
        txtINFO.Text = "4000"
    End If
    If cmbSon.Text = "电池自检" Then
        txtINFO.Text = "5000"
    End If
    If cmbSon.Text = "取消遥控关机" Then
        txtINFO.Text = "6000"
    End If
    If cmbSon.Text = "取消电池自检" Then
        txtINFO.Text = "7000"
    End If
    If cmbSon.Text = "遥控开机" Then
        txtINFO.Text = "3001"
    End If
    If cmbSon.Text = "遥控立即关机(不关旁路)" Then
        txtINFO.Text = "3002"
    End If
    If cmbSon.Text = "遥控延迟关机(不关旁路)" Then
        txtINFO.Text = "3003"
    End If
    If cmbSon.Text = "遥控紧急关机(关旁路,保留)" Then
        txtINFO.Text = "3004"
    End If
    
    If cmbSon.Text = "获取第一条历史告警命令" Then
        txtINFO.Text = "00"
    End If
    If cmbSon.Text = "收到历史告警正确,要求上送下一条" Then
        txtINFO.Text = "10"
    End If
    If cmbSon.Text = "接收历史告警错误,重发上一条" Then
        txtINFO.Text = "20"
    End If

⌨️ 快捷键说明

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