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

      Begin VB.Commanon J_ctrl

          Caption         =   "启动A"

          Height          =   615

          Index           =   0

          Left            =   480

          Picture         =   "controlform.frx":2534

          Style           =   1  'Graphical

          TabIndex        =   0

          Top             =   240

          Width           =   975

       End

    End

    Attribute VB_Name = "controlform"

    Attribute VB_GlobalNameSpace = False

    Attribute VB_Creatable = False

    Attribute VB_PredeclaredId = True

    Attribute VB_Exposed = False

    Private Sub J_ctrl_Click(Index As Integer)

    If Index < 5 Then                                   '继电器

        tx_b(16) = Array(0, 0, &H0, &HD2, &H0, &H1, &H2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

        tx_b(16)(7) = (Index + 1) * 17

        tx_b(16)(8) = (Index + 1) * 17

    '    tx_b(16)(14 + 8) = 40

    Else                                                '校时

        ts = d_BCD(Second(Time)):   tm = d_BCD(Minute(Time)):   th = d_BCD(Hour(Time))

        dd = d_BCD(Day(Date)):      dM = d_BCD(Month(Date)):    dY = d_BCD(Year(Date) Mod 100)

        tx_b(16) = Array(0, 0, &H0, &HD8, &H0, &H4, &H8, dY, dM, dd, th, tm, ts, &H12, &H34, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

    End If

    tx_REQ = 16                                         '0x10 命令

    End Sub

    VERSION 5.00

    Begin VB.Form Factor_Seting

       Appearance      =   0  'Flat

       BorderStyle     =   3  'Fixed Dialog

       Caption         =   "通道校正系数"

       ClientHeight    =   2400

       ClientLeft      =   1980

       ClientTop       =   4365

       ClientWidth     =   11895

       BeginProperty Font

          Name            =   "System"

          Size            =   12

          Charset         =   134

          Weight          =   700

          Underline       =   0   'False

          Italic          =   0   'False

          Strikethrough   =   0   'False

       EndProperty

       LinkTopic       =   "Form1"

       MaxButton       =   0   'False

       MinButton       =   0   'False

       Picture         =   "Factor_seting.frx":0000

       ScaleHeight     =   2400

       ScaleWidth      =   11895

       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.frx":0342

          Style           =   1  'Graphical

          TabIndex        =   1

          Top             =   600

          Width           =   375

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   7

          Left            =   5880

          TabIndex        =   42

          Text            =   "0.0"

          Top             =   1200

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   6

          Left            =   5880

          TabIndex        =   41

          Text            =   "0.0"

          Top             =   720

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   5

          Left            =   5880

          TabIndex        =   40

          Text            =   "0.0"

          Top             =   240

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   4

          Left            =   1080

          TabIndex        =   39

          Text            =   "0.0"

          Top             =   240

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   3

          Left            =   1080

          TabIndex        =   38

          Text            =   "0.0"

          Top             =   720

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   2

          Left            =   1080

          TabIndex        =   37

          Text            =   "0.0"

          Top             =   1200

          Width           =   735

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   1

          Left            =   1080

          TabIndex        =   36

          Text            =   "0.0"

          Top             =   1680

          Width           =   735

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   7

          Left            =   5520

          TabIndex        =   35

          Top             =   1320

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   6

          Left            =   5520

          TabIndex        =   34

          Top             =   840

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   5

          Left            =   5520

          TabIndex        =   33

          Top             =   360

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   4

          Left            =   720

          TabIndex        =   32

          Top             =   360

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   3

          Left            =   720

          TabIndex        =   31

          Top             =   840

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   255

          Index           =   2

          Left            =   720

          TabIndex        =   30

          Top             =   1320

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   1

          Left            =   720

          TabIndex        =   29

          Top             =   1800

          Width           =   255

       End

       Begin VB.CheckBox Check0

          Caption         =   "Check1"

          Height          =   225

          Index           =   0

          Left            =   5520

          TabIndex        =   28

          Top             =   1800

          Width           =   255

       End

       Begin VB.TextBox Text0

          Alignment       =   2  'Center

          Height          =   360

          Index           =   0

          Left            =   5880

          TabIndex        =   27

          Text            =   "0.0"

          Top             =   1680

          Width           =   735

       End

       Begin VB.Commanon command3

          Caption         =   "计算"

          Height          =   495

          Left            =   10080

          TabIndex        =   26

          Top             =   1560

          Width           =   855

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   7

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   25

          Top             =   1200

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   6

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   24

          Top             =   720

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   5

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   23

          Top             =   240

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   4

          Left            =   4440

          Max             =   127

          Min             =   -127

          TabIndex        =   22

          Top             =   240

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   3

          Left            =   4440

          Max             =   127

          Min             =   -127

          TabIndex        =   21

          Top             =   720

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   2

          Left            =   4440

          Max             =   127

          Min             =   -127

          TabIndex        =   20

          Top             =   1200

          Width           =   255

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   1

          Left            =   4440

          Max             =   127

          Min             =   -127

          TabIndex        =   19

          Top             =   1680

          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.frx":06CC

          Style           =   1  'Graphical

          TabIndex        =   2

          Top             =   600

          Width           =   375

       End

       Begin VB.VScrollBar VScroll1

          Height          =   345

          Index           =   0

          Left            =   9240

          Max             =   127

          Min             =   -127

          TabIndex        =   0

          Top             =   1680

          Width           =   255

       End

       Begin VB.Label Label9

          Caption         =   "Ua"

          Height          =   255

          Left            =   360

          TabIndex        =   58

          Top             =   360

          Width           =   405

       End

       Begin VB.Label Label13

          Caption         =   "Ipa"

          Height          =   255

          Left            =   5160

          TabIndex        =   57

          Top             =   360

          Width           =   405

       End

       Begin VB.Label Label12

          Caption         =   "Ub"

          Height          =   255

          Left            =   360

          TabIndex        =   56

          Top             =   840

          Width           =   405

       End

       Begin VB.Label Label11

          Caption         =   "Ia"

          Height          =   255

          Left            =   360

          TabIndex        =   55

          Top             =   1800

          Width           =   405

       End

       Begin VB.Label Label10

          Caption         =   "Ipb"

          Height          =   255

          Left            =   5160

          TabIndex        =   54

          Top             =   840

          Width           =   405

       End

       Begin VB.Label Label8

          Caption         =   "Uc"

          Height          =   255

          Left            =   360

          TabIndex        =   53

          Top             =   1320

          Width           =   405

       End

       Begin VB.Label Label7

          Caption         =   "Ic"

          Height          =   255

          Left            =   5160

          TabIndex        =   52

          Top             =   1800

          Width           =   405

       End

       Begin VB.Label Label4

          Caption         =   "Ipc"

          Height          =   255

          Left            =   5160

          TabIndex        =   51

          Top             =   1320

          Width           =   405

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   7

          Left            =   7800

          TabIndex        =   50

          Top             =   1200

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   6

          Left            =   7800

          TabIndex        =   49

          Top             =   720

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   5

          Left            =   7800

          TabIndex        =   48

          Top             =   240

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   4

          Left            =   3000

          TabIndex        =   47

          Top             =   240

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   3

          Left            =   3000

          TabIndex        =   46

          Top             =   720

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   2

          Left            =   3000

          TabIndex        =   45

          Top             =   1200

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   1

          Left            =   3000

          TabIndex        =   44

          Top             =   1680

          Width           =   615

       End

       Begin VB.Label Label2

          Alignment       =   2  'Center

          BackColor       =   &H80000005&

          Caption         =   "0.0"

          Height          =   330

          Index           =   0

          Left            =   7800

          TabIndex        =   43

          Top             =   1680

          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        =   18

          Top             =   1200

          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            =   8640

          TabIndex        =   17

          Top             =   720

          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        =   16

          Top             =   240

          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            =   3840

          TabIndex        =   15

          Top             =   240

          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        =   14

          Top             =   720

          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            =   3840

          TabIndex        =   13

          Top             =   1200

          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        =   12

          Top             =   1680

          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            =   8640

          TabIndex        =   11

          Top             =   1680

          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        =   10

          Top             =   1200

          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            =   6720

          TabIndex        =   9

          Top             =   720

          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        =   8

          Top             =   240

          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            =   1920

          TabIndex        =   7

          Top             =   240

          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        =   6

          Top             =   720

          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            =   1920

          TabIndex        =   5

          Top             =   1200

          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        =   4

          Top             =   1680

          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            =   6720

          TabIndex        =   3

          Top             =   1680

          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

    Option Explicit

    Private Sub Command1_Click(Index As Integer)

        Dim i, x As Single

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

        tx_REQ = 4

    End Sub



    发帖须知:

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

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

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