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

📄 rs232模拟仪表.frm

📁 串口测试程序
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form RS232模拟仪表 
   Caption         =   "Form1"
   ClientHeight    =   5625
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   8250
   LinkTopic       =   "Form1"
   ScaleHeight     =   5625
   ScaleWidth      =   8250
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   1000
      Left            =   600
      Top             =   4560
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "结束"
      Height          =   495
      Left            =   3360
      TabIndex        =   6
      Top             =   3960
      Width           =   1095
   End
   Begin VB.CommandButton cmdReceive 
      Caption         =   "读取字符串"
      Height          =   495
      Left            =   4920
      TabIndex        =   5
      Top             =   3240
      Width           =   1095
   End
   Begin VB.CommandButton cmdSend 
      Caption         =   "发送字符串"
      Height          =   495
      Left            =   1440
      TabIndex        =   4
      Top             =   3120
      Width           =   1095
   End
   Begin VB.TextBox txtReceive 
      Height          =   1455
      Left            =   3960
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   3
      Text            =   "RS232模拟仪表.frx":0000
      Top             =   1320
      Width           =   3015
   End
   Begin VB.TextBox txtSend 
      Height          =   1455
      Left            =   840
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Text            =   "RS232模拟仪表.frx":0006
      Top             =   1320
      Width           =   3015
   End
   Begin MSCommLib.MSComm Comm1 
      Left            =   6480
      Top             =   4320
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   0   'False
   End
   Begin VB.Label Label3 
      Caption         =   "RS232模拟仪表"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2880
      TabIndex        =   7
      Top             =   360
      Width           =   2295
   End
   Begin VB.Label Label2 
      Caption         =   "接收区"
      Height          =   255
      Left            =   5040
      TabIndex        =   1
      Top             =   960
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "发送区"
      Height          =   255
      Left            =   2040
      TabIndex        =   0
      Top             =   960
      Width           =   735
   End
End
Attribute VB_Name = "RS232模拟仪表"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim FS As Integer


Private Sub cmdExit_Click()
Comm1.PortOpen = False
End
End Sub

Private Sub cmdReceive_Click()
txtReceive = Comm1.Input
End Sub

Private Sub cmdSend_Click()
Comm1.Output = txtSend.Text
End Sub

Private Sub Comm1_OnComm()
'Label4.Caption = Comm1.Input
End Sub

Private Sub Form_Load()
Comm1.PortOpen = True
End Sub

Private Sub Timer1_Timer()
Dim FS1 As String
FS = FS + 100
FS1 = Str(FS)
Comm1.Output = "GS" + FS1
End Sub

Private Sub txtReceive_Change()
Comm1.Output
End Sub

⌨️ 快捷键说明

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