.
  • 作者:city7cc
  • 积分:4065
  • 等级:专家教授
  • 2019/12/30 13:20:15
  • 中国面包师贴吧-楼主(阅:1981/回:0)VB串口程序4

      Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   4

          Left            =   7800

          TabIndex        =   48

          Top             =   2040

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   3

          Left            =   3000

          TabIndex        =   47

          Top             =   2040

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   2

          Left            =   7800

          TabIndex        =   46

          Top             =   840

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   1

          Left            =   3000

          TabIndex        =   45

          Top             =   840

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   0

          Left            =   3000

          TabIndex        =   44

          Top             =   1440

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   7

          Left            =   8640

          TabIndex        =   19

          Top             =   2640

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   6

          Left            =   3720

          TabIndex        =   18

          Top             =   4080

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   5

          Left            =   8640

          TabIndex        =   17

          Top             =   1440

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   4

          Left            =   8640

          TabIndex        =   16

          Top             =   2040

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   3

          Left            =   3840

          TabIndex        =   15

          Top             =   2040

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   2

          Left            =   8640

          TabIndex        =   14

          Top             =   840

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   1

          Left            =   3840

          TabIndex        =   13

          Top             =   840

          Width           =   615

       End

       Begin VB.Label Factor_label

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H80000005&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "0.0  "

          ForeColor       =   &H00800000&

          Height          =   330

          Index           =   0

          Left            =   3840

          TabIndex        =   12

          Top             =   1440

          Width           =   615

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   7

          Left            =   6720

          TabIndex        =   11

          Top             =   2640

          Width           =   855

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   6

          Left            =   1800

          TabIndex        =   10

          Top             =   4080

          Width           =   855

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   5

          Left            =   6720

          TabIndex        =   9

          Top             =   1440

          Width           =   855

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   4

          Left            =   6720

          TabIndex        =   8

          Top             =   2040

          Width           =   855

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   3

          Left            =   1920

          TabIndex        =   7

          Top             =   2040

          Width           =   855

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   2

          Left            =   6720

          TabIndex        =   6

          Top             =   840

          Width           =   855

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   1

          Left            =   1920

          TabIndex        =   5

          Top             =   840

          Width           =   855

       End

       Begin VB.Label AC_data

          Alignment       =   1  'Right Justify

          Appearance      =   0  'Flat

          BackColor       =   &H00404000&

          BorderStyle     =   1  'Fixed Single

          Caption         =   "000.00 "

          ForeColor       =   &H0000FFFF&

          Height          =   315

          Index           =   0

          Left            =   1920

          TabIndex        =   4

          Top             =   1440

          Width           =   855

       End

    End

    Attribute VB_Name = "Factor_Seting"

    Attribute VB_GlobalNameSpace = False

    Attribute VB_Creatable = False

    Attribute VB_PredeclaredId = True

    Attribute VB_Exposed = False

    Dim hcd(32) As Integer

    Option Explicit

    Private Sub Command1_Click(Index As Integer)

        tx_b(4) = Array(&HF0, 3, &H1, &H78, &H0, &H40, 0, 0, Hour(Time), Minute(Time), Second(Time), 0, 0, 0, 0)

        tx_REQ = 4

    End Sub

    Private Sub Command2_Click(Index As Integer)

        Dim i, sumH, sumL As Integer

        tx_b(16) = Array(&H8, &H10, &H1, &H78, 0, &H8, &H10, Hour(Time), Minute(Time), Second(Time), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

        For i = 0 To 7

            hcd(i) = -VScroll1(i).value

        Next

        hcd(10) = &H34: hcd(11) = &HDA

        For i = 0 To 4

            hcd(10) = hcd(10) Xor hcd(i * 2): hcd(11) = hcd(11) Xor hcd(i * 2 + 1)

        Next

        hcd(12) = &HFF: hcd(13) = &HFF: hcd(14) = &H12: hcd(15) = &H34

        For i = 7 To 7 + 32:        tx_b(16)(i) = hcd(i - 7):    Next

        tx_REQ = 16

        End Sub

    Private Sub Command3_Click()

    Dim i As Integer

        For i = 0 To 7

            If Check0(i).value = 1 And AC_data(i).Caption <> 0 Then

                Label2(i).Caption = Format(((Text0(i).Text - AC_data(i).Caption) / AC_data(i).Caption * 100), "0.0")

    '            If Abs(Val(Label2(i).Caption)) < 12 Then VScroll1(i).value = -Val(Label2(i).Caption) * 10 + VScroll1(i).value

            End If

        Next i

    End Sub

    Private Sub VScroll1_Change(Index As Integer)

        Factor_label(Index).Caption = Format(-VScroll1(Index).value / 10, " 0.0")

    End Sub

    VERSION 5.00

    Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"

    Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx"

    Begin VB.Form mn_form

       BackColor       =   &H00404000&

       BorderStyle     =   1  'Fixed Single

       ClientHeight    =   9795

       ClientLeft      =   45

       ClientTop       =   615

       ClientWidth     =   12735

       FillColor       =   &H00E0E0E0&

       BeginProperty Font

          Name            =   "宋体"

          Size            =   12

          Charset         =   134

          Weight          =   700

          Underline       =   0   'False

          Italic          =   0   'False

          Strikethrough   =   0   'False

       EndProperty

       LinkTopic       =   "Form1"

       ScaleHeight     =   9795

       ScaleWidth      =   12735

       StartUpPosition =   2  '屏幕中心

       WindowState     =   2  'Maximized

       Begin ComctlLib.Toolbar Toolbar1

          Align           =   1  'Align Top

          Height          =   480

          Left            =   0

          TabIndex        =   2

          Top             =   0

          Width           =   12735

          _ExtentX        =   22463

          _ExtentY        =   847

          ButtonWidth     =   714

          ButtonHeight    =   688

          Appearance      =   1

          ImageList       =   "ImageList1"

          _Version        =   327682

          BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7}

             NumButtons      =   8

             BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.ToolTipText     =   "校时"

                Object.Tag             =   ""

                ImageIndex      =   1

             EndProperty

             BeginProperty Button2 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.ToolTipText     =   "轮询"

                Object.Tag             =   ""

                ImageIndex      =   2

                Style           =   1

             EndProperty

             BeginProperty Button3 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.ToolTipText     =   "定值"

                Object.Tag             =   ""

                ImageIndex      =   3

             EndProperty

             BeginProperty Button4 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.ToolTipText     =   "设定"

                Object.Tag             =   ""

                ImageIndex      =   4

             EndProperty

             BeginProperty Button5 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.ToolTipText     =   "分闸"

                Object.Tag             =   ""

                ImageIndex      =   5

             EndProperty

             BeginProperty Button6 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.ToolTipText     =   "合闸"

                Object.Tag             =   ""

                ImageIndex      =   6

             EndProperty

             BeginProperty Button7 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.ToolTipText     =   "内存"

                Object.Tag             =   ""

                ImageIndex      =   7

                Style           =   1

             EndProperty

             BeginProperty Button8 {0713F354-850A-101B-AFC0-4210102A8DA7}

                Object.Tag             =   ""

                Style           =   3

                MixedState      =   -1  'True

             EndProperty

          EndProperty

          OLEDropMode     =   1

          Begin VB.Frame Frame1

             Appearance      =   0  'Flat

             BorderStyle     =   0  'None

             ForeColor       =   &H80000008&

             Height          =   375

             Left            =   9480

             TabIndex        =   3

             Top             =   0

             Width           =   5895

             Begin VB.TextBox RAM_addr1th

                Alignment       =   2  'Center

                Appearance      =   0  'Flat

                ForeColor       =   &H00800000&

                Height          =   375

                Left            =   2400

                TabIndex        =   9

                Text            =   "0"

                Top             =   0

                Width           =   735

             End

             Begin VB.VScrollBar RAM_VScroll1

                Height          =   375

                Left            =   3120

                Max             =   1216

                SmallChange     =   32

                TabIndex        =   8

                Top             =   0

                Width           =   255

             End

             Begin VB.VScrollBar SN_VScroll

                Height          =   375

                Left            =   4440

                Max             =   199

                TabIndex        =   7

                Top             =   0

                value           =   1

                Width           =   255

             End

             Begin VB.TextBox SN_Text

                Alignment       =   2  'Center

                Appearance      =   0  'Flat

                ForeColor       =   &H00800000&

                Height          =   360

                Left            =   3960

                TabIndex        =   6

                Text            =   "01"

                Top             =   0

                Width           =   495

             End

             Begin VB.ComboBox Combo1

                Appearance      =   0  'Flat

                BeginProperty Font

                   Name            =   "System"

                   Size            =   12

                   Charset         =   134

                   Weight          =   700

                   Underline       =   0   'False

                   Italic          =   0   'False

                   Strikethrough   =   0   'False

                EndProperty

                ForeColor       =   &H00800000&

                Height          =   360

                ItemData        =   "Star_M6.frx":0000

                Left            =   4920

                List            =   "Star_M6.frx":000A

                TabIndex        =   4

                Text            =   "COM1"

                Top             =   0

                Width           =   975

             End

          End



    发帖须知:

    1,发帖请遵守《计算机信息网络国际联网安全保护管理办法》、《互联网信息服务管理办法》、 《互联网电子公告服务管理规定》、《维护互联网安全的决定》等法律法规。

    2,请对您的言论负责,我们将保留您的上网记录和发帖信息。

    3,在此发帖表示认同我们的条款,我们有权利对您的言论进行审核、删除或者采取其他在法律、地方法规等条款规定之内的管理操作。
    内容:
    验证: 验证码,看不清楚?请点击刷新验证码 * 匿名发表需要进行验证!
     
           
    中国面包师贴吧-中国烘焙师贴吧- 弹性深蓝色可爱版右侧悬浮qq在线客服代码
    在线咨询 x
    有什么可以帮到您
    点击咨询
    -粤ICP备13040473号-2