📄 frmtl.frm
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form frmtl
Caption = "Talker / Listener"
ClientHeight = 4245
ClientLeft = 60
ClientTop = 345
ClientWidth = 7425
LinkTopic = "Form1"
ScaleHeight = 4245
ScaleWidth = 7425
StartUpPosition = 3 'Windows Default
Begin VB.TextBox lblResponse
BackColor = &H80000004&
Height = 1812
Left = 120
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 6
Top = 1320
Width = 4095
End
Begin MSCommLib.MSComm MSComm1
Left = 6480
Top = 0
_ExtentX = 794
_ExtentY = 794
_Version = 393216
DTREnable = -1 'True
RThreshold = 1
End
Begin VB.Timer Timer1
Left = 5880
Top = 0
End
Begin VB.CommandButton cmdRead
Caption = "Read"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 5
Top = 3480
Width = 1335
End
Begin VB.TextBox txtCmd
Height = 495
Left = 120
TabIndex = 2
Top = 600
Width = 3975
End
Begin VB.CommandButton cmdExit
Caption = "Exit"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 5160
TabIndex = 1
Top = 3480
Width = 1335
End
Begin VB.CommandButton cmdWrite
Caption = "Write"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
TabIndex = 0
Top = 3480
Width = 1335
End
Begin VB.Label lblWriteResponse
Height = 375
Left = 4320
TabIndex = 7
Top = 600
Width = 2655
End
Begin VB.Label lblReadResponse
Height = 375
Left = 4320
TabIndex = 4
Top = 1440
Width = 2535
End
Begin VB.Label Label1
Caption = "Enter command and press WRITE to send. Press READ to read response."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 120
TabIndex = 3
Top = 120
Width = 3855
End
End
Attribute VB_Name = "frmtl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdRead_Click()
Dim RESP As String
'
' Get response from the scope
'
RESP = Space(320)
Call RS232Read(MSComm1, RESP)
'
' Display the response the length of the characters.
'
lblResponse.Text = RESP
lblReadResponse.Caption = Str(Len(RESP)) + " character(s) read."
End Sub
Private Sub cmdWrite_Click()
Dim RESP As String
Dim CORQ As String
'
' clear up the display
'
lblReadResponse.Caption = ""
lblResponse.Text = RESP
CORQ = txtCmd.Text
'
' Send the command or query to the scope
'
Call DOCMD(MSComm1, CORQ)
End Sub
Private Sub Form_Load()
'
' Setup and open the COMM port.
'
MSComm1.CommPort = theCommPort
MSComm1.RThreshold = 1
MSComm1.PortOpen = True
'
' Set up Device Event Status Enable Register to enable status events
'
Call RS232WRITE(MSComm1, "DESE 255")
'
' Set up the Event Status Enable Register to enable status events
'
Call RS232WRITE(MSComm1, "*ESE 255")
'
' Set up the Service Request Enable Register to enable status events
'
Call RS232WRITE(MSComm1, "*SRE 48")
End Sub
Private Sub Form_Unload(Cancel As Integer)
' Shut down the serial port.
MSComm1.PortOpen = False
End Sub
Private Sub Timer1_Timer()
ATimeoutOccurred = True
Return
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -