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

    Private Sub Command2_Click(Index As Integer)

        Dim i, sumL, sumH As Integer

        tx_b(4) = Array(&H68, 28, 28, &H68, &H40, 0, 4, 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)

        sumL = 0

        sumH = 0

        For i = 0 To 7

            tx_b(4)(i + 8) = -VScroll1(Index * 8 + i).value

            If i Mod 2 = 0 Then

                sumL = sumL Xor tx_b(4)(i + 8)

            Else

                sumH = sumH Xor tx_b(4)(i + 8)

            End If

        Next

        tx_b(4)(20) = 0                     'ID

        tx_b(4)(21) = &HFF

        sumL = sumL Xor tx_b(4)(20)

        sumH = sumH Xor tx_b(4)(21)

        tx_b(4)(22) = 0

        tx_b(4)(23) = &H9A                  'switch

        sumL = sumL Xor tx_b(4)(22)

        sumH = sumH Xor tx_b(4)(23)

        tx_b(4)(24) = 255 - Abs(tx_b(4)(8))      'para1 bk

        tx_b(4)(25) = 255 - Abs(tx_b(4)(9))

        tx_b(4)(26) = sumL Xor tx_b(4)(24)

        tx_b(4)(27) = sumH Xor tx_b(4)(25)

        tx_REQ = 4

    End Sub

    Private Sub Command3_Click()

    Dim i As Integer

        For i = 0 To 7

            If Check0(i).value = 1 Then

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

                VScroll1(i).value = -Label2(i).Caption * 10 + VScroll1(i).value

            End If

        Next i

        Command2_Click (0)

    End Sub

    Private Sub Command4_Click()

        Factor_Seting.Hide

    End Sub

    Private Sub Form_Load()

        Dim i As Integer, KeyName As String

    For i = 0 To 7

        KeyName = "Text0(" & i & ")" & ".Text"

        Text0(i).Text = GetSetting(App.Title, Me.Name, KeyName, "0.00")   '读取设置

    Next i

        tx_b(3) = Array(&H68, 4, 4, &H68, &H40, 0, 3, 11, 7, 7)

       ' End If

        tx_REQ = 3

    End Sub

    Private Sub Form_Unload(Cancel As Integer)

    Dim i As Integer, KeyName As String

    For i = 0 To 7

       KeyName = "Text0(" & i & ")" & ".Text"

       Call SaveSetting(App.Title, Me.Name, KeyName, Me.Text0(i).Text)   '存储设置

    Next i

    End Sub

    Private Sub VScroll1_Change(Index As Integer)

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

    End Sub

    '3号命令-上传系数定值   group10-12

    Private Sub VScroll2_Change(Index As Integer)

    Dim x As Single

        x = VScroll2(Index).value:  x = x / 10:   Text0(Index).Text = Format(x, "#0.0 ")

    End Sub

    VERSION 5.00

    Begin VB.Form Factor_Seting

       Appearance      =   0  'Flat

       BorderStyle     =   1  'Fixed Single

       Caption         =   "电力系数校正"

       ClientHeight    =   3270

       ClientLeft      =   1980

       ClientTop       =   4365

       ClientWidth     =   11385

       BeginProperty Font

          Name            =   "System"

          Size            =   12

          Charset         =   134

          Weight          =   700

          Underline       =   0   'False

          Italic          =   0   'False

          Strikethrough   =   0   'False

       EndProperty

       Icon            =   "Factor_seting_bk.frx":0000

       LinkTopic       =   "Form1"

       MaxButton       =   0   'False

       MinButton       =   0   'False

       Picture         =   "Factor_seting_bk.frx":038A

       ScaleHeight     =   3270

       ScaleWidth      =   11385

       Begin VB.Commanon Command3

          Caption         =   "计算"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   400

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   615

          Left            =   9960

          Picture         =   "Factor_seting_bk.frx":06CC

          Style           =   1  'Graphical

          TabIndex        =   74

          Top             =   1920

          Width           =   975

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   15

          Left            =   2160

          Max             =   256

          Min             =   -127

          TabIndex        =   65

          Top             =   5160

          value           =   256

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   14

          Left            =   1920

          Max             =   256

          Min             =   -127

          TabIndex        =   1

          Top             =   5160

          value           =   87

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   13

          Left            =   1680

          Max             =   256

          Min             =   -127

          TabIndex        =   64

          Top             =   5160

          value           =   256

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   12

          Left            =   1440

          Max             =   127

          Min             =   -127

          TabIndex        =   63

          Top             =   5160

          value           =   1

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   11

          Left            =   1200

          Max             =   127

          Min             =   -127

          TabIndex        =   62

          Top             =   5160

          value           =   1

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   10

          Left            =   960

          Max             =   127

          Min             =   -127

          TabIndex        =   61

          Top             =   5160

          value           =   1

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   9

          Left            =   720

          Max             =   127

          Min             =   -127

          TabIndex        =   60

          Top             =   5160

          value           =   1

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   8

          Left            =   480

          Max             =   127

          Min             =   -127

          TabIndex        =   59

          Top             =   5160

          value           =   1

          Width           =   255

       End

       Begin VB.Commanon Command1

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   400

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   0

          Left            =   9840

          Picture         =   "Factor_seting_bk.frx":0A56

          Style           =   1  'Graphical

          TabIndex        =   2

          Top             =   1200

          Width           =   375

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   7

          Left            =   5880

          TabIndex        =   42

          Text            =   "0.0"

          Top             =   2640

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   6

          Left            =   960

          TabIndex        =   41

          Text            =   "0.0"

          Top             =   4080

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   5

          Left            =   5880

          TabIndex        =   40

          Text            =   "0.0"

          Top             =   1440

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   4

          Left            =   5880

          TabIndex        =   39

          Text            =   "0.0"

          Top             =   2040

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   3

          Left            =   1080

          TabIndex        =   38

          Text            =   "0.0"

          Top             =   2040

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   2

          Left            =   5880

          TabIndex        =   37

          Text            =   "0.0"

          Top             =   840

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   1

          Left            =   1080

          TabIndex        =   36

          Text            =   "0.0"

          Top             =   840

          Width           =   735

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   7

          Left            =   5520

          TabIndex        =   35

          Top             =   2760

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   6

          Left            =   600

          TabIndex        =   34

          Top             =   4200

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   5

          Left            =   5520

          TabIndex        =   33

          Top             =   1560

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   4

          Left            =   5520

          TabIndex        =   32

          Top             =   2160

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   3

          Left            =   720

          TabIndex        =   31

          Top             =   2160

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   255

          Index           =   2

          Left            =   5520

          TabIndex        =   30

          Top             =   960

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   1

          Left            =   720

          TabIndex        =   29

          Top             =   960

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   0

          Left            =   720

          TabIndex        =   28

          Top             =   1560

          Width           =   255

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   0

          Left            =   1080

          TabIndex        =   27

          Text            =   "0.0"

          Top             =   1440

          Width           =   735

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   7

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   26

          Top             =   2640

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   6

          Left            =   4320

          Max             =   127

          Min             =   -127

          TabIndex        =   25

          Top             =   4080

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   5

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   24

          Top             =   1440

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   4

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   23

          Top             =   2040

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   3

          Left            =   4440

          Max             =   127

          Min             =   -127

          TabIndex        =   22

          Top             =   2040

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   2

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   21

          Top             =   840

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   1

          Left            =   4440

          Max             =   127

          Min             =   -127

          TabIndex        =   20

          Top             =   840

          Width           =   255

       End

       Begin VB.Commanon Command2

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   400

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   0

          Left            =   10560

          Picture         =   "Factor_seting_bk.frx":0DE0

          Style           =   1  'Graphical

          TabIndex        =   3

          Top             =   1200

          Width           =   375

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   0

          Left            =   4440

          Max             =   127

          Min             =   -127

          TabIndex        =   0

          Top             =   1440

          Width           =   255

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "校正系数"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   7

          Left            =   8640

          TabIndex        =   73

          Top             =   360

          Width           =   975

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "推荐系数"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   6

          Left            =   7680

          TabIndex        =   72

          Top             =   360

          Width           =   855

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "实测值"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   5

          Left            =   6720

          TabIndex        =   71

          Top             =   360

          Width           =   735

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "标准值"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   4

          Left            =   5880

          TabIndex        =   70

          Top             =   360

          Width           =   735

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "校正系数"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   3

          Left            =   3840

          TabIndex        =   69

          Top             =   360

          Width           =   975

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "推荐系数"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   2

          Left            =   2880

          TabIndex        =   68

          Top             =   360

          Width           =   855

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "实测值"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   1

          Left            =   1920

          TabIndex        =   67

          Top             =   360

          Width           =   735

       End

       Begin VB.Label Label1

          Alignment       =   2  'Center

          BackStyle       =   0  'Transparent

          Caption         =   "标准值"

          BeginProperty Font

             Name            =   "宋体"

             Size            =   9

             Charset         =   134

             Weight          =   700

             Underline       =   0   'False

             Italic          =   0   'False

             Strikethrough   =   0   'False

          EndProperty

          Height          =   375

          Index           =   0

          Left            =   1080

          TabIndex        =   66

          Top             =   360

          Width           =   735

       End

       Begin VB.Label Label9

          Caption         =   "Ib"

          Height          =   255

          Left            =   360

          TabIndex        =   58

          Top             =   1560

          Width           =   405

       End

       Begin VB.Label Label13

          Caption         =   "Ia"

          Height          =   255

          Left            =   360

          TabIndex        =   57

          Top             =   960

          Width           =   405

       End

       Begin VB.Label Label12

          Caption         =   "Uab"

          Height          =   255

          Left            =   5040

          TabIndex        =   56

          Top             =   960

          Width           =   405

       End

       Begin VB.Label Label11

          Caption         =   "U0"

          Height          =   255

          Left            =   240

          TabIndex        =   55

          Top             =   4200

          Width           =   405

       End

       Begin VB.Label Label10

          Caption         =   "Ic"

          Height          =   255

          Left            =   360

          TabIndex        =   54

          Top             =   2160

          Width           =   405

       End

       Begin VB.Label Label8

          Caption         =   "Ija"

          Height          =   255

          Left            =   5040

          TabIndex        =   53

          Top             =   2160

          Width           =   405

       End

       Begin VB.Label Label7

          Caption         =   "Ijc"

          Height          =   255

          Left            =   5040

          TabIndex        =   52

          Top             =   2760

          Width           =   405

       End

       Begin VB.Label Label4

          Caption         =   "Ubc"

          Height          =   255

          Left            =   5040

          TabIndex        =   51

          Top             =   1560

          Width           =   405

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   7

          Left            =   7800

          TabIndex        =   50

          Top             =   2640

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   6

          Left            =   2880

          TabIndex        =   49

          Top             =   4080

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   5

          Left            =   7800

          TabIndex        =   48

          Top             =   1440

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   4

          Left            =   7800

          TabIndex        =   47

          Top             =   2040

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   3

          Left            =   3000

          TabIndex        =   46

          Top             =   2040

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   2

          Left            =   7800

          TabIndex        =   45

          Top             =   840

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   1

          Left            =   3000

          TabIndex        =   44

          Top             =   840

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   0

          Left            =   3000

          TabIndex        =   43

          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 Check0_Click(Index As Integer)

    If Check0(1).value = 1 Then

    AAA = "128"

    ElseIf Check0(0).value = 1 Then

    AAA = "128"

    ElseIf Check0(3).value = 1 Then

    AAA = "128"

    ElseIf Check0(2).value = 1 Then

    AAA = "128"

    ElseIf Check0(5).value = 1 Then

    AAA = "128"

    ElseIf Check0(4).value = 1 Then

    AAA = "128"

    ElseIf Check0(7).value = 1 Then

    AAA = "128"

    Else

    AAA = BBB

    End If

    End Sub

    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

    Begin VB.Form frmAbout

       BorderStyle     =   3  'Fixed Dialog

       Caption         =   "电动机保护器调试软件"

       ClientHeight    =   3555

       ClientLeft      =   2340

       ClientTop       =   1935

       ClientWidth     =   5730

       ClipControls    =   0   'False

       Icon            =   "frmAbout.frx":0000

       LinkTopic       =   "Form2"

       MaxButton       =   0   'False

       MinButton       =   0   'False

       ScaleHeight     =   2453.724

       ScaleMode       =   0  'User

       ScaleWidth      =   5380.766

       ShowInTaskbar   =   0   'False

       Begin VB.PictureBox picIcon

          AutoSize        =   -1  'True

          ClipControls    =   0   'False

          Height          =   540

          Left            =   240

          Picture         =   "frmAbout.frx":08CA

          ScaleHeight     =   337.12

          ScaleMode       =   0  'User

          ScaleWidth      =   337.12

          TabIndex        =   1

          Top             =   240

          Width           =   540

       End



    发帖须知:

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

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

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