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

📄 rs232.frm

📁 program for rs232 with visual basic
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1 
   Caption         =   "comunicacion serial"
   ClientHeight    =   4665
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6495
   LinkTopic       =   "Form1"
   ScaleHeight     =   4665
   ScaleWidth      =   6495
   StartUpPosition =   3  'Windows Default
   Begin MSCommLib.MSComm MSComm1 
      Left            =   4920
      Top             =   1800
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
   Begin VB.CommandButton cmdTransmite 
      Caption         =   "Transmision"
      Height          =   375
      Left            =   4800
      TabIndex        =   3
      Top             =   2880
      Width           =   1335
   End
   Begin VB.TextBox txtTransmitir 
      Height          =   1215
      Left            =   360
      MultiLine       =   -1  'True
      TabIndex        =   2
      Top             =   2160
      Width           =   3735
   End
   Begin VB.CommandButton cmdDatos 
      Caption         =   "recepcion"
      Height          =   375
      Left            =   4680
      TabIndex        =   1
      Top             =   840
      Width           =   1335
   End
   Begin VB.TextBox txtRecibir 
      Height          =   1215
      Left            =   360
      MultiLine       =   -1  'True
      TabIndex        =   0
      Top             =   480
      Width           =   3735
   End
   Begin VB.Frame Frame1 
      Caption         =   "Frame1"
      Height          =   4095
      Left            =   120
      TabIndex        =   4
      Top             =   0
      Width           =   4215
      Begin VB.Label Label2 
         Caption         =   "Recibir"
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   1800
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "Transmitir"
         Height          =   255
         Left            =   360
         TabIndex        =   5
         Top             =   3600
         Width           =   1455
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub cmdDatos_Click()
Dim buferentrada As String
buferentrada = MSComm1.Input      'En esta variable se almacena lo que entra por el puerto serie
txtRecibir.Text = buferentrada
'txtRecibir.Text & buferentrada 'aca se almacena lo que llega del puerto y lo que se escribe en recibir.txt (ojo esto esta con locked)

End Sub



Private Sub cmdTransmite_Click()
Dim TextoSalida As String

TextoSalida = txtTransmitir.Text
MSComm1.Output = TextoSalida 'Se transmite todo lo que hay en el textbox

End Sub

Private Sub Form_Activate()

Dim buferentrada    As String
MSComm1.CommPort = 1        'puerto com1
MSComm1.PortOpen = True     'se abre el puerto para que funcione
MSComm1.Output = txtTransmitir.Text ' se transmite lo que hay en el textbox


End Sub

Private Sub MSComm1_OnComm()
MSComm1.Settings = "1200,n,8,1" 'configuracion del puerto serie

End Sub

Private Sub Texto_Change()

End Sub

Private Sub Texto2_Change()

End Sub

⌨️ 快捷键说明

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