Form1.frm
上传用户:guilu56566
上传日期:2021-04-07
资源大小:1585k
文件大小:33k
源码类别:

家庭/个人应用

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
  3. Begin VB.Form zngk 
  4.    Caption         =   "智能工控——董跃鹏"
  5.    ClientHeight    =   8940
  6.    ClientLeft      =   60
  7.    ClientTop       =   420
  8.    ClientWidth     =   11955
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    Picture         =   "Form1.frx":0000
  12.    ScaleHeight     =   447
  13.    ScaleMode       =   2  'Point
  14.    ScaleWidth      =   597.75
  15.    Begin VB.CommandButton Command1 
  16.       Caption         =   "系统说明"
  17.       Height          =   495
  18.       Left            =   5400
  19.       TabIndex        =   53
  20.       Top             =   4560
  21.       Width           =   1095
  22.    End
  23.    Begin VB.TextBox Text1 
  24.       BackColor       =   &H00FFFFFF&
  25.       ForeColor       =   &H00000000&
  26.       Height          =   375
  27.       Left            =   5880
  28.       TabIndex        =   51
  29.       Top             =   3480
  30.       Width           =   615
  31.    End
  32.    Begin VB.CommandButton Command2 
  33.       Caption         =   "建立通信"
  34.       Height          =   495
  35.       Left            =   5400
  36.       TabIndex        =   50
  37.       Top             =   3960
  38.       Width           =   1095
  39.    End
  40.    Begin VB.CommandButton m11 
  41.       Caption         =   "开"
  42.       Height          =   375
  43.       Index           =   6
  44.       Left            =   8520
  45.       TabIndex        =   49
  46.       Top             =   6960
  47.       Width           =   735
  48.    End
  49.    Begin VB.CommandButton m11 
  50.       Caption         =   "开"
  51.       Height          =   375
  52.       Index           =   5
  53.       Left            =   8520
  54.       TabIndex        =   48
  55.       Top             =   6360
  56.       Width           =   735
  57.    End
  58.    Begin VB.CommandButton m11 
  59.       Caption         =   "开"
  60.       Height          =   375
  61.       Index           =   4
  62.       Left            =   8520
  63.       TabIndex        =   47
  64.       Top             =   5760
  65.       Width           =   735
  66.    End
  67.    Begin VB.CommandButton m11 
  68.       Caption         =   "开"
  69.       Height          =   375
  70.       Index           =   3
  71.       Left            =   8520
  72.       TabIndex        =   46
  73.       Top             =   5160
  74.       Width           =   735
  75.    End
  76.    Begin VB.CommandButton m11 
  77.       Caption         =   "开"
  78.       Height          =   375
  79.       Index           =   2
  80.       Left            =   8520
  81.       TabIndex        =   45
  82.       Top             =   4560
  83.       Width           =   735
  84.    End
  85.    Begin VB.CommandButton m11 
  86.       Caption         =   "开"
  87.       Height          =   375
  88.       Index           =   1
  89.       Left            =   8520
  90.       TabIndex        =   44
  91.       Top             =   3960
  92.       Width           =   735
  93.    End
  94.    Begin VB.CommandButton d10 
  95.       Caption         =   "开"
  96.       Height          =   375
  97.       Index           =   6
  98.       Left            =   2640
  99.       TabIndex        =   43
  100.       Top             =   6840
  101.       Width           =   735
  102.    End
  103.    Begin VB.CommandButton d10 
  104.       Caption         =   "开"
  105.       Height          =   375
  106.       Index           =   5
  107.       Left            =   2640
  108.       TabIndex        =   42
  109.       Top             =   6240
  110.       Width           =   735
  111.    End
  112.    Begin VB.CommandButton d10 
  113.       Caption         =   "开"
  114.       Height          =   375
  115.       Index           =   4
  116.       Left            =   2640
  117.       TabIndex        =   41
  118.       Top             =   5640
  119.       Width           =   735
  120.    End
  121.    Begin VB.CommandButton d10 
  122.       Caption         =   "开"
  123.       Height          =   375
  124.       Index           =   3
  125.       Left            =   2640
  126.       TabIndex        =   40
  127.       Top             =   5040
  128.       Width           =   735
  129.    End
  130.    Begin VB.CommandButton d10 
  131.       Caption         =   "开"
  132.       Height          =   375
  133.       Index           =   2
  134.       Left            =   2640
  135.       TabIndex        =   39
  136.       Top             =   4440
  137.       Width           =   735
  138.    End
  139.    Begin VB.CommandButton d10 
  140.       Caption         =   "开"
  141.       Height          =   375
  142.       Index           =   1
  143.       Left            =   2640
  144.       TabIndex        =   38
  145.       Top             =   3840
  146.       Width           =   735
  147.    End
  148.    Begin VB.CommandButton m11 
  149.       Caption         =   "开"
  150.       Height          =   375
  151.       Index           =   0
  152.       Left            =   8520
  153.       TabIndex        =   25
  154.       Top             =   3360
  155.       Width           =   735
  156.    End
  157.    Begin VB.CommandButton sz2 
  158.       Caption         =   "设置"
  159.       Height          =   375
  160.       Left            =   6840
  161.       TabIndex        =   22
  162.       Top             =   7560
  163.       Width           =   4095
  164.    End
  165.    Begin VB.CommandButton d10 
  166.       Caption         =   "开"
  167.       Height          =   375
  168.       Index           =   0
  169.       Left            =   2640
  170.       TabIndex        =   6
  171.       Top             =   3240
  172.       Width           =   735
  173.    End
  174.    Begin VB.CommandButton sz1 
  175.       Caption         =   "设置"
  176.       Height          =   375
  177.       Left            =   960
  178.       TabIndex        =   1
  179.       Top             =   7560
  180.       Width           =   4095
  181.    End
  182.    Begin MSCommLib.MSComm MSComm1 
  183.       Left            =   5640
  184.       Top             =   2760
  185.       _ExtentX        =   1005
  186.       _ExtentY        =   1005
  187.       _Version        =   393216
  188.       DTREnable       =   -1  'True
  189.    End
  190.    Begin VB.Label Label7 
  191.       Alignment       =   2  'Center
  192.       BackStyle       =   0  'Transparent
  193.       BorderStyle     =   1  'Fixed Single
  194.       Caption         =   "端口"
  195.       Height          =   375
  196.       Left            =   5400
  197.       TabIndex        =   52
  198.       Top             =   3480
  199.       Width           =   495
  200.    End
  201.    Begin VB.Label m7 
  202.       AutoSize        =   -1  'True
  203.       BackStyle       =   0  'Transparent
  204.       Caption         =   "门7"
  205.       BeginProperty Font 
  206.          Name            =   "宋体"
  207.          Size            =   15
  208.          Charset         =   134
  209.          Weight          =   400
  210.          Underline       =   -1  'True
  211.          Italic          =   0   'False
  212.          Strikethrough   =   0   'False
  213.       EndProperty
  214.       ForeColor       =   &H00FFFFFF&
  215.       Height          =   300
  216.       Left            =   6960
  217.       TabIndex        =   37
  218.       Top             =   6960
  219.       Width           =   450
  220.    End
  221.    Begin VB.Label m72 
  222.       AutoSize        =   -1  'True
  223.       BackColor       =   &H000000FF&
  224.       Caption         =   "关"
  225.       BeginProperty Font 
  226.          Name            =   "宋体"
  227.          Size            =   15
  228.          Charset         =   134
  229.          Weight          =   400
  230.          Underline       =   -1  'True
  231.          Italic          =   0   'False
  232.          Strikethrough   =   0   'False
  233.       EndProperty
  234.       ForeColor       =   &H00FFFFFF&
  235.       Height          =   300
  236.       Left            =   10080
  237.       TabIndex        =   36
  238.       Top             =   6960
  239.       Width           =   300
  240.    End
  241.    Begin VB.Label m6 
  242.       AutoSize        =   -1  'True
  243.       BackStyle       =   0  'Transparent
  244.       Caption         =   "门6"
  245.       BeginProperty Font 
  246.          Name            =   "宋体"
  247.          Size            =   15
  248.          Charset         =   134
  249.          Weight          =   400
  250.          Underline       =   -1  'True
  251.          Italic          =   0   'False
  252.          Strikethrough   =   0   'False
  253.       EndProperty
  254.       ForeColor       =   &H00FFFFFF&
  255.       Height          =   300
  256.       Left            =   6960
  257.       TabIndex        =   35
  258.       Top             =   6360
  259.       Width           =   450
  260.    End
  261.    Begin VB.Label m62 
  262.       AutoSize        =   -1  'True
  263.       BackColor       =   &H000000FF&
  264.       Caption         =   "关"
  265.       BeginProperty Font 
  266.          Name            =   "宋体"
  267.          Size            =   15
  268.          Charset         =   134
  269.          Weight          =   400
  270.          Underline       =   -1  'True
  271.          Italic          =   0   'False
  272.          Strikethrough   =   0   'False
  273.       EndProperty
  274.       ForeColor       =   &H00FFFFFF&
  275.       Height          =   300
  276.       Left            =   10080
  277.       TabIndex        =   34
  278.       Top             =   6360
  279.       Width           =   300
  280.    End
  281.    Begin VB.Label m5 
  282.       AutoSize        =   -1  'True
  283.       BackStyle       =   0  'Transparent
  284.       Caption         =   "门5"
  285.       BeginProperty Font 
  286.          Name            =   "宋体"
  287.          Size            =   15
  288.          Charset         =   134
  289.          Weight          =   400
  290.          Underline       =   -1  'True
  291.          Italic          =   0   'False
  292.          Strikethrough   =   0   'False
  293.       EndProperty
  294.       ForeColor       =   &H00FFFFFF&
  295.       Height          =   300
  296.       Left            =   6960
  297.       TabIndex        =   33
  298.       Top             =   5760
  299.       Width           =   450
  300.    End
  301.    Begin VB.Label m52 
  302.       AutoSize        =   -1  'True
  303.       BackColor       =   &H000000FF&
  304.       Caption         =   "关"
  305.       BeginProperty Font 
  306.          Name            =   "宋体"
  307.          Size            =   15
  308.          Charset         =   134
  309.          Weight          =   400
  310.          Underline       =   -1  'True
  311.          Italic          =   0   'False
  312.          Strikethrough   =   0   'False
  313.       EndProperty
  314.       ForeColor       =   &H00FFFFFF&
  315.       Height          =   300
  316.       Left            =   10080
  317.       TabIndex        =   32
  318.       Top             =   5760
  319.       Width           =   300
  320.    End
  321.    Begin VB.Label m4 
  322.       AutoSize        =   -1  'True
  323.       BackStyle       =   0  'Transparent
  324.       Caption         =   "门4"
  325.       BeginProperty Font 
  326.          Name            =   "宋体"
  327.          Size            =   15
  328.          Charset         =   134
  329.          Weight          =   400
  330.          Underline       =   -1  'True
  331.          Italic          =   0   'False
  332.          Strikethrough   =   0   'False
  333.       EndProperty
  334.       ForeColor       =   &H00FFFFFF&
  335.       Height          =   300
  336.       Left            =   6960
  337.       TabIndex        =   31
  338.       Top             =   5160
  339.       Width           =   450
  340.    End
  341.    Begin VB.Label m42 
  342.       AutoSize        =   -1  'True
  343.       BackColor       =   &H000000FF&
  344.       Caption         =   "关"
  345.       BeginProperty Font 
  346.          Name            =   "宋体"
  347.          Size            =   15
  348.          Charset         =   134
  349.          Weight          =   400
  350.          Underline       =   -1  'True
  351.          Italic          =   0   'False
  352.          Strikethrough   =   0   'False
  353.       EndProperty
  354.       ForeColor       =   &H00FFFFFF&
  355.       Height          =   300
  356.       Left            =   10080
  357.       TabIndex        =   30
  358.       Top             =   5160
  359.       Width           =   300
  360.    End
  361.    Begin VB.Label m3 
  362.       AutoSize        =   -1  'True
  363.       BackStyle       =   0  'Transparent
  364.       Caption         =   "门3"
  365.       BeginProperty Font 
  366.          Name            =   "宋体"
  367.          Size            =   15
  368.          Charset         =   134
  369.          Weight          =   400
  370.          Underline       =   -1  'True
  371.          Italic          =   0   'False
  372.          Strikethrough   =   0   'False
  373.       EndProperty
  374.       ForeColor       =   &H00FFFFFF&
  375.       Height          =   300
  376.       Left            =   6960
  377.       TabIndex        =   29
  378.       Top             =   4560
  379.       Width           =   450
  380.    End
  381.    Begin VB.Label m32 
  382.       AutoSize        =   -1  'True
  383.       BackColor       =   &H000000FF&
  384.       Caption         =   "关"
  385.       BeginProperty Font 
  386.          Name            =   "宋体"
  387.          Size            =   15
  388.          Charset         =   134
  389.          Weight          =   400
  390.          Underline       =   -1  'True
  391.          Italic          =   0   'False
  392.          Strikethrough   =   0   'False
  393.       EndProperty
  394.       ForeColor       =   &H00FFFFFF&
  395.       Height          =   300
  396.       Left            =   10080
  397.       TabIndex        =   28
  398.       Top             =   4560
  399.       Width           =   300
  400.    End
  401.    Begin VB.Label m2 
  402.       AutoSize        =   -1  'True
  403.       BackStyle       =   0  'Transparent
  404.       Caption         =   "门2"
  405.       BeginProperty Font 
  406.          Name            =   "宋体"
  407.          Size            =   15
  408.          Charset         =   134
  409.          Weight          =   400
  410.          Underline       =   -1  'True
  411.          Italic          =   0   'False
  412.          Strikethrough   =   0   'False
  413.       EndProperty
  414.       ForeColor       =   &H00FFFFFF&
  415.       Height          =   300
  416.       Left            =   6960
  417.       TabIndex        =   27
  418.       Top             =   3960
  419.       Width           =   450
  420.    End
  421.    Begin VB.Label m22 
  422.       AutoSize        =   -1  'True
  423.       BackColor       =   &H000000FF&
  424.       Caption         =   "关"
  425.       BeginProperty Font 
  426.          Name            =   "宋体"
  427.          Size            =   15
  428.          Charset         =   134
  429.          Weight          =   400
  430.          Underline       =   -1  'True
  431.          Italic          =   0   'False
  432.          Strikethrough   =   0   'False
  433.       EndProperty
  434.       ForeColor       =   &H00FFFFFF&
  435.       Height          =   300
  436.       Left            =   10080
  437.       TabIndex        =   26
  438.       Top             =   3960
  439.       Width           =   300
  440.    End
  441.    Begin VB.Label m1 
  442.       AutoSize        =   -1  'True
  443.       BackStyle       =   0  'Transparent
  444.       Caption         =   "门1"
  445.       BeginProperty Font 
  446.          Name            =   "宋体"
  447.          Size            =   15
  448.          Charset         =   134
  449.          Weight          =   400
  450.          Underline       =   -1  'True
  451.          Italic          =   0   'False
  452.          Strikethrough   =   0   'False
  453.       EndProperty
  454.       ForeColor       =   &H00FFFFFF&
  455.       Height          =   300
  456.       Left            =   6960
  457.       TabIndex        =   24
  458.       Top             =   3360
  459.       Width           =   450
  460.    End
  461.    Begin VB.Label m12 
  462.       AutoSize        =   -1  'True
  463.       BackColor       =   &H000000FF&
  464.       Caption         =   "关"
  465.       BeginProperty Font 
  466.          Name            =   "宋体"
  467.          Size            =   15
  468.          Charset         =   134
  469.          Weight          =   400
  470.          Underline       =   -1  'True
  471.          Italic          =   0   'False
  472.          Strikethrough   =   0   'False
  473.       EndProperty
  474.       ForeColor       =   &H00FFFFFF&
  475.       Height          =   300
  476.       Left            =   10080
  477.       TabIndex        =   23
  478.       Top             =   3360
  479.       Width           =   300
  480.    End
  481.    Begin VB.Label Label6 
  482.       AutoSize        =   -1  'True
  483.       BackStyle       =   0  'Transparent
  484.       Caption         =   "控 制"
  485.       BeginProperty Font 
  486.          Name            =   "宋体"
  487.          Size            =   15
  488.          Charset         =   134
  489.          Weight          =   700
  490.          Underline       =   -1  'True
  491.          Italic          =   0   'False
  492.          Strikethrough   =   0   'False
  493.       EndProperty
  494.       ForeColor       =   &H00000000&
  495.       Height          =   300
  496.       Left            =   8520
  497.       TabIndex        =   21
  498.       Top             =   2760
  499.       Width           =   795
  500.    End
  501.    Begin VB.Label Label5 
  502.       AutoSize        =   -1  'True
  503.       BackStyle       =   0  'Transparent
  504.       Caption         =   "名 称"
  505.       BeginProperty Font 
  506.          Name            =   "宋体"
  507.          Size            =   15
  508.          Charset         =   134
  509.          Weight          =   700
  510.          Underline       =   -1  'True
  511.          Italic          =   0   'False
  512.          Strikethrough   =   0   'False
  513.       EndProperty
  514.       ForeColor       =   &H00000000&
  515.       Height          =   300
  516.       Left            =   7080
  517.       TabIndex        =   20
  518.       Top             =   2760
  519.       Width           =   795
  520.    End
  521.    Begin VB.Label Label3 
  522.       AutoSize        =   -1  'True
  523.       BackStyle       =   0  'Transparent
  524.       Caption         =   "状 态"
  525.       BeginProperty Font 
  526.          Name            =   "宋体"
  527.          Size            =   15
  528.          Charset         =   134
  529.          Weight          =   700
  530.          Underline       =   -1  'True
  531.          Italic          =   0   'False
  532.          Strikethrough   =   0   'False
  533.       EndProperty
  534.       ForeColor       =   &H00000000&
  535.       Height          =   300
  536.       Left            =   9840
  537.       TabIndex        =   19
  538.       Top             =   2760
  539.       Width           =   795
  540.    End
  541.    Begin VB.Label d7 
  542.       AutoSize        =   -1  'True
  543.       BackStyle       =   0  'Transparent
  544.       Caption         =   "七号灯"
  545.       BeginProperty Font 
  546.          Name            =   "宋体"
  547.          Size            =   15
  548.          Charset         =   134
  549.          Weight          =   400
  550.          Underline       =   -1  'True
  551.          Italic          =   0   'False
  552.          Strikethrough   =   0   'False
  553.       EndProperty
  554.       ForeColor       =   &H00FFFFFF&
  555.       Height          =   300
  556.       Left            =   1080
  557.       TabIndex        =   18
  558.       Top             =   6840
  559.       Width           =   900
  560.    End
  561.    Begin VB.Label d71 
  562.       AutoSize        =   -1  'True
  563.       BackColor       =   &H000000FF&
  564.       Caption         =   "关"
  565.       BeginProperty Font 
  566.          Name            =   "宋体"
  567.          Size            =   15
  568.          Charset         =   134
  569.          Weight          =   400
  570.          Underline       =   -1  'True
  571.          Italic          =   0   'False
  572.          Strikethrough   =   0   'False
  573.       EndProperty
  574.       ForeColor       =   &H00FFFFFF&
  575.       Height          =   300
  576.       Left            =   4200
  577.       TabIndex        =   17
  578.       Top             =   6840
  579.       Width           =   300
  580.    End
  581.    Begin VB.Label d6 
  582.       AutoSize        =   -1  'True
  583.       BackStyle       =   0  'Transparent
  584.       Caption         =   "六号灯"
  585.       BeginProperty Font 
  586.          Name            =   "宋体"
  587.          Size            =   15
  588.          Charset         =   134
  589.          Weight          =   400
  590.          Underline       =   -1  'True
  591.          Italic          =   0   'False
  592.          Strikethrough   =   0   'False
  593.       EndProperty
  594.       ForeColor       =   &H00FFFFFF&
  595.       Height          =   300
  596.       Left            =   1080
  597.       TabIndex        =   16
  598.       Top             =   6240
  599.       Width           =   900
  600.    End
  601.    Begin VB.Label d61 
  602.       AutoSize        =   -1  'True
  603.       BackColor       =   &H000000FF&
  604.       Caption         =   "关"
  605.       BeginProperty Font 
  606.          Name            =   "宋体"
  607.          Size            =   15
  608.          Charset         =   134
  609.          Weight          =   400
  610.          Underline       =   -1  'True
  611.          Italic          =   0   'False
  612.          Strikethrough   =   0   'False
  613.       EndProperty
  614.       ForeColor       =   &H00FFFFFF&
  615.       Height          =   300
  616.       Left            =   4200
  617.       TabIndex        =   15
  618.       Top             =   6240
  619.       Width           =   300
  620.    End
  621.    Begin VB.Label d5 
  622.       AutoSize        =   -1  'True
  623.       BackStyle       =   0  'Transparent
  624.       Caption         =   "五号灯"
  625.       BeginProperty Font 
  626.          Name            =   "宋体"
  627.          Size            =   15
  628.          Charset         =   134
  629.          Weight          =   400
  630.          Underline       =   -1  'True
  631.          Italic          =   0   'False
  632.          Strikethrough   =   0   'False
  633.       EndProperty
  634.       ForeColor       =   &H00FFFFFF&
  635.       Height          =   300
  636.       Left            =   1080
  637.       TabIndex        =   14
  638.       Top             =   5640
  639.       Width           =   900
  640.    End
  641.    Begin VB.Label d51 
  642.       AutoSize        =   -1  'True
  643.       BackColor       =   &H000000FF&
  644.       Caption         =   "关"
  645.       BeginProperty Font 
  646.          Name            =   "宋体"
  647.          Size            =   15
  648.          Charset         =   134
  649.          Weight          =   400
  650.          Underline       =   -1  'True
  651.          Italic          =   0   'False
  652.          Strikethrough   =   0   'False
  653.       EndProperty
  654.       ForeColor       =   &H00FFFFFF&
  655.       Height          =   300
  656.       Left            =   4200
  657.       TabIndex        =   13
  658.       Top             =   5640
  659.       Width           =   300
  660.    End
  661.    Begin VB.Label d4 
  662.       AutoSize        =   -1  'True
  663.       BackStyle       =   0  'Transparent
  664.       Caption         =   "四号灯"
  665.       BeginProperty Font 
  666.          Name            =   "宋体"
  667.          Size            =   15
  668.          Charset         =   134
  669.          Weight          =   400
  670.          Underline       =   -1  'True
  671.          Italic          =   0   'False
  672.          Strikethrough   =   0   'False
  673.       EndProperty
  674.       ForeColor       =   &H00FFFFFF&
  675.       Height          =   300
  676.       Left            =   1080
  677.       TabIndex        =   12
  678.       Top             =   5040
  679.       Width           =   900
  680.    End
  681.    Begin VB.Label d41 
  682.       AutoSize        =   -1  'True
  683.       BackColor       =   &H000000FF&
  684.       Caption         =   "关"
  685.       BeginProperty Font 
  686.          Name            =   "宋体"
  687.          Size            =   15
  688.          Charset         =   134
  689.          Weight          =   400
  690.          Underline       =   -1  'True
  691.          Italic          =   0   'False
  692.          Strikethrough   =   0   'False
  693.       EndProperty
  694.       ForeColor       =   &H00FFFFFF&
  695.       Height          =   300
  696.       Left            =   4200
  697.       TabIndex        =   11
  698.       Top             =   5040
  699.       Width           =   300
  700.    End
  701.    Begin VB.Label d3 
  702.       AutoSize        =   -1  'True
  703.       BackStyle       =   0  'Transparent
  704.       Caption         =   "三号灯"
  705.       BeginProperty Font 
  706.          Name            =   "宋体"
  707.          Size            =   15
  708.          Charset         =   134
  709.          Weight          =   400
  710.          Underline       =   -1  'True
  711.          Italic          =   0   'False
  712.          Strikethrough   =   0   'False
  713.       EndProperty
  714.       ForeColor       =   &H00FFFFFF&
  715.       Height          =   300
  716.       Left            =   1080
  717.       TabIndex        =   10
  718.       Top             =   4440
  719.       Width           =   900
  720.    End
  721.    Begin VB.Label d31 
  722.       AutoSize        =   -1  'True
  723.       BackColor       =   &H000000FF&
  724.       Caption         =   "关"
  725.       BeginProperty Font 
  726.          Name            =   "宋体"
  727.          Size            =   15
  728.          Charset         =   134
  729.          Weight          =   400
  730.          Underline       =   -1  'True
  731.          Italic          =   0   'False
  732.          Strikethrough   =   0   'False
  733.       EndProperty
  734.       ForeColor       =   &H00FFFFFF&
  735.       Height          =   300
  736.       Left            =   4200
  737.       TabIndex        =   9
  738.       Top             =   4440
  739.       Width           =   300
  740.    End
  741.    Begin VB.Label d2 
  742.       AutoSize        =   -1  'True
  743.       BackStyle       =   0  'Transparent
  744.       Caption         =   "二号灯"
  745.       BeginProperty Font 
  746.          Name            =   "宋体"
  747.          Size            =   15
  748.          Charset         =   134
  749.          Weight          =   400
  750.          Underline       =   -1  'True
  751.          Italic          =   0   'False
  752.          Strikethrough   =   0   'False
  753.       EndProperty
  754.       ForeColor       =   &H00FFFFFF&
  755.       Height          =   300
  756.       Left            =   1080
  757.       TabIndex        =   8
  758.       Top             =   3840
  759.       Width           =   900
  760.    End
  761.    Begin VB.Label d21 
  762.       AutoSize        =   -1  'True
  763.       BackColor       =   &H000000FF&
  764.       Caption         =   "关"
  765.       BeginProperty Font 
  766.          Name            =   "宋体"
  767.          Size            =   15
  768.          Charset         =   134
  769.          Weight          =   400
  770.          Underline       =   -1  'True
  771.          Italic          =   0   'False
  772.          Strikethrough   =   0   'False
  773.       EndProperty
  774.       ForeColor       =   &H00FFFFFF&
  775.       Height          =   300
  776.       Left            =   4200
  777.       TabIndex        =   7
  778.       Top             =   3840
  779.       Width           =   300
  780.    End
  781.    Begin VB.Label Label4 
  782.       AutoSize        =   -1  'True
  783.       BackStyle       =   0  'Transparent
  784.       Caption         =   "控 制"
  785.       BeginProperty Font 
  786.          Name            =   "宋体"
  787.          Size            =   15
  788.          Charset         =   134
  789.          Weight          =   700
  790.          Underline       =   -1  'True
  791.          Italic          =   0   'False
  792.          Strikethrough   =   0   'False
  793.       EndProperty
  794.       ForeColor       =   &H00000000&
  795.       Height          =   300
  796.       Left            =   2640
  797.       TabIndex        =   5
  798.       Top             =   2640
  799.       Width           =   795
  800.    End
  801.    Begin VB.Label d11 
  802.       AutoSize        =   -1  'True
  803.       BackColor       =   &H000000FF&
  804.       Caption         =   "关"
  805.       BeginProperty Font 
  806.          Name            =   "宋体"
  807.          Size            =   15
  808.          Charset         =   134
  809.          Weight          =   400
  810.          Underline       =   -1  'True
  811.          Italic          =   0   'False
  812.          Strikethrough   =   0   'False
  813.       EndProperty
  814.       ForeColor       =   &H00FFFFFF&
  815.       Height          =   300
  816.       Left            =   4200
  817.       TabIndex        =   4
  818.       Top             =   3240
  819.       Width           =   300
  820.    End
  821.    Begin VB.Label Label2 
  822.       AutoSize        =   -1  'True
  823.       BackStyle       =   0  'Transparent
  824.       Caption         =   "状 态"
  825.       BeginProperty Font 
  826.          Name            =   "宋体"
  827.          Size            =   15
  828.          Charset         =   134
  829.          Weight          =   700
  830.          Underline       =   -1  'True
  831.          Italic          =   0   'False
  832.          Strikethrough   =   0   'False
  833.       EndProperty
  834.       ForeColor       =   &H00000000&
  835.       Height          =   300
  836.       Left            =   3960
  837.       TabIndex        =   3
  838.       Top             =   2640
  839.       Width           =   795
  840.    End
  841.    Begin VB.Label Label1 
  842.       AutoSize        =   -1  'True
  843.       BackStyle       =   0  'Transparent
  844.       Caption         =   "名 称"
  845.       BeginProperty Font 
  846.          Name            =   "宋体"
  847.          Size            =   15
  848.          Charset         =   134
  849.          Weight          =   700
  850.          Underline       =   -1  'True
  851.          Italic          =   0   'False
  852.          Strikethrough   =   0   'False
  853.       EndProperty
  854.       ForeColor       =   &H00000000&
  855.       Height          =   300
  856.       Left            =   1200
  857.       TabIndex        =   2
  858.       Top             =   2640
  859.       Width           =   795
  860.    End
  861.    Begin VB.Label d1 
  862.       AutoSize        =   -1  'True
  863.       BackStyle       =   0  'Transparent
  864.       Caption         =   "一号灯"
  865.       BeginProperty Font 
  866.          Name            =   "宋体"
  867.          Size            =   15
  868.          Charset         =   134
  869.          Weight          =   400
  870.          Underline       =   -1  'True
  871.          Italic          =   0   'False
  872.          Strikethrough   =   0   'False
  873.       EndProperty
  874.       ForeColor       =   &H00FFFFFF&
  875.       Height          =   300
  876.       Left            =   1080
  877.       TabIndex        =   0
  878.       Top             =   3240
  879.       Width           =   1020
  880.    End
  881.    Begin VB.Image Image1 
  882.       Height          =   6000
  883.       Index           =   1
  884.       Left            =   6600
  885.       Picture         =   "Form1.frx":8DBB4
  886.       Top             =   2160
  887.       Width           =   4500
  888.    End
  889.    Begin VB.Image Image1 
  890.       Height          =   6000
  891.       Index           =   0
  892.       Left            =   720
  893.       Picture         =   "Form1.frx":909E4
  894.       Top             =   2160
  895.       Width           =   4500
  896.    End
  897.    Begin VB.Line Line1 
  898.       BorderColor     =   &H00FFFF00&
  899.       BorderWidth     =   4
  900.       X1              =   42
  901.       X2              =   258
  902.       Y1              =   156
  903.       Y2              =   156
  904.    End
  905.    Begin VB.Line Line2 
  906.       BorderColor     =   &H00FFFF00&
  907.       BorderWidth     =   4
  908.       X1              =   336
  909.       X2              =   552
  910.       Y1              =   162
  911.       Y2              =   162
  912.    End
  913. End
  914. Attribute VB_Name = "zngk"
  915. Attribute VB_GlobalNameSpace = False
  916. Attribute VB_Creatable = False
  917. Attribute VB_PredeclaredId = True
  918. Attribute VB_Exposed = False
  919. Public x, x1, x2, x3, x4, x5, x6, x7, x8 As Integer
  920. Private Sub Command1_Click()
  921. shuoming.Show
  922. End Sub
  923. Private Sub Command2_Click() '为了大家学习方便我没有添加各种错误检出方法,输入端口号只要输入纯数字即可默认为1
  924. MSComm1.InBufferSize = 1024
  925. MSComm1.OutBufferSize = 1024
  926. MSComm1.CommPort = Text1.Text
  927. MSComm1.Settings = "9600,E,7,1"
  928. MSComm1.PortOpen = True
  929. End Sub
  930. Private Sub d10_Click(Index As Integer)
  931. Dim sum As String
  932. Dim rr As String
  933. Dim zz As String
  934. Select Case Index
  935. Case 0
  936. If x1 = 1 Then
  937. zz = CHANGE(0) '转换成16进制
  938. sum = "7" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  939. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum) '向PLC发送开的消息
  940. x1 = 2
  941. d11.BackColor = vbGreen
  942. d10(0).Caption = "关" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  943. d11.Caption = "开"
  944. x1 = 2
  945. Else
  946. zz = CHANGE(0) '转换成16进制
  947. sum = "8" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  948. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum)
  949. d11.BackColor = vbRed
  950. d10(0).Caption = "开" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  951. d11.Caption = "关"
  952. x1 = 1
  953. End If
  954. Case 1
  955. If x2 = 1 Then
  956. zz = CHANGE(1) '转换成16进制
  957. sum = "7" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  958. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum) '向PLC发送开的消息
  959. x2 = 2
  960. d21.BackColor = vbGreen
  961. d10(1).Caption = "关" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  962. d21.Caption = "开"
  963. x2 = 2
  964. Else
  965. zz = CHANGE(1) '转换成16进制
  966. sum = "8" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  967. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum)
  968. d21.BackColor = vbRed
  969. d10(1).Caption = "开" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  970. d21.Caption = "关"
  971. x2 = 1
  972. End If
  973. Case 2
  974. If x3 = 1 Then
  975. zz = CHANGE(2) '转换成16进制
  976. sum = "7" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  977. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum) '向PLC发送开的消息
  978. x3 = 2
  979. d31.BackColor = vbGreen
  980. d10(2).Caption = "关" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  981. d31.Caption = "开"
  982. x3 = 2
  983. Else
  984. zz = CHANGE(2) '转换成16进制
  985. sum = "8" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  986. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum)
  987. d31.BackColor = vbRed
  988. d10(2).Caption = "开" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  989. d31.Caption = "关"
  990. x3 = 1
  991. End If
  992. Case 3
  993. If x4 = 1 Then
  994. zz = CHANGE(3) '转换成16进制
  995. sum = "7" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  996. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum) '向PLC发送开的消息
  997. x4 = 2
  998. d41.BackColor = vbGreen
  999. d10(3).Caption = "关" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1000. d41.Caption = "开"
  1001. x4 = 2
  1002. Else
  1003. zz = CHANGE(3) '转换成16进制
  1004. sum = "8" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  1005. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum)
  1006. d41.BackColor = vbRed
  1007. d10(3).Caption = "开" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1008. d41.Caption = "关"
  1009. x4 = 1
  1010. End If
  1011. Case 4
  1012. If x5 = 1 Then
  1013. zz = CHANGE(4) '转换成16进制
  1014. sum = "7" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  1015. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum) '向PLC发送开的消息
  1016. x5 = 2
  1017. d51.BackColor = vbGreen
  1018. d10(4).Caption = "关" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1019. d51.Caption = "开"
  1020. x5 = 2
  1021. Else
  1022. zz = CHANGE(4) '转换成16进制
  1023. sum = "8" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  1024. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum)
  1025. d51.BackColor = vbRed
  1026. d10(4).Caption = "开" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1027. d51.Caption = "关"
  1028. x5 = 1
  1029. End If
  1030. Case 5
  1031. If x6 = 1 Then
  1032. zz = CHANGE(5) '转换成16进制
  1033. sum = "7" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  1034. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum) '向PLC发送开的消息
  1035. x6 = 2
  1036. d61.BackColor = vbGreen
  1037. d10(5).Caption = "关" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1038. d61.Caption = "开"
  1039. x1 = 2
  1040. Else
  1041. zz = CHANGE(5) '转换成16进制
  1042. sum = "8" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  1043. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum)
  1044. d61.BackColor = vbRed
  1045. d10(5).Caption = "开" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1046. d61.Caption = "关"
  1047. x6 = 1
  1048. End If
  1049. Case 6
  1050. If x7 = 1 Then
  1051. zz = CHANGE(6) '转换成16进制
  1052. sum = "7" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  1053. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum) '向PLC发送开的消息
  1054. x7 = 2
  1055. d71.BackColor = vbGreen
  1056. d10(6).Caption = "关" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1057. d71.Caption = "开"
  1058. x7 = 2
  1059. Else
  1060. zz = CHANGE(6) '转换成16进制
  1061. sum = "8" + "0" & zz & "05" + Chr(&H3) '这些是求和校检用的数据
  1062. MSComm1.Output = Chr(&H2) + sum + CHACKSUM(sum)
  1063. d71.BackColor = vbRed
  1064. d10(6).Caption = "开" '这里我就不计算返回数据了!如果做程序的时候大家赢定要记得计算!
  1065. d71.Caption = "关"
  1066. x7 = 1
  1067. End If
  1068. End Select
  1069. End Sub
  1070. Private Sub Form_Load()
  1071. Text1.Text = 1
  1072. x1 = 1
  1073. x2 = 1
  1074. x3 = 1
  1075. x4 = 1
  1076. x5 = 1
  1077. x6 = 1
  1078. x7 = 1
  1079. End Sub
  1080. Private Sub sz1_Click()
  1081. x = 1
  1082. sz.Caption = "一区设置"
  1083. sz.Show
  1084. End Sub
  1085. Private Sub sz2_Click()
  1086. x = 2
  1087. sz.Caption = "二区设置"
  1088. sz.Show
  1089. End Sub