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

📄 form2.frm

📁 三菱PLC上位机程序详细例子
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form2 
   Caption         =   "Form2"
   ClientHeight    =   4245
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6540
   LinkTopic       =   "Form2"
   ScaleHeight     =   4245
   ScaleWidth      =   6540
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "Command2"
      Height          =   495
      Left            =   3120
      TabIndex        =   4
      Top             =   2160
      Width           =   1695
   End
   Begin VB.Timer Timer1 
      Interval        =   2000
      Left            =   4200
      Top             =   1560
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   1440
      TabIndex        =   0
      Top             =   2040
      Width           =   1335
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   840
      Top             =   2400
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
      ParitySetting   =   2
      InputMode       =   1
   End
   Begin VB.Label Label3 
      Caption         =   "Label1"
      Height          =   375
      Left            =   3600
      TabIndex        =   3
      Top             =   240
      Width           =   975
   End
   Begin VB.Label Label2 
      Caption         =   "Label1"
      Height          =   375
      Left            =   2040
      TabIndex        =   2
      Top             =   120
      Width           =   975
   End
   Begin VB.Label Label1 
      Caption         =   "Label1"
      Height          =   375
      Left            =   600
      TabIndex        =   1
      Top             =   120
      Width           =   975
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Command1_Click()
i = WW(MSComm1, 0, "Y", "1", 1)
End Sub

Private Sub Command2_Click()
i = WW(MSComm1, 0, "Y", "1", 0)
End Sub

Private Sub Form_Load()
'OpenPort MSComm1, 4
End Sub

Private Sub Timer1_Timer()
Label1.Caption = BR(MSComm1, 0, 0, "X", 1, 5)
'Label2.Caption = BR(MSComm1, 0, 0, "Y", "3")
'Label3.Caption = BR(MSComm1, 0, 0, "Y", "2")
End Sub

⌨️ 快捷键说明

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