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

📄 frmcb900k.frm

📁 电子皮带秤管理软件,绝对超值
💻 FRM
📖 第 1 页 / 共 4 页
字号:
            AutoSize        =   -1  'True
            Caption         =   "累重:"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   2
            Left            =   1290
            TabIndex        =   54
            Top             =   2520
            Width           =   720
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "T"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   3
            Left            =   4245
            TabIndex        =   53
            Top             =   2535
            Width           =   120
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "t/H"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   4
            Left            =   4140
            TabIndex        =   52
            Top             =   2055
            Width           =   360
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "m/s"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   5
            Left            =   4170
            TabIndex        =   51
            Top             =   1380
            Width           =   360
         End
         Begin VB.Label Label6 
            Caption         =   "状态:"
            Height          =   510
            Index           =   0
            Left            =   120
            TabIndex        =   50
            Top             =   435
            Width           =   600
         End
         Begin VB.Label Label7 
            Caption         =   "停机!"
            ForeColor       =   &H000000FF&
            Height          =   270
            Index           =   0
            Left            =   870
            TabIndex        =   49
            Top             =   435
            Width           =   1125
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "KG"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   6
            Left            =   4260
            TabIndex        =   48
            Top             =   750
            Width           =   240
         End
         Begin VB.Label Label3 
            AutoSize        =   -1  'True
            Caption         =   "皮重:"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   240
            Index           =   7
            Left            =   1320
            TabIndex        =   47
            Top             =   795
            Width           =   720
         End
      End
      Begin VB.Timer Timer2 
         Enabled         =   0   'False
         Interval        =   20000
         Left            =   450
         Top             =   -120
      End
      Begin VB.TextBox Text1 
         Height          =   345
         Left            =   2520
         TabIndex        =   3
         Top             =   240
         Width           =   2430
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "通讯设置"
      Height          =   7305
      Left            =   135
      TabIndex        =   0
      Top             =   60
      Width           =   3810
      Begin VB.CommandButton Command11 
         Caption         =   "测试通信"
         Height          =   525
         Left            =   1800
         TabIndex        =   40
         Top             =   4485
         Width           =   1290
      End
      Begin VB.Frame Frame9 
         Caption         =   "仪表参数"
         Height          =   1365
         Left            =   240
         TabIndex        =   29
         Top             =   2685
         Width           =   2835
         Begin VB.TextBox Text4 
            Height          =   375
            Index           =   1
            Left            =   1155
            TabIndex        =   33
            Text            =   "150"
            Top             =   780
            Width           =   1170
         End
         Begin VB.TextBox Text4 
            Height          =   375
            Index           =   0
            Left            =   1170
            TabIndex        =   31
            Text            =   "1.6"
            Top             =   270
            Width           =   1170
         End
         Begin VB.Label Label9 
            Caption         =   "T/h"
            Height          =   285
            Index           =   1
            Left            =   2430
            TabIndex        =   35
            Top             =   810
            Width           =   285
         End
         Begin VB.Label Label9 
            Caption         =   "m/s"
            Height          =   285
            Index           =   0
            Left            =   2445
            TabIndex        =   34
            Top             =   330
            Width           =   285
         End
         Begin VB.Label Label8 
            Caption         =   "最大流量:"
            Height          =   375
            Index           =   1
            Left            =   105
            TabIndex        =   32
            Top             =   825
            Width           =   960
         End
         Begin VB.Label Label8 
            Caption         =   "平均速度:"
            Height          =   375
            Index           =   0
            Left            =   120
            TabIndex        =   30
            Top             =   345
            Width           =   960
         End
      End
      Begin VB.Frame Frame8 
         Caption         =   "通信参数"
         Height          =   930
         Left            =   285
         TabIndex        =   26
         Top             =   1545
         Width           =   2790
         Begin VB.ComboBox Combo2 
            Height          =   300
            ItemData        =   "Frmcb900k.frx":0442
            Left            =   1170
            List            =   "Frmcb900k.frx":0455
            TabIndex        =   27
            Text            =   "2400"
            Top             =   375
            Width           =   1110
         End
         Begin VB.Label Label1 
            Caption         =   "波特率:"
            Height          =   315
            Index           =   1
            Left            =   120
            TabIndex        =   28
            Top             =   420
            Width           =   795
         End
      End
      Begin VB.Frame Frame5 
         Caption         =   "计算机"
         Height          =   1020
         Left            =   345
         TabIndex        =   7
         Top             =   240
         Width           =   2745
         Begin VB.ComboBox Combo3 
            Height          =   300
            Left            =   1200
            TabIndex        =   9
            Text            =   "1"
            Top             =   435
            Width           =   1020
         End
         Begin VB.Label Label1 
            Caption         =   "串口号:"
            Height          =   315
            Index           =   0
            Left            =   195
            TabIndex        =   8
            Top             =   465
            Width           =   765
         End
      End
      Begin VB.Frame Frame4 
         Caption         =   "校秤功能"
         Height          =   1440
         Left            =   210
         TabIndex        =   4
         Top             =   5745
         Width           =   3330
         Begin VB.CommandButton Command12 
            Caption         =   "开始校秤"
            Height          =   615
            Left            =   1770
            TabIndex        =   80
            Top             =   555
            Width           =   1185
         End
         Begin VB.ComboBox Combo1 
            Height          =   300
            Left            =   165
            TabIndex        =   6
            Text            =   "1"
            Top             =   795
            Width           =   1095
         End
         Begin VB.Label Label1 
            Caption         =   "地址:"
            Height          =   315
            Index           =   2
            Left            =   165
            TabIndex        =   5
            Top             =   390
            Width           =   765
         End
      End
      Begin VB.CommandButton Command1 
         Caption         =   "加载"
         Height          =   540
         Left            =   255
         TabIndex        =   2
         Top             =   4485
         Width           =   1365
      End
   End
   Begin VB.Menu mnuDataView 
      Caption         =   "数据分析"
      Begin VB.Menu mnuView 
         Caption         =   "数据浏览"
      End
      Begin VB.Menu mnuOp1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuExit 
         Caption         =   "退出"
      End
   End
