📄 main.frm
字号:
Height = 1335
Left = 2040
Max = 254
Min = 2
TabIndex = 4
Top = 2400
Value = 2
Width = 255
End
Begin VB.VScrollBar VScroll4
Height = 1335
Left = 1560
Max = 254
Min = 2
TabIndex = 3
Top = 2400
Value = 2
Width = 255
End
Begin VB.VScrollBar VScroll3
Height = 1335
Left = 1080
Max = 254
Min = 2
TabIndex = 2
Top = 2400
Value = 2
Width = 255
End
Begin VB.VScrollBar VScroll2
Height = 1335
Left = 600
Max = 254
Min = 2
TabIndex = 1
Top = 2400
Value = 2
Width = 255
End
Begin VB.VScrollBar VScroll20
Height = 1335
Left = 3480
Max = 254
Min = 2
TabIndex = 0
Top = 4680
Value = 2
Width = 255
End
Begin MSCommLib.MSComm MSComm
Left = 3840
Top = 720
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
End
Begin VB.Label Label1
Caption = " SPEED"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1560
TabIndex = 40
Top = 720
Width = 1335
End
Begin VB.Label Label10
Caption = "13 14 15 16 17 18 19 20 21 22 23 24"
Height = 255
Left = 240
TabIndex = 21
Top = 3960
Width = 5535
End
Begin VB.Label Label9
Caption = " 1 2 3 4 5 6 7 8 9 10 11 12"
Height = 255
Left = 120
TabIndex = 20
Top = 1680
Width = 5655
End
Begin VB.Label Label8
Caption = "SERVO MOTOR CONTROL SYS"
BeginProperty Font
Name = "SimSun"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 600
TabIndex = 19
Top = 120
Width = 3135
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
Begin VB.Menu mnuTools
Caption = "&Tools"
Begin VB.Menu mnuOptionsGeneral
Caption = "&General..."
End
Begin VB.Menu mnuToolsLexicon
Caption = "&Lexicon..."
End
Begin VB.Menu mnuToolsTraining
Caption = "&Training...."
End
End
Begin VB.Menu mnuHelp
Caption = "&Help"
Begin VB.Menu mnuHelpAbout
Caption = "&About Alpha..."
End
End
End
Attribute VB_Name = "frmAlpha"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Public samething As String
Public intfreefile As String
Public bstru As String
Public t As String
Public motor As Integer
Public Speed As Integer
Public position As Integer
Private Function Init()
Dim dwIncomplete As Long
Dim dwComplete As Long
End Function
Private Sub ANGRY_Click()
t$ = "angry"
Call Expressions
End Sub
Private Sub CALM_Click()
t$ = "calm"
Call Expressions
End Sub
Private Sub Command1_Click()
Dim i As Integer
Dim dely As Integer
Dim dely1 As Integer
If Command1.Caption = "Random" Then
Command1.Caption = "stop"
For i = 1 To 10000
motor = 16 * Rnd(16) + 4
Text2 = motor
Speed = 7 * Rnd(7)
Text3 = Speed
HScroll1 = Speed
If motor > 9 And motor < 13 Then
position = 63 + 127 * Rnd(127)
Else: position = 2 + 252 * Rnd(252)
End If
Text4 = position
'VScroll(motor) = position
Select Case motor
Case 1
VScroll1.Value = position
Case 2
VScroll2.Value = position
Case 3
VScroll3.Value = position
Case 4
VScroll4.Value = position
Case 5
VScroll5.Value = position
Case 6
VScroll6.Value = position
Case 7
VScroll7 = position
Case 8
VScroll8 = position
Case 9
VScroll9 = position
Case 10
VScroll10 = position
Case 11
VScroll11 = position
Case 12
VScroll12 = position
Case 13
VScroll13 = position
Case 14
VScroll14 = position
Case 15
VScroll15 = position
Case 16
VScroll16 = position
Case 17
VScroll17 = position
Case 18
VScroll18 = position
Case 19
VScroll19 = position
Case 20
VScroll20 = position
End Select
For dely1 = 1 To 200
For dely = 1 To 30000
Next dely
Next dely1
DoEvents
If Command1.Caption = "Random" Then i = 10000
Next i
ElseIf Command1.Caption = "stop" Then Command1.Caption = "Random"
End If
End Sub
Private Sub Command2_Click()
List1.AddItem File1
End Sub
Private Sub Command7_Click()
File1.Pattern = "*.*"
File1.Pattern = "*.txt"
End Sub
Private Sub File1_Click()
t$ = File1
Call Expressions
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Text6_Change()
Text6.Text = VScroll20
End Sub
Private Sub cmdExit_Click()
Unload Me
End
End Sub
Private Sub SAVE_Click()
'SAVE the Conversation Focus File "
'Depending on the subject this rutine should be used to save in the subject file
If Text1 = "" Then
MsgBox "flename need fill"
Else: t$ = Text1 + ".txt"
2030 intfreefile = FreeFile(): Open t$ For Output As #intfreefile
Speed = 3
Print #intfreefile, Val(20)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll20)
Print #intfreefile, Val(2)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll2)
Print #intfreefile, Val(3)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll3)
Print #intfreefile, Val(4)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll4)
Print #intfreefile, Val(5)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll5)
Print #intfreefile, Val(6)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll6)
Print #intfreefile, Val(7)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll7)
Print #intfreefile, Val(8)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll8)
Print #intfreefile, Val(9)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll9)
Print #intfreefile, Val(10)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll10)
Print #intfreefile, Val(11)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll11)
Print #intfreefile, Val(12)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll12)
Print #intfreefile, Val(13)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll13)
Print #intfreefile, Val(14)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll14)
Print #intfreefile, Val(15)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll15)
Print #intfreefile, Val(16)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll16)
Print #intfreefile, Val(17)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll17)
Print #intfreefile, Val(18)
Print #intfreefile, Val(Speed)
Print #intfreefile, Val(VScroll18)
2050 Close #intfreefile
File1.Pattern = "*.*"
File1.Pattern = "*.txt"
End If
End Sub
Private Sub LOAD_Click()
Dim motor
Dim Speed
Dim position
t$ = Text1 + ".txt"
If t$ = "" Then t$ = File1
3050 intfreefile = FreeFile(): Open t$ For Input As #intfreefile
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll20 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll2 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll3 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll4 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll5 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll6 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll7 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll8 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll9 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll10 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll11 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll12 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll13 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll14 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll15 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll16 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll17 = position ': SendData Val(motor), Val(Speed), Val(position)
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll18 = position ': SendData Val(motor), Val(Speed), Val(position)
3090 Close #intfreefile
End Sub
Function Expressions()
Dim motor
Dim Speed
Dim position
Dim dely
Picture1.Picture = LoadPicture("lamp.bmp")
3050 intfreefile = FreeFile(): Open t$ For Input As #intfreefile
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll20 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll2 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll3 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll4 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor: For dely = 1 To 10000: Next dely
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll5 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll6 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll7 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll8 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll9 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll10 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll11 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll12 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll13 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll14 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll15 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
Line Input #intfreefile, motor
Line Input #intfreefile, Speed
Line Input #intfreefile, position
VScroll16 = position ': SendData Val(motor), Val(Speed), Val(position): For dely = 1 To 10000: Next dely
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -