📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "AD9951"
ClientHeight = 6645
ClientLeft = 60
ClientTop = 345
ClientWidth = 6330
LinkTopic = "Form1"
ScaleHeight = 6645
ScaleWidth = 6330
StartUpPosition = 3 'Windows-Standard
Begin VB.Frame Frame2
Caption = "RefClk Multiplier"
Height = 1695
Left = 120
TabIndex = 22
Top = 4800
Width = 2895
Begin VB.HScrollBar HScroll1
Height = 255
Left = 1440
Max = 20
Min = 4
TabIndex = 29
Top = 1200
Value = 4
Width = 1215
End
Begin VB.OptionButton Option13
Caption = "On"
Height = 375
Left = 240
TabIndex = 25
Top = 840
Value = -1 'True
Width = 975
End
Begin VB.OptionButton Option12
Caption = "Off"
Height = 375
Left = 240
TabIndex = 24
Top = 1200
Width = 735
End
Begin VB.TextBox Text2
Height = 285
Left = 240
TabIndex = 23
Text = "80"
Top = 480
Width = 1215
End
Begin VB.Label Label10
Caption = "5"
Height = 255
Left = 2280
TabIndex = 31
Top = 960
Width = 615
End
Begin VB.Label Label9
Caption = "Multfaktor"
Height = 255
Left = 1440
TabIndex = 30
Top = 960
Width = 1215
End
Begin VB.Label Label6
Caption = "SystemClk"
Height = 255
Left = 1800
TabIndex = 28
Top = 240
Width = 855
End
Begin VB.Label Label5
Caption = "RefClk in MHz"
Height = 255
Left = 240
TabIndex = 27
Top = 240
Width = 1215
End
Begin VB.Label Label4
BorderStyle = 1 'Fest Einfach
Height = 255
Left = 1560
TabIndex = 26
Top = 480
Width = 855
End
End
Begin VB.TextBox Text1
Height = 285
Left = 3480
TabIndex = 18
Text = "0"
Top = 4320
Width = 735
End
Begin VB.CommandButton Command4
Caption = "DDS Reset"
Height = 495
Left = 3360
TabIndex = 17
Top = 5640
Width = 975
End
Begin VB.Frame Frame1
Caption = "LPT Port"
Height = 1815
Left = 1800
TabIndex = 12
Top = 2280
Width = 3735
Begin VB.OptionButton Option11
Caption = "LPT3 : HEX3BC"
Height = 375
Left = 240
TabIndex = 15
Top = 1320
Width = 1575
End
Begin VB.OptionButton Option10
Caption = "LPT2 : HEX278"
Height = 495
Left = 240
TabIndex = 14
Top = 720
Width = 1575
End
Begin VB.OptionButton Option9
Caption = "LPT1 : HEX378"
Height = 375
Left = 240
TabIndex = 13
Top = 240
Value = -1 'True
Width = 1575
End
Begin VB.Label Label2
Caption = $"Form1.frx":0000
Height = 1455
Left = 2040
TabIndex = 16
Top = 240
Width = 1575
End
End
Begin VB.CommandButton Command3
Cancel = -1 'True
Caption = "Exit"
Height = 495
Left = 5040
TabIndex = 11
Top = 5640
Width = 975
End
Begin VB.CommandButton Command2
Caption = "Up"
CausesValidation= 0 'False
Default = -1 'True
Height = 495
Left = 4320
Style = 1 'Grafisch
TabIndex = 10
Top = 1560
Width = 615
End
Begin VB.CommandButton Command1
Caption = "Down"
Height = 495
Left = 1800
TabIndex = 9
Top = 1560
Width = 615
End
Begin VB.OptionButton Option8
Caption = "10 MHZ"
Height = 375
Left = 360
TabIndex = 7
Top = 4200
Width = 1215
End
Begin VB.OptionButton Option7
Caption = "1 MHz"
Height = 375
Left = 360
TabIndex = 6
Top = 3720
Width = 855
End
Begin VB.OptionButton Option6
Caption = "100 kHz"
Height = 375
Left = 360
TabIndex = 5
Top = 3240
Width = 975
End
Begin VB.OptionButton Option5
Caption = "10 kHz"
Height = 375
Left = 360
TabIndex = 4
Top = 2760
Value = -1 'True
Width = 855
End
Begin VB.OptionButton Option4
Caption = "1 kHz"
Height = 375
Left = 360
TabIndex = 3
Top = 2280
Width = 855
End
Begin VB.OptionButton Option3
Caption = "100 Hz"
Height = 375
Left = 360
TabIndex = 2
Top = 1800
Width = 855
End
Begin VB.OptionButton Option2
Caption = "10 Hz"
Height = 375
Left = 360
TabIndex = 1
Top = 1320
Width = 855
End
Begin VB.OptionButton Option1
Caption = "1 Hz"
Height = 375
Left = 360
TabIndex = 0
Top = 840
Width = 855
End
Begin VB.Label Label8
Caption = "Frequenz"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 21
Top = 240
Width = 1575
End
Begin VB.Label Label7
Caption = "Schrittweite"
Height = 255
Left = 360
TabIndex = 20
Top = 600
Width = 855
End
Begin VB.Label Label3
Caption = "IF in kHz addieren"
Height = 375
Left = 2040
TabIndex = 19
Top = 4320
Width = 1335
End
Begin VB.Label Label1
Caption = "0,000000 MHz"
BeginProperty Font
Name = "MS Sans Serif"
Size = 24
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 8
Top = 840
Width = 4095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'LPT Port D0=Data, D1=Clock, D2=Strobe, D3=Reset
Dim refclk 'As Double
Dim multfaktor 'As Double
Dim cfr2_mult As Byte 'einstellungen des refclk multipliers im dds
Dim PortAddress As String
Dim qrg As Double
Dim delta As Double 'frequenz鋘derungsschritte
Dim freqHiH As Byte '4 byte mit der frequenzinformation f黵 den dds
Dim freqHiL As Byte
Dim freqLoH As Byte
Dim freqLoL As Byte
Dim datenwort As Byte 'bekommt die daten f黵 die parallele datenausgabe
Dim offset 'IF in kHz
Private Sub Command1_Click()
'frequenz verringern, delta ist die schrittweite
qrg = qrg - delta
If qrg > 160 Then
MsgBox ("Die eingestellte Frequenz darf nicht gr鲞er als 160 MHz sein!!")
qrg = 160 'qrg = Format(160, "0.000000")
End If
If qrg < 0 Then
MsgBox ("Die eingestellte Frequenz muss gr鲞er als 0 MHz sein!!")
qrg = 0 'qrg = Format(0, "0.000000")
End If
Label1.Caption = Format(qrg, "0.000000") & " MHz"
datenwortberechnen
End Sub
Private Sub Command2_Click()
'frequenz erh鰄en, delta ist die schrittweite
qrg = qrg + delta
If qrg > 160 Then
MsgBox ("Die eingestellte Frequenz darf nicht gr鲞er als 160 MHz sein!!")
qrg = 160 'qrg = Format(160, "0.000000")
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -