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

📄 logic_analyzer.frm

📁 典型实例13SDRAM读写控制的实现与Modelsim仿真
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1 
   BackColor       =   &H8000000A&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "红外线逻辑分析器"
   ClientHeight    =   7185
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10680
   Icon            =   "Logic_analyzer.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   7185
   ScaleWidth      =   10680
   StartUpPosition =   3  '窗口缺省
   Begin VB.ComboBox Combo2 
      Height          =   300
      ItemData        =   "Logic_analyzer.frx":0CCA
      Left            =   2280
      List            =   "Logic_analyzer.frx":0CD4
      TabIndex        =   16
      Text            =   "1"
      Top             =   6720
      Width           =   2055
   End
   Begin VB.Timer Timer2 
      Interval        =   2000
      Left            =   9600
      Top             =   6120
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      ItemData        =   "Logic_analyzer.frx":0CDE
      Left            =   2280
      List            =   "Logic_analyzer.frx":0CEB
      TabIndex        =   11
      Text            =   "1"
      Top             =   6360
      Width           =   2055
   End
   Begin VB.CommandButton Command6 
      Caption         =   "缩少"
      Height          =   375
      Left            =   1920
      TabIndex        =   6
      Top             =   5880
      Width           =   855
   End
   Begin VB.CommandButton Command5 
      Caption         =   "放大"
      Height          =   375
      Left            =   840
      TabIndex        =   5
      Top             =   5880
      Width           =   975
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   255
      LargeChange     =   100
      Left            =   240
      Max             =   31740
      SmallChange     =   2
      TabIndex        =   4
      Top             =   5400
      Width           =   10215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "开始采集"
      Height          =   375
      Left            =   3000
      TabIndex        =   3
      Top             =   5880
      Width           =   1455
   End
   Begin VB.Timer Timer1 
      Left            =   0
      Top             =   5760
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   0
      Top             =   6360
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
      InBufferSize    =   20000
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00F2FDFF&
      Height          =   5175
      Left            =   240
      ScaleHeight     =   5115
      ScaleWidth      =   10155
      TabIndex        =   0
      Top             =   120
      Width           =   10215
      Begin VB.Label Label9 
         BackStyle       =   0  'Transparent
         Caption         =   "第三通道"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   120
         TabIndex        =   14
         Top             =   2880
         Width           =   855
      End
      Begin VB.Line Line3 
         X1              =   0
         X2              =   10200
         Y1              =   2640
         Y2              =   2640
      End
      Begin VB.Label Label8 
         BackStyle       =   0  'Transparent
         Caption         =   "第二通道"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   120
         TabIndex        =   13
         Top             =   1560
         Width           =   855
      End
      Begin VB.Line Line2 
         X1              =   0
         X2              =   10200
         Y1              =   1320
         Y2              =   1320
      End
      Begin VB.Label Label7 
         BackStyle       =   0  'Transparent
         Caption         =   "第一通道"
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   120
         TabIndex        =   12
         Top             =   240
         Width           =   855
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Label3"
         Height          =   180
         Left            =   9960
         TabIndex        =   2
         Top             =   5160
         Width           =   540
      End
      Begin VB.Line Line1 
         X1              =   0
         X2              =   0
         Y1              =   3480
         Y2              =   7440
      End
   End
   Begin VB.Label Label11 
      BackStyle       =   0  'Transparent
      Caption         =   "串口选择:"
      Height          =   375
      Left            =   840
      TabIndex        =   17
      Top             =   6720
      Width           =   1095
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "关于本程序"
      Height          =   255
      Left            =   9240
      TabIndex        =   15
      Top             =   6720
      Width           =   975
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "显示通道:"
      Height          =   255
      Left            =   840
      TabIndex        =   10
      Top             =   6360
      Width           =   1335
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Height          =   180
      Left            =   7680
      TabIndex        =   9
      Top             =   5880
      Width           =   90
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "0Bit/s"
      Height          =   180
      Left            =   6360
      TabIndex        =   8
      Top             =   5880
      Width           =   540
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "数据传输率:"
      Height          =   180
      Left            =   4920
      TabIndex        =   7
      Top             =   5880
      Width           =   1080
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "串口还未开启,请单击开始采集按钮"
      Height          =   180
      Left            =   4920
      TabIndex        =   1
      Top             =   6240
      Width           =   2880
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'**********************************************************************************
'
'                          红外线逻辑分析器 ver 0.1
'
'                           Power By WJZ(广公男生)
'
'                           @2004.7

'                           QQ:185856085
'
'                           E-Mail:dddlzhu@163.com
'
'***********************************************************************************




Dim Buffer1(63488) As Byte
Dim Buffer2(63488) As Byte
Dim Buffer3(63488) As Byte
Dim Data_point As Long

Dim Wave_width As Integer
Dim Width_per_BIT As Single

Dim n As Integer
Dim Time As Integer
Dim Data_rate As Long
Dim temp_long As Long

Dim Click_flag As Boolean
Dim Old_X, Old_Y As Single

Dim Flag_about As Boolean






Function Draw_Square_Wave(ByVal Start As Long, ByVal x, Y, Width_per_20us As Integer, ByVal Channel As Integer)
    Dim Time_long As Integer
    Dim HEiGHT, LINE_COLOR, START_Y As Integer
    Dim Temp_buffer, Dp, Dp_old As Integer
    
    START_Y = Y
    HEiGHT = 200
    LINE_COLOR = RGB(0, 0, 255)
    Picture1.Line (0, START_Y)-(1, START_Y), LINE_COLOR
    
    Time_long = Picture1.Width / Width_per_20us
    For i = 0 To Int(Time_long / 8)
        Select Case Channel
            Case 1
                Temp_buffer = Buffer1(Start + i)
            Case 2
                Temp_buffer = Buffer2(Start + i)
            Case 3
                Temp_buffer = Buffer3(Start + i)
        End Select
        k = 0
        For j = 7 To 0 Step -1
            k = k + 1
            Dp = Int(Temp_buffer / 2 ^ j)
            
            If Dp = 0 Then
                If Dp_old = 0 Then Picture1.Line -((i * 8 + k) * Width_per_20us, START_Y), LINE_COLOR
                If Dp_old = 1 Then
                    Picture1.Line -((i * 8 + k - 1) * Width_per_20us, START_Y), LINE_COLOR
                    Picture1.Line -((i * 8 + k) * Width_per_20us, START_Y), LINE_COLOR
                End If
            End If
            If Dp = 1 Then
                Temp_buffer = Temp_buffer - 2 ^ j
                If Dp_old = 1 Then Picture1.Line -((i * 8 + k) * Width_per_20us, START_Y - HEiGHT), LINE_COLOR
                If Dp_old = 0 Then
                    Picture1.Line -((i * 8 + k - 1) * Width_per_20us, START_Y - HEiGHT), LINE_COLOR
                    Picture1.Line -((i * 8 + k) * Width_per_20us, START_Y - HEiGHT), LINE_COLOR
                End If
                
            End If
            Dp_old = Dp
        Next
        
    
    Next
    
    
        Picture1.Line (0, Y + 200)-(Picture1.Width, START_Y + 200), RGB(200, 200, 255)

⌨️ 快捷键说明

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