End
Attribute VB_Name = "FrmShow"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Tmpid As Integer
Dim CommMode As Boolean
Dim Ytime As Long
Dim N1 As Integer
Dim N2 As Integer
Dim N3 As Integer
Dim ScaleState(6) As Boolean
Dim Tmpstr As String
Dim Outdata As String
'Dim ReadData(10) As String
Dim TestAL As String

Private Declare Function GetTickCount Lib "kernel32" () As Long

Sub TimeDelay(t As Long)
Dim TT&
    TT = GetTickCount()
    Do
     DoEvents
    Loop Until GetTickCount() - TT >= t
End Sub

Function Send(str As String) As String
Dim tmp As String
Dim MidStr As String
Dim i As Integer

On Error Resume Next
tmp = UCase(Trim(str))
 i = InStr(tmp, "ID")
 If i > 0 Then
   MidStr = Mid(tmp, i, 4)
   MSComm1.Output = Chr(5) + MidStr + vbCrLf
 Else
 
   MSComm1.Output = tmp + vbCrLf           ' Constr(tmp)   ' + vbCrLf
 
 End If

 TimeDelay Ytime
 
 If MSComm1.InBufferCount > 0 Then
       Text1.Text = ""
       Text1.Text = Text1.Text + MSComm1.Input
       Send = Trim(IsNum(Text1.Text))
 End If
    
 End Function


Private Sub Combo4_Change(Index As Integer)
Dim i As Integer
For i = 1 To 10

 Combo4(0).AddItem i
 Combo4(1).AddItem i
Next
End Sub

Private Sub Command1_Click()
 Setcomm
End Sub

Private Sub Command10_Click(Index As Integer)

  If Command10(Index).Caption = "启动" Then
   
     Command12.Enabled = False
     ScaleState(Index) = True
       
     Command10(Index).Caption = "结束"
     Timer1.Enabled = True
  Else
     ScaleState(Index) = False
     Command10(Index).Caption = "启动"
      If Command10(0).Caption = Command10(1).Caption Then
            Command12.Enabled = True
      End If
  End If

End Sub

Private Sub Command11_Click()
Dim tmp As String
Dim Tmpid As String

tmp = "\ENQID0" & Trim(Combo1.Text)
Tmpid = Format(Combo1.Text, "00")
If Send(tmp) = Tmpid Then
     StatusBar1.Panels(4).Text = Combo1.Text & "地址已经打开!"
  Else
     StatusBar1.Panels(4).Text = Combo1.Text & "地址不能打开!"
 End If
End Sub

Private Sub Command12_Click()
Dim tmp As String
Dim Tmpid As String

 If Command12.Caption = "开始校秤" Then
        Command3.Enabled = True
        Command4.Enabled = True
        Command8.Enabled = True
        Command9.Enabled = True
        Command10(0).Enabled = False
        Command10(1).Enabled = False
        Command12.Caption = "停止校秤"

⌨️ 快捷键说明

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