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

📄 formsetup.frm

📁 This is a boiler test system,has been use in factory
💻 FRM
📖 第 1 页 / 共 4 页
字号:
         Height          =   405
         Index           =   1
         Left            =   960
         TabIndex        =   9
         Text            =   "0"
         Top             =   480
         Width           =   855
      End
      Begin ComCtl2.UpDown UpDown1 
         Height          =   405
         Index           =   1
         Left            =   1800
         TabIndex        =   11
         Top             =   480
         Width           =   240
         _ExtentX        =   476
         _ExtentY        =   714
         _Version        =   327681
         Enabled         =   -1  'True
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "反馈值:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   2
         Left            =   240
         TabIndex        =   15
         Top             =   1260
         Width           =   735
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "6"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Index           =   1
         Left            =   960
         TabIndex        =   14
         Top             =   1200
         Width           =   855
      End
      Begin VB.Label Labeldw 
         AutoSize        =   -1  'True
         Caption         =   "mm"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   1
         Left            =   1920
         TabIndex        =   13
         Top             =   1260
         Width           =   240
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "给定值:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   1
         Left            =   240
         TabIndex        =   12
         Top             =   577
         Width           =   735
      End
   End
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   6240
      Top             =   1080
   End
   Begin VB.Frame Frame1 
      Caption         =   "3#水回路"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   2295
      Index           =   0
      Left            =   480
      TabIndex        =   0
      Top             =   120
      Width           =   2535
      Begin VB.TextBox Text1 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   405
         Index           =   0
         Left            =   960
         TabIndex        =   6
         Text            =   "0"
         Top             =   480
         Width           =   855
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确 定"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   355
         Index           =   0
         Left            =   840
         TabIndex        =   3
         Top             =   1800
         Width           =   975
      End
      Begin ComCtl2.UpDown UpDown1 
         Height          =   405
         Index           =   0
         Left            =   1800
         TabIndex        =   5
         Top             =   480
         Width           =   240
         _ExtentX        =   476
         _ExtentY        =   714
         _Version        =   327681
         Enabled         =   -1  'True
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "给定值:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   0
         Left            =   240
         TabIndex        =   7
         Top             =   577
         Width           =   735
      End
      Begin VB.Label Labeldw 
         AutoSize        =   -1  'True
         Caption         =   "mm"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Index           =   0
         Left            =   1920
         TabIndex        =   4
         Top             =   1260
         Width           =   240
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "6"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   360
         Index           =   0
         Left            =   960
         TabIndex        =   2
         Top             =   1200
         Width           =   855
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "反馈值:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Index           =   3
         Left            =   240
         TabIndex        =   1
         Top             =   1260
         Width           =   735
      End
   End
   Begin VB.Menu exit12 
      Caption         =   "关闭"
   End
End
Attribute VB_Name = "FormSetup"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim GdBlNum(8), PlcDbByte(8)
Private Sub WriteS7(no, aaa1$)
On Error Resume Next
  BLOCKNO = 1
  AMOUNT = 1
  res = new_ss(VerbIdx + 1)
  If (res = 0) Then
     value_byte(0) = Val("&H" & Mid$(aaa1$, 1, 2))
     res = d_field_write(BLOCKNO, no, AMOUNT, value_byte(0))
     no = no + 1
     value_byte(0) = Val("&H" & Mid$(aaa1$, 3, 2))
     res = d_field_write(BLOCKNO, no, AMOUNT, value_byte(0))
  End If
End Sub

Private Sub Command1_Click(Index As Integer)
''On Error Resume Next '给定 '已知y和公式y=kx+b,求x=? 2002-8-25
  SetupGD(Index) = Val(Text1(Index).Text)
  yy1 = Val(Text1(Index).Text) - bbb(GdBlNum(Index))
  aaa1$ = Right$("0000" & Hex$(yy1 / kkk(GdBlNum(Index))), 4)
  num1 = PlcDbByte(Index)
  Call WriteS7(num1, aaa1$)
  Savecans
End Sub


Private Sub exit12_Click()
Unload Me
End Sub

Private Sub Form_Deactivate()
Timer1.Enabled = False
Unload Me
End Sub

Private Sub Form_Load()
On Error Resume Next

GdBlNum(0) = 8  '操作变量2002-08-25
GdBlNum(1) = 0
GdBlNum(2) = 1

GdBlNum(3) = 8 + Ainumgl
GdBlNum(4) = 0 + Ainumgl
GdBlNum(5) = 1 + Ainumgl

GdBlNum(6) = 8 + 2 * Ainumgl
GdBlNum(7) = 0 + 2 * Ainumgl
GdBlNum(8) = 1 + 2 * Ainumgl
'------------------------------------------------
finame1$ = sysdir + "\GdcsAdd.can"  '给定参数地址
If Dir$(finame1$) <> "" Then
  Open finame1$ For Input As #1
  For i% = 0 To 8
    Input #1, PlcDbByte(i%)
  Next
  Close #1
End If

For i% = 0 To Geidingnum
  Text1(i%).Text = SetupGD(i%)
  Frame1(i%).Caption = AI_Nam(GdBlNum(i%))
  Labeldw(i%).Caption = DanWei(GdBlNum(i%))
Next
Timer1_Timer
End Sub

Private Sub Text1_LostFocus(Index As Integer)
aaa = Val(Text1(Index).Text)
If aaa > LiangC(1, GdBlNum(Index)) Then aaa = LiangC(1, GdBlNum(Index))
If aaa < LiangC(0, GdBlNum(Index)) Then aaa = LiangC(0, GdBlNum(Index))
Text1(Index).Text = aaa
End Sub
Private Sub Timer1_Timer()
For i% = 0 To Geidingnum
 Label2(i%).Caption = PvtAI(GdBlNum(i%))
Next
End Sub
Private Sub UpDown1_DownClick(Index As Integer)
aa = Val(Text1(Index).Text)
aa = aa - 1 / beishu(GdBlNum(Index))
If aa < LiangC(0, GdBlNum(Index)) Then aa = LiangC(0, GdBlNum(Index))
Text1(Index).Text = aa
End Sub

Private Sub UpDown1_UpClick(Index As Integer)
aa = Val(Text1(Index).Text)
aa = aa + 1 / beishu(GdBlNum(Index))
If aa > LiangC(1, GdBlNum(Index)) Then aa = LiangC(1, GdBlNum(Index))
Text1(Index).Text = aa
End Sub
Public Sub Savecans()
For i% = 0 To Geidingnum
  zfc$ = zfc$ & SetupGD(i%) & ","
Next
finame1$ = sysdir + "\Gdcs.can"  '上下限报警文件名
Open finame1$ For Output As #1
    Print #1, zfc$
Close #1
'------------
End Sub

⌨️ 快捷键说明

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