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

📄 form1.frm

📁 vb与台达PLC通讯实例。 利用vb的MSComm端口
💻 FRM
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   9240
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   13530
   LinkTopic       =   "Form1"
   ScaleHeight     =   9240
   ScaleWidth      =   13530
   StartUpPosition =   3  '窗口缺省
   Begin VB.Frame Frame1 
      Caption         =   "Frame1"
      Height          =   1575
      Left            =   1080
      TabIndex        =   3
      Top             =   6600
      Width           =   10815
      Begin VB.CommandButton Co1 
         Caption         =   "4"
         Height          =   735
         Index           =   3
         Left            =   5760
         TabIndex        =   7
         Top             =   480
         Width           =   1575
      End
      Begin VB.CommandButton Co1 
         Caption         =   "3"
         Height          =   735
         Index           =   2
         Left            =   3960
         TabIndex        =   6
         Top             =   480
         Width           =   1575
      End
      Begin VB.CommandButton Co1 
         Caption         =   "2"
         Height          =   735
         Index           =   1
         Left            =   2160
         TabIndex        =   5
         Top             =   480
         Width           =   1575
      End
      Begin VB.CommandButton Co1 
         Caption         =   "1"
         Height          =   735
         Index           =   0
         Left            =   360
         TabIndex        =   4
         Top             =   480
         Width           =   1575
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Command2"
      Height          =   1335
      Left            =   7200
      TabIndex        =   2
      Top             =   4320
      Width           =   3495
   End
   Begin MSCommLib.MSComm Com1 
      Left            =   480
      Top             =   5040
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   1455
      Left            =   2400
      TabIndex        =   1
      Top             =   4080
      Width           =   3495
   End
   Begin VB.TextBox Text1 
      Height          =   1095
      Left            =   1800
      TabIndex        =   0
      Text            =   "Text1"
      Top             =   720
      Width           =   2655
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Co1_Click(Index As Integer)
Select Case Index >= 0
Case Index = 0
     Unload Me
     Form1.Show
Case Index = 1
     Unload Me
     Form2.Show
Case Index = 2
     Unload Me
     Form3.Show
Case Index = 3
     
     Unload Me
     Form4.Show
Case Else
  Print Index
End Select

End Sub


Private Sub Command2_Click()
Dim ReW As String
ReW = ":010108000001"
Call PLCTXio(ReW)
Text1.Text = ReW

End Sub

⌨️ 快捷键说明

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