VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "SMC terminal (ver.: 2.34_Frissítve : 2016.07.08. - ZoliSoft)"
   ClientHeight    =   9315
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   14730
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   9315
   ScaleWidth      =   14730
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame Frame2 
      Caption         =   "Motor teszt"
      Height          =   4095
      Left            =   10200
      TabIndex        =   45
      Top             =   120
      Width           =   4455
      Begin VB.TextBox txtEncoder 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3360
         MaxLength       =   4
         TabIndex        =   124
         Text            =   "500"
         Top             =   3000
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.HScrollBar HScroll11 
         Height          =   255
         LargeChange     =   100
         Left            =   3360
         Max             =   5000
         Min             =   2000
         SmallChange     =   20
         TabIndex        =   107
         Top             =   2640
         Value           =   2000
         Width           =   975
      End
      Begin VB.CheckBox Check3 
         Alignment       =   1  'Right Justify
         Height          =   255
         Left            =   3960
         TabIndex        =   105
         Top             =   1920
         Width           =   345
      End
      Begin VB.OptionButton Option3 
         Caption         =   "Option3"
         Height          =   255
         Left            =   1800
         TabIndex        =   74
         Top             =   3000
         Visible         =   0   'False
         Width           =   855
      End
      Begin VB.OptionButton Option2 
         Alignment       =   1  'Right Justify
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   238
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Left            =   3360
         TabIndex        =   65
         Top             =   1920
         Width           =   255
      End
      Begin VB.OptionButton Option1 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   238
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   270
         Left            =   3720
         TabIndex        =   64
         Top             =   1920
         Value           =   -1  'True
         Width           =   255
      End
      Begin VB.CommandButton Command34 
         Caption         =   "STOP / RESET"
         BeginProperty Font 
            Name            =   "Microsoft Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   120
         TabIndex        =   61
         Top             =   3360
         Width           =   4215
      End
      Begin VB.HScrollBar HScroll2 
         Height          =   255
         LargeChange     =   10
         Left            =   3360
         Max             =   600
         SmallChange     =   2
         TabIndex        =   60
         Top             =   1200
         Value           =   20
         Width           =   975
      End
      Begin VB.CommandButton Command32 
         Caption         =   " PID - szabályozott motor futás"
         Height          =   255
         Left            =   120
         TabIndex        =   58
         Top             =   840
         Width           =   4215
      End
      Begin VB.CommandButton Command31 
         Caption         =   "Feszültség - vezérelt motor futás"
         Height          =   255
         Left            =   120
         TabIndex        =   57
         Top             =   480
         Width           =   4215
      End
      Begin VB.TextBox Text9 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   3360
         MaxLength       =   4
         TabIndex        =   56
         Text            =   "2000"
         Top             =   2280
         Width           =   975
      End
      Begin VB.CommandButton Command33 
         Caption         =   "Léptetés mód"
         Height          =   255
         Left            =   1200
         TabIndex        =   59
         Top             =   120
         Visible         =   0   'False
         Width           =   1455
      End
      Begin VB.Label Label14 
         Caption         =   "Label12"
         Height          =   255
         Left            =   0
         TabIndex        =   125
         Top             =   1080
         Visible         =   0   'False
         Width           =   375
      End
      Begin VB.Label Label28 
         BackStyle       =   0  'Transparent
         Caption         =   "Encoder felbontása :"
         Height          =   255
         Left            =   120
         TabIndex        =   123
         Top             =   3000
         Visible         =   0   'False
         Width           =   2295
      End
      Begin VB.Label Label26 
         BackStyle       =   0  'Transparent
         Caption         =   "Lépés ismétlése P0 értéken ( + - ) :"
         Height          =   255
         Left            =   120
         TabIndex        =   120
         Top             =   1920
         Width           =   3135
      End
      Begin VB.Label Label24 
         BackStyle       =   0  'Transparent
         Caption         =   "Lépések közötti ismétlődés idő :"
         Height          =   255
         Left            =   120
         TabIndex        =   106
         Top             =   2640
         Width           =   2535
      End
      Begin VB.Label Label13 
         Alignment       =   1  'Right Justify
         BackStyle       =   0  'Transparent
         Caption         =   "20"
         Height          =   195
         Left            =   0
         TabIndex        =   66
         Top             =   1320
         Visible         =   0   'False
         Width           =   495
      End
      Begin VB.Label Label11 
         BackStyle       =   0  'Transparent
         Caption         =   "Lépés száma :"
         Height          =   255
         Left            =   120
         TabIndex        =   63
         Top             =   2280
         Width           =   2535
      End
      Begin VB.Label Label9 
         BackStyle       =   0  'Transparent
         Caption         =   "Sebesség : (PID -  fesz.vezérelt módban):"
         Height          =   255
         Left            =   120
         TabIndex        =   62
         Top             =   1200
         Width           =   3135
      End
   End
   Begin ComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   44
      Top             =   8940
      Width           =   14730
      _ExtentX        =   25982
      _ExtentY        =   661
      SimpleText      =   ""
      _Version        =   327682
      BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
         NumPanels       =   2
         BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            Object.Width           =   7232
            MinWidth        =   7232
            Text            =   "Mikrokontroller COM Port beállítás : COM1,38400,N,8,1"
            TextSave        =   "Mikrokontroller COM Port beállítás : COM1,38400,N,8,1"
            Object.Tag             =   ""
            Object.ToolTipText     =   "COM port beállítása"
         EndProperty
         BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
            AutoSize        =   1
            Object.Width           =   18680
            Picture         =   "Form1.frx":0442
            Text            =   "Help : Mozgasd az egér kurzort a gombok vagy érték mező fölé."
            TextSave        =   "Help : Mozgasd az egér kurzort a gombok vagy érték mező fölé."
            Object.Tag             =   ""
            Object.ToolTipText     =   "Online segítség"
         EndProperty
      EndProperty
   End
   Begin VB.Frame Frame1 
      Caption         =   "Paraméterek módosítása"
      Height          =   4095
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   9975
      Begin VB.CommandButton AutoTuning 
         Caption         =   "Auto TUNING"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   6600
         TabIndex        =   119
         Top             =   3360
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.HScrollBar HScroll12 
         Height          =   255
         LargeChange     =   1000
         Left            =   1560
         Max             =   10000
         Min             =   1000
         SmallChange     =   100
         TabIndex        =   114
         Top             =   3360
         Value           =   5000
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton cmdIdotAd 
         Caption         =   "Command42"
         Height          =   255
         Left            =   0
         TabIndex        =   112
         Top             =   2400
         Visible         =   0   'False
         Width           =   1575
      End
      Begin VB.TextBox Text23 
         Height          =   375
         Left            =   2280
         TabIndex        =   111
         Text            =   "0"
         Top             =   3720
         Visible         =   0   'False
         Width           =   495
      End
      Begin VB.TextBox Text22 
         Height          =   375
         Left            =   1800
         TabIndex        =   110
         Text            =   "0"
         Top             =   3720
         Visible         =   0   'False
         Width           =   495
      End
      Begin VB.Timer Timer2 
         Left            =   9600
         Top             =   2160
      End
      Begin VB.TextBox Text21 
         Alignment       =   2  'Center
         Height          =   285
         Left            =   7680
         TabIndex        =   92
         Text            =   "0"
         Top             =   3960
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.TextBox Text19 
         Alignment       =   2  'Center
         Height          =   285
         Left            =   5520
         TabIndex        =   89
         Text            =   "0"
         Top             =   3840
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.Timer Timer1 
         Left            =   9600
         Top             =   1680
      End
      Begin VB.TextBox Text18 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         Locked          =   -1  'True
         TabIndex        =   88
         Text            =   "0"
         Top             =   3840
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.HScrollBar HScroll10 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   1000
         Min             =   1
         TabIndex        =   87
         Top             =   3000
         Value           =   1
         Width           =   2415
      End
      Begin VB.HScrollBar HScroll9 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   4096
         Min             =   1
         TabIndex        =   86
         Top             =   2640
         Value           =   256
         Width           =   2415
      End
      Begin VB.HScrollBar HScroll8 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   5000
         Min             =   1
         TabIndex        =   85
         Top             =   2280
         Value           =   1
         Width           =   2415
      End
      Begin VB.HScrollBar HScroll7 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   250
         Min             =   1
         TabIndex        =   84
         Top             =   1920
         Value           =   1
         Width           =   2415
      End
      Begin VB.HScrollBar HScroll6 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   1000
         Min             =   1
         TabIndex        =   83
         Top             =   1560
         Value           =   1
         Width           =   2415
      End
      Begin VB.HScrollBar HScroll5 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   5000
         Min             =   1
         TabIndex        =   82
         Top             =   1200
         Value           =   1
         Width           =   2415
      End
      Begin VB.HScrollBar HScroll4 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   5000
         Min             =   1
         TabIndex        =   81
         Top             =   840
         Value           =   1
         Width           =   2415
      End
      Begin VB.HScrollBar HScroll3 
         Height          =   255
         LargeChange     =   10
         Left            =   3960
         Max             =   1000
         Min             =   10
         TabIndex        =   80
         Top             =   480
         Value           =   10
         Width           =   2415
      End
      Begin VB.CommandButton Command35 
         Caption         =   "Töröl"
         Height          =   375
         Left            =   2400
         TabIndex        =   76
         Top             =   4200
         Visible         =   0   'False
         Width           =   1695
      End
      Begin VB.TextBox txtelkuld 
         Height          =   285
         Left            =   7560
         TabIndex        =   73
         Text            =   "Text19"
         Top             =   120
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.CheckBox Check1 
         Caption         =   "Új értéket azonnal elküld."
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   255
         Left            =   3960
         TabIndex        =   67
         Top             =   3360
         Visible         =   0   'False
         Width           =   2415
      End
      Begin VB.CommandButton Command27 
         Caption         =   "Mind TESZT"
         BeginProperty Font 
            Name            =   "Microsoft Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   7800
         TabIndex        =   55
         Top             =   3360
         Width           =   975
      End
      Begin VB.CommandButton Command26 
         Caption         =   "P7-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   54
         Top             =   3000
         Width           =   975
      End
      Begin VB.CommandButton Command25 
         Caption         =   "P6-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   53
         Top             =   2640
         Width           =   975
      End
      Begin VB.CommandButton Command24 
         Caption         =   "P5-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   52
         Top             =   2280
         Width           =   975
      End
      Begin VB.CommandButton Command23 
         Caption         =   "P4-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   51
         Top             =   1920
         Width           =   975
      End
      Begin VB.CommandButton Command22 
         Caption         =   "P3-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   50
         Top             =   1560
         Width           =   975
      End
      Begin VB.CommandButton Command21 
         Caption         =   "P2-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   49
         Top             =   1200
         Width           =   975
      End
      Begin VB.CommandButton Command2 
         Caption         =   "P1-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   48
         Top             =   840
         Width           =   975
      End
      Begin VB.HScrollBar HScroll1 
         Height          =   375
         LargeChange     =   10
         Left            =   120
         Max             =   9999
         Min             =   1
         TabIndex        =   46
         Tag             =   "asd"
         Top             =   120
         Value           =   1
         Visible         =   0   'False
         Width           =   2175
      End
      Begin VB.CommandButton Command20 
         Caption         =   "Mind MENT"
         BeginProperty Font 
            Name            =   "Microsoft Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   8880
         TabIndex        =   43
         Top             =   3360
         Width           =   975
      End
      Begin VB.CommandButton Command19 
         Caption         =   "P7-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   42
         Top             =   3000
         Width           =   975
      End
      Begin VB.CommandButton Command18 
         Caption         =   "P6-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   41
         Top             =   2640
         Width           =   975
      End
      Begin VB.CommandButton Command17 
         Caption         =   "P5-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   40
         Top             =   2280
         Width           =   975
      End
      Begin VB.CommandButton Command16 
         Caption         =   "P4-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   39
         Top             =   1920
         Width           =   975
      End
      Begin VB.CommandButton Command15 
         Caption         =   "P3-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   38
         Top             =   1560
         Width           =   975
      End
      Begin VB.CommandButton Command14 
         Caption         =   "P2-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   37
         Top             =   1200
         Width           =   975
      End
      Begin VB.CommandButton Command13 
         Caption         =   "P1-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   36
         Top             =   840
         Width           =   975
      End
      Begin VB.CommandButton Command1 
         Caption         =   "P0-TESZT"
         Height          =   255
         Left            =   7800
         TabIndex        =   35
         Top             =   480
         Width           =   975
      End
      Begin VB.TextBox Text17 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   34
         Top             =   3000
         Width           =   975
      End
      Begin VB.TextBox Text16 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   33
         Top             =   2640
         Width           =   975
      End
      Begin VB.TextBox Text15 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   32
         Top             =   2280
         Width           =   975
      End
      Begin VB.TextBox Text14 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   31
         Top             =   1920
         Width           =   975
      End
      Begin VB.TextBox Text13 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   30
         Top             =   1560
         Width           =   975
      End
      Begin VB.TextBox Text12 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   29
         Top             =   1200
         Width           =   975
      End
      Begin VB.TextBox Text11 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   28
         Top             =   840
         Width           =   975
      End
      Begin VB.TextBox Text1 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":075C
         MousePointer    =   99  'Custom
         TabIndex        =   18
         Top             =   480
         Width           =   975
      End
      Begin VB.TextBox Text2 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":0B9E
         MousePointer    =   99  'Custom
         TabIndex        =   17
         Top             =   840
         Width           =   975
      End
      Begin VB.TextBox Text3 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":0FE0
         MousePointer    =   99  'Custom
         TabIndex        =   16
         Top             =   1200
         Width           =   975
      End
      Begin VB.TextBox Text4 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":1422
         MousePointer    =   99  'Custom
         TabIndex        =   15
         Top             =   1560
         Width           =   975
      End
      Begin VB.TextBox Text5 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":1864
         MousePointer    =   99  'Custom
         TabIndex        =   14
         Top             =   1920
         Width           =   975
      End
      Begin VB.TextBox Text6 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":1CA6
         MousePointer    =   99  'Custom
         TabIndex        =   13
         Top             =   2280
         Width           =   975
      End
      Begin VB.TextBox Text7 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":20E8
         MousePointer    =   99  'Custom
         TabIndex        =   12
         Top             =   2640
         Width           =   975
      End
      Begin VB.TextBox Text8 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         MouseIcon       =   "Form1.frx":252A
         MousePointer    =   99  'Custom
         TabIndex        =   11
         Top             =   3000
         Width           =   975
      End
      Begin VB.CommandButton Command3 
         Caption         =   "Mind KIOLVAS"
         BeginProperty Font 
            Name            =   "Microsoft Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   2760
         TabIndex        =   10
         Top             =   3360
         Width           =   975
      End
      Begin VB.CommandButton Command4 
         Caption         =   "P0 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   9
         Top             =   480
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command5 
         Caption         =   "P1 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   8
         Top             =   840
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command6 
         Caption         =   "P2 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   7
         Top             =   1200
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command7 
         Caption         =   "P3 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   6
         Top             =   1560
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command8 
         Caption         =   "P4 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   5
         Top             =   1920
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command9 
         Caption         =   "P5 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   4
         Top             =   2280
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command10 
         Caption         =   "P6 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   3
         Top             =   2640
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command11 
         Caption         =   "P7 Kiolvas"
         Height          =   255
         Left            =   1560
         TabIndex        =   2
         Top             =   3000
         Visible         =   0   'False
         Width           =   975
      End
      Begin VB.CommandButton Command12 
         Caption         =   "P0-MENT"
         Height          =   255
         Left            =   8880
         TabIndex        =   1
         Top             =   480
         Width           =   975
      End
      Begin VB.TextBox Text10 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   6600
         MaxLength       =   5
         TabIndex        =   27
         Top             =   480
         Width           =   975
      End
      Begin VB.Label Label27 
         BackStyle       =   0  'Transparent
         Caption         =   "Új érték beállítása"
         Height          =   255
         Left            =   3960
         TabIndex        =   121
         Top             =   240
         Width           =   1815
      End
      Begin VB.Label Label23 
         BackStyle       =   0  'Transparent
         Caption         =   "Olvasás idő : 50"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   238
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   116
         Top             =   3360
         Visible         =   0   'False
         Width           =   1575
      End
      Begin VB.Label Label22 
         Caption         =   "Label22"
         Height          =   375
         Left            =   3600
         TabIndex        =   113
         Top             =   120
         Visible         =   0   'False
         Width           =   1575
      End
      Begin VB.Label Label16 
         BackStyle       =   0  'Transparent
         Caption         =   "Új érték"
         Height          =   255
         Left            =   6600
         TabIndex        =   78
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label15 
         BackStyle       =   0  'Transparent
         Caption         =   "Aktuális érték"
         Height          =   255
         Left            =   2760
         TabIndex        =   77
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label Label10 
         BackStyle       =   0  'Transparent
         Caption         =   "?"
         Height          =   255
         Left            =   2280
         TabIndex        =   47
         Top             =   120
         Visible         =   0   'False
         Width           =   1095
      End
      Begin VB.Label Label8 
         BackStyle       =   0  'Transparent
         Caption         =   "P7 - ( D - gain )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   26
         Top             =   3000
         Width           =   2535
      End
      Begin VB.Label Label7 
         BackStyle       =   0  'Transparent
         Caption         =   "P6 - ( Gear ratio )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   25
         Top             =   2640
         Width           =   2895
      End
      Begin VB.Label Label6 
         BackStyle       =   0  'Transparent
         Caption         =   "P5 - ( EMF )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   24
         Top             =   2280
         Width           =   3255
      End
      Begin VB.Label Label5 
         BackStyle       =   0  'Transparent
         Caption         =   "P4 - ( Torque limit )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   23
         Top             =   1920
         Width           =   2775
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "P3 - ( I - gain )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   22
         Top             =   1560
         Width           =   2775
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "P2 - ( P - gain )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   21
         Top             =   1200
         Width           =   2535
      End
      Begin VB.Label Label2 
         BackStyle       =   0  'Transparent
         Caption         =   "P1 - ( Velocity feedback )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   20
         Top             =   840
         Width           =   2535
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "P0 - ( Velocity limit )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   19
         Top             =   480
         Width           =   2415
      End
   End
   Begin MSCommLib.MSComm MSComm1 
      Left            =   3600
      Top             =   -120
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
      BaudRate        =   38400
   End
   Begin VB.Frame Frame4 
      Caption         =   "Pozíció hiba monitorozás"
      Height          =   4455
      Left            =   120
      TabIndex        =   90
      Top             =   4320
      Width           =   14535
      Begin VB.CommandButton Command28 
         Caption         =   "Nulláz"
         Height          =   255
         Left            =   13560
         TabIndex        =   122
         Top             =   2040
         Width           =   855
      End
      Begin VB.TextBox Text24 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   285
         Left            =   13560
         TabIndex        =   118
         Text            =   "0"
         Top             =   1680
         Width           =   855
      End
      Begin VB.CommandButton Command42 
         Caption         =   "RESET"
         Height          =   255
         Left            =   10080
         TabIndex        =   115
         Top             =   3360
         Visible         =   0   'False
         Width           =   735
      End
      Begin VB.ComboBox Combo2 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   13560
         TabIndex        =   109
         Text            =   "30"
         Top             =   720
         Width           =   855
      End
      Begin VB.HScrollBar HScrollsebesseg 
         Height          =   255
         Left            =   11880
         Max             =   25
         Min             =   1
         TabIndex        =   103
         Top             =   3360
         Value           =   1
         Visible         =   0   'False
         Width           =   735
      End
      Begin VB.CheckBox Check2 
         Caption         =   "Pillanatnyi pozíció hiba :"
         Height          =   255
         Left            =   10080
         TabIndex        =   102
         Top             =   1250
         Value           =   1  'Checked
         Width           =   2655
      End
      Begin VB.CommandButton Command39 
         Caption         =   "Nulláz_old"
         Height          =   255
         Left            =   10800
         TabIndex        =   101
         Top             =   3360
         Visible         =   0   'False
         Width           =   1095
      End
      Begin VB.TextBox Text20 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   285
         Left            =   13560
         Locked          =   -1  'True
         TabIndex        =   100
         Text            =   "0"
         Top             =   1200
         Width           =   855
      End
      Begin VB.CommandButton Command41 
         Caption         =   " SMCparam.txt filében tárolt paraméterek listája"
         Height          =   495
         Left            =   10080
         TabIndex        =   99
         Top             =   3720
         Width           =   4335
      End
      Begin VB.ComboBox Combo1 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   315
         Left            =   13560
         TabIndex        =   97
         Text            =   "500"
         Top             =   240
         Width           =   855
      End
      Begin VB.PictureBox Picture1 
         BackColor       =   &H80000005&
         Height          =   4000
         Left            =   720
         ScaleHeight     =   3925.373
         ScaleMode       =   0  'User
         ScaleWidth      =   9180
         TabIndex        =   91
         Top             =   240
         Width           =   9240
         Begin VB.Line Line1 
            BorderColor     =   &H80000001&
            X1              =   0
            X2              =   9240
            Y1              =   2000
            Y2              =   2000
         End
      End
      Begin ComctlLib.ProgressBar Hibajel 
         Height          =   135
         Left            =   12720
         TabIndex        =   104
         Top             =   3480
         Visible         =   0   'False
         Width           =   495
         _ExtentX        =   873
         _ExtentY        =   238
         _Version        =   327682
         Appearance      =   0
         Max             =   4000
      End
      Begin VB.Label Label25 
         BackStyle       =   0  'Transparent
         Caption         =   "Legnagyobb pozíció hiba :"
         Height          =   255
         Left            =   10080
         TabIndex        =   117
         Top             =   1700
         Width           =   2775
      End
      Begin VB.Label Label21 
         BackStyle       =   0  'Transparent
         Caption         =   "Idő skála  :"
         Height          =   255
         Left            =   10080
         TabIndex        =   108
         Top             =   825
         Width           =   2655
      End
      Begin VB.Label Label20 
         BackStyle       =   0  'Transparent
         Caption         =   "Hibajel skála (+ -) :"
         Height          =   255
         Left            =   10080
         TabIndex        =   96
         Top             =   360
         Width           =   1695
      End
      Begin VB.Label Label19 
         Alignment       =   1  'Right Justify
         BackStyle       =   0  'Transparent
         Caption         =   "-500"
         Height          =   255
         Left            =   120
         TabIndex        =   95
         Top             =   4080
         Width           =   495
      End
      Begin VB.Label Label18 
         Alignment       =   1  'Right Justify
         BackStyle       =   0  'Transparent
         Caption         =   "+500"
         Height          =   255
         Left            =   120
         TabIndex        =   94
         Top             =   240
         Width           =   495
      End
      Begin VB.Label Label17 
         Alignment       =   1  'Right Justify
         BackStyle       =   0  'Transparent
         Caption         =   "0."
         Height          =   255
         Left            =   120
         TabIndex        =   93
         Top             =   2160
         Width           =   495
      End
   End
   Begin VB.Frame Frame3 
      Caption         =   "SMCparam.txt filében tárolt paraméterek"
      Height          =   4455
      Left            =   120
      TabIndex        =   68
      Top             =   4320
      Width           =   14535
      Begin VB.CommandButton Command40 
         Caption         =   "Pozíció hiba monitorozás"
         Height          =   495
         Left            =   10200
         TabIndex        =   98
         Top             =   3650
         Width           =   4215
      End
      Begin VB.CommandButton Command38 
         Caption         =   "Command38"
         Height          =   255
         Left            =   8760
         TabIndex        =   79
         Top             =   1080
         Visible         =   0   'False
         Width           =   1215
      End
      Begin VB.CommandButton Command37 
         Caption         =   "Paraméterlista mentése filébe"
         Height          =   495
         Left            =   8760
         TabIndex        =   72
         Top             =   1320
         Visible         =   0   'False
         Width           =   1215
      End
      Begin VB.CommandButton Command36 
         Caption         =   "Kiválasztott paramétersor betöltés teszt sorba"
         Height          =   495
         Left            =   10200
         TabIndex        =   71
         Top             =   240
         Width           =   4215
      End
      Begin VB.CommandButton Command29 
         Caption         =   "Paraméterlista frissítés"
         Height          =   495
         Left            =   10200
         TabIndex        =   69
         Top             =   1440
         Visible         =   0   'False
         Width           =   4215
      End
      Begin VB.ListBox List1 
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   238
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3900
         Left            =   240
         TabIndex        =   70
         Top             =   240
         Width           =   9735
      End
      Begin VB.CommandButton Command30 
         Caption         =   "Kiválasztott paramétersor törlés"
         Height          =   495
         Left            =   10200
         TabIndex        =   75
         Top             =   840
         Width           =   4215
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub AutoTuning_Click()
MsgBox "Automata motor paraméter beállításra lesz itt lehetőség . De nem ebben a verzióban ! Idővel ..."
End Sub

Private Sub AutoTuning_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Automata motor paraméter beállítás ."
End Sub


Private Sub Check1_Click()
If Check1.Value = 0 Then
Check1.ForeColor = &H0&
Else
Check1.ForeColor = &HFF&

End If

End Sub

Private Sub Check1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Kiválasztás esetén a scroll bar értéket azonnal mentés nélkül(teszt módban) elküldi a microcontrollerbe."
End Sub


Private Sub Check4_Click()
Check2.Value = 0
Check3.Value = 0
Check4.Value = 1

End Sub


Private Sub Check2_Click()

If Check2.Value = 1 Then
Rem Check2.Caption = "Servo hiba mérés kikapcsol:"
Timer1.Enabled = True
Timer1.Interval = HScrollsebesseg.Value
Text19.Text = "0"
Rem Hibajel.Visible = True

Else
Timer1.Enabled = False
Rem Check2.Caption = "Servo hiba mérés bekapcsol:"
Text18.Text = ""
Text19.Text = "0"
Text20.Text = "0"
Rem Hibajel.Visible = False
End If
End Sub

Private Sub Check2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Pozíció hiba mérés be-kikapcsolható . Nem minden SMC mikrokontroller programban elérhető funkció !"

End Sub


Private Sub Check3_Click()



Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
MSComm1.Output = "m3" + Chr(13)

Timer2.Interval = HScroll11.Value
Command28_Click
Timer1.Enabled = True
Timer2.Enabled = True
Rem MousePointer = vbNormal
End Sub

Private Sub Check3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Ismétlődve lépteti a motort a kiválasztott irányba a megadott (NEM encoder impulzus)lépésjel számmal P0 sebességen."

End Sub


Private Sub cmdIdotAd_Click()
Dim szamlalo As Long
Rem Check2.Value = 0
Timer1.Enabled = False
szamlalo = 1
1
If szamlalo / 2 = HScroll12.Value Then
Rem MsgBox "asd"

Exit Sub
Else
Label22.Caption = szamlalo
szamlalo = szamlalo + 1
GoTo 1
End If

End Sub

Private Sub Combo1_Change()
Command28_Click
Command39_Click

If IsNumeric(Combo1.Text) = True Then
Else
MsgBox "Csak numerikus egész értéket adj meg !"
Combo1.Text = "2000"
End If

Command28_Click
Command39_Click
End Sub

Private Sub Combo1_Click()
Command39_Click

If IsNumeric(Combo1.Text) = True Then
Else
MsgBox "Csak numerikus egész értéket adj meg !"
Combo1.Text = "2000"
End If
Text21.Text = 0
Text22.Text = "0"
Text23.Text = "0"
Picture1.Cls
Picture1.Cls
Timer1.Enabled = True

End Sub


Private Sub Combo2_Change()
Rem Combo2.Text = "100"
Command39_Click
Timer1.Enabled = False
If IsNumeric(Combo2.Text) = True Then
Else
MsgBox "Csak numerikus egész értéket adj meg !"
Combo2.Text = "1"
End If
Command39_Click
End Sub


Private Sub Combo2_Click()
Command39_Click
Text21.Text = 0
Text22.Text = "0"
Text23.Text = "0"
Picture1.Cls
Timer1.Enabled = True
End Sub


Private Sub Command1_Click()


Rem  Ellenorizd az adatokat
If Text10.Text = "0" Then
Text10.Text = ""
Else
End If

On Error Resume Next
Text10.Text = Int(Text10.Text)
Text10.Text = Abs(Text10.Text)
If Text10.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (10-1000 értékhatár között)", , "Hibás adatbevitel"
    Text10.Text = ""
    Text10.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text10.Text > 1000 Then
MsgBox "Csak pozitív egész érték a megengedett! (10-1000 értékhatár között)", , "Hibás adatbevitel"
    Text10.Text = ""
    Text10.SetFocus
    Exit Sub
Else
End If

If Text10.Text < 10 Then
MsgBox "Csak pozitív egész érték a megengedett! (10-1000 értékhatár között)", , "Hibás adatbevitel"
    Text10.Text = ""
    Text10.SetFocus
    Exit Sub
Else
End If

110
Rem  Ellenorizd az adatokat




cmdIdotAd_Click

Command4_Click
MSComm1.Output = Chr(13)
Command4_Click
If Text10.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text10.Text = Int(Text10.Text)
MousePointer = vbHourglass
MSComm1.Output = Text10.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command4_Click
 Command4_Click
 Command4_Click
 Command4_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)
Check2.Value = 1

Command34_Click
End Sub

Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új velocity limit értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub

Private Sub Command10_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text7.Text = ""
10
MSComm1.Output = "P6" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click
adatin = MSComm1.Input
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1
GoTo 10
Else
 End If
On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If
Text7.Text = Mid(adatin, KEZDET, eredmeny)
Text7.Text = Int(adatin)
2
End Sub

Private Sub Command10_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális gear ratio érték kiolvasása"
End Sub

Private Sub Command11_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text8.Text = ""
10
MSComm1.Output = "P7" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click
adatin = MSComm1.Input
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1
GoTo 10
Else
 End If
On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If
Text8.Text = Mid(adatin, KEZDET, eredmeny)
Text8.Text = Int(adatin)
2
End Sub

Private Sub Command11_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális D gain érték kiolvasása"
End Sub

Private Sub Command12_Click()
Rem  Ellenorizd az adatokat
If Text10.Text = "0" Then
Text10.Text = ""
Else
End If

On Error Resume Next
Text10.Text = Int(Text10.Text)
Text10.Text = Abs(Text10.Text)
If Text10.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (10-1000 értékhatár között)", , "Hibás adatbevitel"
    Text10.Text = ""
    Text10.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text10.Text > 1000 Then
MsgBox "Csak pozitív egész érték a megengedett! (10-1000 értékhatár között)", , "Hibás adatbevitel"
    Text10.Text = ""
    Text10.SetFocus
    Exit Sub
Else
End If
If Text10.Text < 10 Then
MsgBox "Csak pozitív egész érték a megengedett! (10-10000 értékhatár között)", , "Hibás adatbevitel"
    Text10.Text = ""
    Text10.SetFocus
    Exit Sub
Else
End If





110
Rem  Ellenorizd az adatokat



Command4_Click
MSComm1.Output = Chr(13)
Command4_Click
If Text10.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text10.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command4_Click
Command4_Click
Command4_Click
Command4_Click
Command4_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click
End Sub

Private Sub Command12_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új velocity limit értéket elküldöd a microconrollerbe , új érték mentéssel."

End Sub


Private Sub Command13_Click()
Rem  Ellenorizd az adatokat
If Text11.Text = "0" Then
Text11.Text = ""
Else
End If

On Error Resume Next
Text11.Text = Int(Text11.Text)
Text11.Text = Abs(Text11.Text)
If Text11.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text11.Text = ""
    Text11.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text11.Text > 5000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text11.Text = ""
    Text11.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat



Command5_Click
cmdIdotAd_Click
MSComm1.Output = Chr(13)
Command5_Click
If Text11.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text11.Text = Int(Text11.Text)
MousePointer = vbHourglass
MSComm1.Output = Text11.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command5_Click
 Command5_Click
 Command5_Click
 Command5_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)

Check2.Value = 1
Command34_Click
End Sub

Private Sub Command13_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új velocity feedback értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub


Private Sub Command14_Click()
Rem  Ellenorizd az adatokat
If Text12.Text = "0" Then
Text12.Text = ""
Else
End If

On Error Resume Next
Text12.Text = Int(Text12.Text)
Text12.Text = Abs(Text12.Text)
If Text12.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text12.Text = ""
    Text12.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text12.Text > 5000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text12.Text = ""
    Text12.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat


Command6_Click
cmdIdotAd_Click
MSComm1.Output = Chr(13)
Command6_Click
If Text12.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text12.Text = Int(Text12.Text)
MousePointer = vbHourglass
MSComm1.Output = Text12.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command6_Click
 Command6_Click
 Command6_Click
 Command6_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)
Check2.Value = 1
Command34_Click
End Sub


Private Sub Command14_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új P gain értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub


Private Sub Command15_Click()
Rem  Ellenorizd az adatokat
If Text13.Text = "0" Then
Text13.Text = ""
Else
End If

On Error Resume Next
Text13.Text = Int(Text13.Text)
Text13.Text = Abs(Text13.Text)
If Text13.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text13.Text = ""
    Text13.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text13.Text > 1000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text13.Text = ""
    Text13.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat



Command7_Click
cmdIdotAd_Click
MSComm1.Output = Chr(13)
Command7_Click
If Text13.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text13.Text = Int(Text13.Text)
MousePointer = vbHourglass
MSComm1.Output = Text13.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command7_Click
 Command7_Click
 Command7_Click
 Command7_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)
Check2.Value = 1
Command34_Click
End Sub


Private Sub Command15_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új I gain értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub


Private Sub Command16_Click()
Rem  Ellenorizd az adatokat
If Text14.Text = "0" Then
Text14.Text = ""
Else
End If

On Error Resume Next
Text14.Text = Int(Text14.Text)
Text14.Text = Abs(Text14.Text)
If Text14.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-250 értékhatár között)", , "Hibás adatbevitel"
    Text14.Text = ""
    Text14.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text14.Text > 250 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-250 értékhatár között)", , "Hibás adatbevitel"
    Text14.Text = ""
    Text14.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat




Command8_Click
cmdIdotAd_Click
MSComm1.Output = Chr(13)
Command8_Click
If Text14.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text14.Text = Int(Text14.Text)
MousePointer = vbHourglass
MSComm1.Output = Text14.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command8_Click
 Command8_Click
 Command8_Click
 Command8_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)
Check2.Value = 1
Command34_Click
End Sub



Private Sub Command16_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új torque limit értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub


Private Sub Command17_Click()
Rem  Ellenorizd az adatokat
If Text15.Text = "0" Then
Text15.Text = ""
Else
End If

On Error Resume Next
Text15.Text = Int(Text15.Text)
Text15.Text = Abs(Text15.Text)
If Text15.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-9999 értékhatár között)", , "Hibás adatbevitel"
    Text15.Text = ""
    Text15.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text15.Text > 9999 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-9999 értékhatár között)", , "Hibás adatbevitel"
    Text15.Text = ""
    Text15.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat




Command9_Click
cmdIdotAd_Click
MSComm1.Output = Chr(13)
Command9_Click
If Text15.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text15.Text = Int(Text15.Text)
MousePointer = vbHourglass
MSComm1.Output = Text15.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command9_Click
 Command9_Click
 Command9_Click
 Command9_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)
Check2.Value = 1
Command34_Click
End Sub


Private Sub Command17_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új EMF feedback értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub


Private Sub Command18_Click()
Rem  Ellenorizd az adatokat
If Text16.Text = "0" Then
Text16.Text = ""
Else
End If

On Error Resume Next
Text16.Text = Int(Text16.Text)
Text16.Text = Abs(Text16.Text)
If Text16.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-4096 értékhatár között)", , "Hibás adatbevitel"
    Text16.Text = ""
    Text16.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text16.Text > 4096 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-4096 értékhatár között)", , "Hibás adatbevitel"
    Text16.Text = ""
    Text16.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat




Command10_Click
cmdIdotAd_Click
MSComm1.Output = Chr(13)
Command10_Click
If Text16.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text16.Text = Int(Text16.Text)
MousePointer = vbHourglass
MSComm1.Output = Text16.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command10_Click
 Command10_Click
 Command10_Click
 Command10_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)
Check2.Value = 1
Command34_Click
End Sub


Private Sub Command18_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új gear ratio értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub


Private Sub Command19_Click()
Rem  Ellenorizd az adatokat
If Text17.Text = "0" Then
Text17.Text = ""
Else
End If

On Error Resume Next
Text17.Text = Int(Text17.Text)
Text17.Text = Abs(Text17.Text)
If Text17.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text17.Text = ""
    Text17.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text17.Text > 1000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text17.Text = ""
    Text17.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat




Command11_Click
cmdIdotAd_Click
MSComm1.Output = Chr(13)
Command11_Click
If Text17.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
Text17.Text = Int(Text17.Text)
MousePointer = vbHourglass
MSComm1.Output = Text17.Text + Chr(13)
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Command11_Click
 Command11_Click
 Command11_Click
 Command11_Click
 
1
MousePointer = vbNormal
MSComm1.Output = Chr(13)
Check2.Value = 1
Command34_Click
End Sub


Private Sub Command19_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új D gain értéket elküldöd a microconrollerbe mentés nélkül (teszt érték)."

End Sub


Private Sub Command2_Click()
Rem  Ellenorizd az adatokat
If Text11.Text = "0" Then
Text11.Text = ""
Else
End If

On Error Resume Next
Text11.Text = Int(Text11.Text)
Text11.Text = Abs(Text11.Text)
If Text11.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text11.Text = ""
    Text11.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text11.Text > 5000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text11.Text = ""
    Text11.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat




Command5_Click
MSComm1.Output = Chr(13)
Command5_Click
If Text11.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text11.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command5_Click
Command5_Click
Command5_Click
Command5_Click
Command5_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click

End Sub

Private Sub Command2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új velocity feedback értéket elküldöd a microconrollerbe , új érték mentéssel."
End Sub


Private Sub Command20_Click()
Dim szamol As Integer
MousePointer = vbHourglass
szamol = 0
Timer1.Enabled = False
If Text10.Text = "" Then
szamol = szamol + 1
        Else
        Command12_Click
End If
If Text11.Text = "" Then
szamol = szamol + 1
        Else
        Command2_Click
End If
If Text12.Text = "" Then
szamol = szamol + 1
        Else
        Command21_Click
End If
If Text13.Text = "" Then
szamol = szamol + 1
        Else
        Command22_Click
End If
If Text14.Text = "" Then
szamol = szamol + 1
        Else
        Command23_Click
End If
If Text15.Text = "" Then
szamol = szamol + 1
        Else
        Command24_Click
End If
If Text16.Text = "" Then
szamol = szamol + 1
        Else
        Command25_Click
End If
If Text17.Text = "" Then
szamol = szamol + 1
        Else
        Command26_Click
End If
MousePointer = vbNormal
'MsgBox "ures adatsor" & szamol
If szamol = 8 Then
MsgBox "Nincs legalább egy új paraméter. Nincs mentés."
GoTo 20
Else
 End If
 If Check2.Value = 1 Then
 Timer1.Enabled = True
 Else
 End If
Msg = "Microcontrollerbe az új paraméterek mentése megtörtént , szeretnéd SMCparam.txt filébe is menteni a beállításokat ?"
Style = vbYesNo + vbQuestion + vbDefaultButton2
Title = "Paraméterek mentése"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
    MyString = "Igen"
    MousePointer = vbHourglass

Command37_Click

MousePointer = vbNormal
Else
    MyString = "Nem"
    Cancel = True
    MousePointer = vbNormal
End If


20
MousePointer = vbNormal
Command34_Click
End Sub

Private Sub Command20_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Minden új értéket elküldöd a microconrollerbe , új értékek mentéssel."
End Sub


Private Sub Command21_Click()
Rem  Ellenorizd az adatokat
If Text12.Text = "0" Then
Text12.Text = ""
Else
End If

On Error Resume Next
Text12.Text = Int(Text12.Text)
Text12.Text = Abs(Text12.Text)
If Text12.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text12.Text = ""
    Text12.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text12.Text > 5000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text12.Text = ""
    Text12.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat



Command6_Click
MSComm1.Output = Chr(13)
Command6_Click
If Text12.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text12.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command6_Click
Command6_Click
Command6_Click
Command6_Click
Command6_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click
End Sub

Private Sub Command21_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új P gain értéket elküldöd a microconrollerbe , új érték mentéssel."
End Sub


Private Sub Command22_Click()
Rem  Ellenorizd az adatokat
If Text13.Text = "0" Then
Text13.Text = ""
Else
End If

On Error Resume Next
Text13.Text = Int(Text13.Text)
Text13.Text = Abs(Text13.Text)
If Text13.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text13.Text = ""
    Text13.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text13.Text > 1000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text13.Text = ""
    Text13.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat



Command7_Click
MSComm1.Output = Chr(13)
Command7_Click
If Text13.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text13.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command7_Click
Command7_Click
Command7_Click
Command7_Click
Command7_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click
End Sub


Private Sub Command22_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új I gain értéket elküldöd a microconrollerbe , új érték mentéssel."
End Sub


Private Sub Command23_Click()
Rem  Ellenorizd az adatokat
If Text14.Text = "0" Then
Text14.Text = ""
Else
End If

On Error Resume Next
Text14.Text = Int(Text14.Text)
Text14.Text = Abs(Text14.Text)
If Text14.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-250 értékhatár között)", , "Hibás adatbevitel"
    Text14.Text = ""
    Text14.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text14.Text > 250 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-250 értékhatár között)", , "Hibás adatbevitel"
    Text14.Text = ""
    Text14.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat



Command8_Click
MSComm1.Output = Chr(13)
Command8_Click
If Text14.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text14.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command8_Click
Command8_Click
Command8_Click
Command8_Click
Command8_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click
End Sub


Private Sub Command23_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új torque limit értéket elküldöd a microconrollerbe , új érték mentéssel."
End Sub


Private Sub Command24_Click()
Rem  Ellenorizd az adatokat
If Text15.Text = "0" Then
Text15.Text = ""
Else
End If

On Error Resume Next
Text15.Text = Int(Text15.Text)
Text15.Text = Abs(Text15.Text)
If Text15.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text15.Text = ""
    Text15.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text15.Text > 5000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-5000 értékhatár között)", , "Hibás adatbevitel"
    Text15.Text = ""
    Text15.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat




Command9_Click
MSComm1.Output = Chr(13)
Command9_Click
If Text15.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text15.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command9_Click
Command9_Click
Command9_Click
Command9_Click
Command9_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click
End Sub


Private Sub Command24_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új EMF feedback értéket elküldöd a microconrollerbe , új érték mentéssel."
End Sub


Private Sub Command25_Click()
Rem  Ellenorizd az adatokat
If Text16.Text = "0" Then
Text16.Text = ""
Else
End If

On Error Resume Next
Text16.Text = Int(Text16.Text)
Text16.Text = Abs(Text16.Text)
If Text16.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-4096 értékhatár között)", , "Hibás adatbevitel"
    Text16.Text = ""
    Text16.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text16.Text > 4096 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-4096 értékhatár között)", , "Hibás adatbevitel"
    Text16.Text = ""
    Text16.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat




Command10_Click
MSComm1.Output = Chr(13)
Command10_Click
If Text16.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text16.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command10_Click
Command10_Click
Command10_Click
Command10_Click
Command10_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click
End Sub


Private Sub Command25_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új gear ratio értéket elküldöd a microconrollerbe , új érték mentéssel."
End Sub


Private Sub Command26_Click()
Rem  Ellenorizd az adatokat
If Text17.Text = "0" Then
Text17.Text = ""
Else
End If

On Error Resume Next
Text17.Text = Int(Text17.Text)
Text17.Text = Abs(Text17.Text)
If Text17.Text <= 0 Then
    If Err.Number = 13 Then
   MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text17.Text = ""
    Text17.SetFocus
    Exit Sub
    Else
End If

Else
End If
If Text17.Text > 1000 Then
MsgBox "Csak pozitív egész érték a megengedett! (1-1000 értékhatár között)", , "Hibás adatbevitel"
    Text17.Text = ""
    Text17.SetFocus
    Exit Sub
Else
End If
110
Rem  Ellenorizd az adatokat


Command11_Click
MSComm1.Output = Chr(13)
Command11_Click
If Text17.Text = "" Then
MsgBox "Nincs érték megadva.", , "Hiba"
GoTo 1
Else
End If
MSComm1.Output = Text17.Text + Chr(13) + "W 0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
Command11_Click
Command11_Click
Command11_Click
Command11_Click
Command11_Click
MSComm1.Output = Chr(13)
Check2.Value = 1
1
Command34_Click
End Sub


Private Sub Command26_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új D gain értéket elküldöd a microconrollerbe , új érték mentéssel."
End Sub


Private Sub Command27_Click()
Dim szamol As Integer
MousePointer = vbHourglass
szamol = 0
Timer1.Enabled = False

If Text10.Text = "" Then
szamol = szamol + 1
        Else
        Command1_Click
End If
If Text11.Text = "" Then
szamol = szamol + 1
        Else
        Command13_Click
End If
If Text12.Text = "" Then
szamol = szamol + 1
        Else
        Command14_Click
End If
If Text13.Text = "" Then
szamol = szamol + 1
        Else
        Command15_Click
End If
If Text14.Text = "" Then
szamol = szamol + 1
        Else
        Command16_Click
End If
If Text15.Text = "" Then
szamol = szamol + 1
        Else
        Command17_Click
End If
If Text16.Text = "" Then
szamol = szamol + 1
        Else
        Command18_Click
End If
If Text17.Text = "" Then
szamol = szamol + 1
        Else
        Command19_Click
End If
If szamol = 8 Then
MsgBox "Nincs megadva új letölthető paraméter."

Else
 End If
 If Check2.Value = 1 Then
 Timer1.Enabled = True
 Else
 End If
 MousePointer = vbNormal
 Command34_Click
End Sub

Private Sub Command27_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Minden új értéket elküldöd a microconrollerbe , új érték mentés nélkül."
End Sub


Private Sub Command28_Click()
MousePointer = vbHourglass

Timer1.Enabled = False
Text19.Text = Text18.Text

Text18.Text = "0"
Text20.Text = "0"
Text24.Text = "0"
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
Timer1.Enabled = True
MousePointer = vbNormal


End Sub

Private Sub Command28_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Legnagyobb és pillanatnyi pozíció hiba érték nullázása ."
End Sub


Private Sub Command29_Click()
Dim be_text As String
List1.Clear

On Error Resume Next
Open App.Path & "\" & "SMCparam.txt" For Input As #1
If Err.Number = 55 Then
MsgBox "SMCparam.txt file már meg van nyitva"
GoTo 1
Else
If Err.Number = 53 Then
MsgBox App.Path & "\" & "SMCparam.txt file nem elérhető . Létrehozom ."
Open App.Path & "\" & "SMCparam.txt" For Output As #1


GoTo 1

Else
End If

End If




Line Input #1, be_text
Do While Not EOF(1)
List1.AddItem (be_text)
Line Input #1, be_text
Loop
List1.AddItem (be_text)
Line Input #1, be_text
1 Close #1
List1.Refresh

End Sub

Private Sub Command29_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Filében tárolt paraméterlista frissítése."

End Sub


Private Sub Command3_Click()
MousePointer = vbHourglass


Check2.Value = 0
Check3.Value = 0
Timer1.Enabled = False
Command35_Click


Command4_Click
Text1.Text = "Kiolvas"
Command5_Click
Text2.Text = "Kiolvas"
Command6_Click
Text3.Text = "Kiolvas"
Command7_Click
Text4.Text = "Kiolvas"
Command8_Click
Text5.Text = "Kiolvas"
Command9_Click
Text6.Text = "Kiolvas"
Command10_Click
Text7.Text = "Kiolvas"
Command11_Click
Text8.Text = "Kiolvas"

Command4_Click
Command5_Click
Command6_Click
Command7_Click
Command8_Click
Command9_Click
Command10_Click
Command11_Click

MousePointer = vbNormal

Rem Check2.Value = 1
Rem Timer1.Enabled = True


On Error Resume Next
HScroll3.Value = Text1.Text
If Err.Number = 380 Then
MsgBox "Hibás P0 - (velocity limit) érték."
GoTo 10
Else
End If
On Error Resume Next
HScroll4.Value = Text2.Text
If Err.Number = 380 Then
MsgBox "Hibás P1 - (velocity feedback) érték."
GoTo 10
Else
End If
On Error Resume Next
HScroll5.Value = Text3.Text
If Err.Number = 380 Then
MsgBox "Hibás P2 - (P gain) érték."
GoTo 10
Else
End If
On Error Resume Next
HScroll6.Value = Text4.Text
If Err.Number = 380 Then
MsgBox "Hibás P3 - (I gain) érték."
GoTo 10
Else
End If
On Error Resume Next
HScroll7.Value = Text5.Text
If Err.Number = 380 Then
MsgBox "Hibás P4 - (torque limit) érték."
GoTo 10
Else
End If
On Error Resume Next
HScroll8.Value = Text6.Text
If Err.Number = 380 Then
MsgBox "Hibás P5 - (EMF) érték."
GoTo 10
Else
End If
On Error Resume Next
HScroll9.Value = Text7.Text
If Err.Number = 380 Then
MsgBox "Hibás P6 - (gear ratio) érték."
GoTo 10
Else
End If
On Error Resume Next
HScroll10.Value = Text8.Text
If Err.Number = 380 Then
MsgBox "Hibás P7 - (D gain) érték."
GoTo 10
Else
End If
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
10 MousePointer = vbNormal
Check2.Value = 1


Command34_Click


End Sub

Private Sub Command3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt összes érték kiolvasása"
End Sub

Private Sub Command30_Click()
Dim del As Integer
Dim frissit As Integer




Msg = "Biztos, hogy töröljem a paramétersort ?"
Style = vbYesNo + vbQuestion + vbDefaultButton2
Title = "Törlés"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
    MyString = "Igen"
    MousePointer = vbHourglass
del = List1.ListIndex
On Error Resume Next
List1.RemoveItem (del)
If Err.Number = 5 Then
MsgBox "Válassz törlendő paramétersort."
GoTo 10
Else
End If
If List1.ListCount = 0 Then
MsgBox "Nincs törölhető paraméterlista."
GoTo 10
Else
End If
Command38_Click

10

MousePointer = vbNormal
Else
    MyString = "Nem"
    Cancel = True
    MousePointer = vbNormal
End If






End Sub

Private Sub Command30_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "SMCparam.txt filéből kiválasztott paramétersor törlése."
End Sub

Private Sub Command31_Click()



Command34_Click

Option3.Value = True

MSComm1.Output = "m1" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1

MSComm1.Output = "S" + Label13.Caption + Chr(13)

Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
MSComm1.Output = "S" + Label13.Caption + Chr(13)
Check2.Enabled = False
End Sub

Private Sub Command31_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Motor futás feszültségvezérelt módban ."
End Sub


Private Sub Command32_Click()
Rem Command34_Click
MSComm1.Output = "m2" + Chr(13)
Check2.Enabled = True
Command34_Click
Option3.Value = False

MSComm1.Output = "m2" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1

MSComm1.Output = "S" + Label13.Caption + Chr(13)

Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1

Command28_Click

End Sub


Private Sub Command32_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Motor futás PID szabályozott módban a fordulatszám scroll baron beállított sebességen."
End Sub


Private Sub Command33_Click()
MSComm1.Output = "m3" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1

End Sub


Private Sub Command33_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Léptető mód kiválasztása."

End Sub


Private Sub Command34_Click()
Rem Label14.Caption = "?"
Rem Timer2.Enabled = False
MousePointer = vbHourglass

Check2.Enabled = True
Check3.Value = False

Option3.Value = True
MSComm1.Output = "S0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
MSComm1.Output = "m3" + Chr(13)

Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
MSComm1.Output = "m3" + Chr(13)
cmdIdotAd_Click
Command39_Click
Check2.Value = 1
MousePointer = vbNormal
End Sub


Private Sub Command35_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""

Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""


End Sub

Private Sub Command34_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Motor futás leállítása + RESET ."
End Sub

Private Sub Command38_Click()
Dim ment As Integer

ment = 0
mousepoiter = vbHourglass
Rem list1.text = kiválasztott sor szovege
Open App.Path & "\" & "SMCparam.txt" For Output As #1
Close #1

 Open App.Path & "\" & "SMCparam.txt" For Append As #1
10 List1.ListIndex = ment 'hanyadik a list1ben a kiválasztott sor
List1.Selected(ment) = True
Print #1, List1.Text
If List1.ListIndex + 1 = List1.ListCount Then
Rem MsgBox "kész"
MousePointer = vbNormal

GoTo 20
Else
ment = ment + 1
GoTo 10
End If


20 Close #1

End Sub

Private Sub Command36_Click()
Dim cim As String
Dim hely As Integer
Dim hely2 As Integer
Dim poz As Integer

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P0:")
hely2 = InStr(cim, "P1:")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text10.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P1:")
hely2 = InStr(cim, "P2:")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text11.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P2:")
hely2 = InStr(cim, "P3:")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text12.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P3:")
hely2 = InStr(cim, "P4:")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text13.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P4:")
hely2 = InStr(cim, "P5:")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text14.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P5:")
hely2 = InStr(cim, "P6:")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text15.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P6:")
hely2 = InStr(cim, "P7:")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text16.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

UCase (List1.Text)
cim = List1.Text
hely = InStr(cim, "P7:")
hely2 = InStr(cim, "<end>")
If hely > 0 Then
poz = hely2 - (hely + 3)
On Error Resume Next
Text17.Text = Mid(cim, hely + 3, poz)
If Err.Number = 5 Then
GoTo 10
Else
End If

Else
GoTo 10
End If

Text10.BackColor = &H80000005 'feher
Text11.BackColor = &H80000005 'feher
Text12.BackColor = &H80000005 'feher
Text13.BackColor = &H80000005 'feher
Text14.BackColor = &H80000005 'feher
Text15.BackColor = &H80000005 'feher
Text16.BackColor = &H80000005 'feher
Text17.BackColor = &H80000005 'feher






Exit Sub

10
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
MsgBox "Hibás vagy nem teljes motor paraméter sor ." & Chr(10) & Chr(13) & Chr(10) & Chr(13) & "Válassz a listából! ( Klikkelj a listából egy sorra , majd betöltés gomb . )", , "Hibás paramétersor betöltés"

End Sub

Private Sub Command36_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "A filében tárolt paraméterlista betöltése , megnyitása."

End Sub


Private Sub Command37_Click()
Dim intMsg As String
Dim StudentName As String
txtelkuld.Text = ""

StudentName = InputBox("Adj kommentet a paraméterlista azonosításához.")
If StudentName = "" Then
MsgBox "Nincs komment vagy paramétersor mentés elvetés."
GoTo 20
Else
End If

txtelkuld.Text = "< " & StudentName & " > "
If Text10.Text = "" Then
If Text1.Text = "" Then
MsgBox "Nincs se új se kiolvasott velocity limit paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P0:" & Text1.Text & ","
End If
Else
txtelkuld.Text = txtelkuld.Text & "P0:" & Text10.Text & ","
End If

'txtelkuld.Text = "< " & StudentName & " > "
If Text11.Text = "" Then
If Text2.Text = "" Then
MsgBox "Nincs se új se kiolvasott velocity feedback paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P1:" & Text2.Text & ","
End If
Else
txtelkuld.Text = txtelkuld.Text & "P1:" & Text11.Text & ","
End If

'txtelkuld.Text = "< " & StudentName & " > "
If Text12.Text = "" Then
If Text3.Text = "" Then
MsgBox "Nincs se új se kiolvasott P gain paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P2:" & Text3.Text & ","
End If
Else
txtelkuld.Text = txtelkuld.Text & "P2:" & Text12.Text & ","
End If

'txtelkuld.Text = "< " & StudentName & " > "
If Text13.Text = "" Then
If Text4.Text = "" Then
MsgBox "Nincs se új se kiolvasott I gain paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P3:" & Text4.Text & ","
End If
Else
txtelkuld.Text = txtelkuld.Text & "P3:" & Text13.Text & ","
End If

'txtelkuld.Text = "< " & StudentName & " > "
If Text14.Text = "" Then
If Text5.Text = "" Then
MsgBox "Nincs se új se kiolvasott torque limit paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P4:" & Text5.Text & ","
End If
Else
txtelkuld.Text = txtelkuld.Text & "P4:" & Text14.Text & ","
End If

'txtelkuld.Text = "< " & StudentName & " > "
If Text15.Text = "" Then
If Text6.Text = "" Then
MsgBox "Nincs se új se kiolvasott EMF paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P5:" & Text6.Text & ","
End If
Else
txtelkuld.Text = txtelkuld.Text & "P5:" & Text15.Text & ","
End If

'txtelkuld.Text = "< " & StudentName & " > "
If Text16.Text = "" Then
If Text7.Text = "" Then
MsgBox "Nincs se új se kiolvasott gear ratio paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P6:" & Text7.Text & ","
End If
Else
txtelkuld.Text = txtelkuld.Text & "P6:" & Text16.Text & ","
End If

'txtelkuld.Text = "< " & StudentName & " > "
If Text17.Text = "" Then
If Text8.Text = "" Then
MsgBox "Nincs se új se kiolvasott gear ratio paraméter , mentés így nem lehetséges. Adj meg értéket."
GoTo 20
Else
txtelkuld.Text = txtelkuld.Text & "P7:" & Text8.Text & "<end>"
End If
Else
txtelkuld.Text = txtelkuld.Text & "P7:" & Text17.Text & "<end>"
End If


Open App.Path & "\" & "SMCparam.txt" For Append As #1
'StudentName = InputBox("Adj kommentet a paraméterlista azonosítása miatt.")
Print #1, txtelkuld.Text
Close #1
Command29_Click
20
End Sub

Private Sub Command39_Click()



Timer1.Enabled = False
Text19.Text = Text18.Text

Text18.Text = "0"
Text20.Text = "0"

Text20.Text = "0"
Text24.Text = "0"
Timer1.Enabled = True

End Sub

Private Sub Command39_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Pozíció hiba érték nullázása . Csak a programban ! Microcontroller-ben nem. "
End Sub

Private Sub Command4_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text1.Text = ""
10

MSComm1.Output = "P0" + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click
adatin = MSComm1.Input

Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1



GoTo 10
Else
End If


On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else

End If
Text1.Text = Mid(adatin, KEZDET, eredmeny)
Text1.Text = Int(adatin)

2
End Sub

Private Sub Command4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális velocity limit érték kiolvasása"
End Sub

Private Sub Command40_Click()
Frame3.Visible = False
Frame4.Visible = True
End Sub

Private Sub Command40_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "SMCparam.txt file bezárás , monitorozás megnyitása ."
End Sub

Private Sub Command41_Click()
Frame4.Visible = False
Frame3.Visible = True
End Sub


Private Sub Command41_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Monitorozás bezárása . SMCparam.txt file-ben tárolt paraméter listák megjelenítése ."
End Sub

Private Sub Command42_Click()
Check2.Value = 1
 cmdIdotAd_Click


Option3.Value = False
Command33_Click
If Option1.Value = True Then
MSComm1.Output = Chr(13)
cmdIdotAd_Click
 Dim dummy
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 cmdIdotAd_Click
 Else
 MSComm1.Output = Chr(13)
cmdIdotAd_Click
 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)

 End If


End Sub

Private Sub Command43_Click()


End Sub

Private Sub Command5_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text2.Text = ""
10
MSComm1.Output = "P1" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click

adatin = MSComm1.Input
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1
GoTo 10
Else
 End If
On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If
Text2.Text = Mid(adatin, KEZDET, eredmeny)
Text2.Text = Int(adatin)
2
End Sub

Private Sub Command5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális velocity feedback érték kiolvasása"
End Sub

Private Sub Command6_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text3.Text = ""
10
MSComm1.Output = "P2" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click
adatin = MSComm1.Input
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1
GoTo 10
Else
 End If
On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If
Text3.Text = Mid(adatin, KEZDET, eredmeny)
Text3.Text = Int(adatin)
2
End Sub

Private Sub Command6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális P gain érték kiolvasása"
End Sub

Private Sub Command7_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text4.Text = ""
10
MSComm1.Output = "P3" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click
adatin = MSComm1.Input
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1
GoTo 10
Else
 End If
On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If
Text4.Text = Mid(adatin, KEZDET, eredmeny)
Text4.Text = Int(adatin)
2
End Sub

Private Sub Command7_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális I gain érték kiolvasása"
End Sub

Private Sub Command8_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text5.Text = ""
10
MSComm1.Output = "P4" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click
adatin = MSComm1.Input
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1
GoTo 10
Else
 End If
On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If
Text5.Text = Mid(adatin, KEZDET, eredmeny)
Text5.Text = Int(adatin)
2
End Sub

Private Sub Command8_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális torque limit érték kiolvasása"
End Sub

Private Sub Command9_Click()
Dim szamlalo As Integer
Dim adatin As String

szamlalo = 1
Text6.Text = ""
10
MSComm1.Output = "P5" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
cmdIdotAd_Click
adatin = MSComm1.Input
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
KEZDET = InStr(adatin, " ")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET
If eredmeny = 0 Then
szamlalo = szamlalo + 1
GoTo 10
Else
 End If
On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If
Text6.Text = Mid(adatin, KEZDET, eredmeny)
Text6.Text = Int(adatin)
2
End Sub

Private Sub Command9_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Aktuális EMS feedback érték kiolvasása"
End Sub

Private Sub Form_Activate()
Command3.SetFocus
Command3_Click
Command39_Click
Command34_Click
End Sub

Private Sub Form_Load()









MSComm1.CommPort = Val(1)
    MSComm1.Settings = "38400,N,8,1"
    MSComm1.InputLen = 0
    On Error Resume Next
    MSComm1.PortOpen = True
    If Err.Number = 8005 Then
     MsgBox "COM1 Port használatban van."
     End
     Else
     MSComm1.PortOpen = True
    End If
 
 
 
  Timer1.Interval = HScrollsebesseg.Value
Timer2.Interval = HScroll11.Value

 Command29_Click
    
 Rem Command3_Click
Rem MsgBox "13 van kapcsolat " & Err.Number

Combo1.AddItem (50)
Combo1.AddItem (100)
Combo1.AddItem (200)
Combo1.AddItem (500)
Combo1.AddItem (1000)
Combo1.AddItem (2000)



Combo2.AddItem (20)
Combo2.AddItem (30)
Combo2.AddItem (40)
Combo2.AddItem (50)
Combo2.AddItem (75)
Combo2.AddItem (100)
Combo2.AddItem (200)



End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Help : Mozgasd az egér kurzort a gombok vagy érték mező fölé."
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Rem Msg = "Kilép a programból?"
Rem Style = vbYesNo + vbQuestion + vbDefaultButton2
Rem Title = "Kilépés"
Rem Ctxt = 1000
Rem Response = MsgBox(Msg, Style, Title, Help, Ctxt)
Rem If Response = vbYes Then
  Rem MyString = "Igen"
   Rem Command34_Click

Rem MousePointer = vbNormal
Rem Command34_Click
End
 Rem Else
   Rem MyString = "Nem"
    Rem Cancel = True
    Rem MousePointer = vbNormal
 Rem End If



End Sub

Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False

End
End Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Help : Mozgasd az egér kurzort a gombok vagy érték mező fölé."
End Sub

Private Sub Frame2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Help : Mozgasd az egér kurzort a gombok vagy érték mező fölé."
End Sub

Private Sub Frame3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Segítség helye..."

End Sub


Private Sub hibajelnegativ_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

End Sub

Private Sub Frame4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Help : Mozgasd az egér kurzort a gombok vagy érték mező fölé."
End Sub

Private Sub HScroll10_Change()
Text17.Text = HScroll10.Value
If Check1.Value = 1 Then
Command19_Click
Else
End If
Form1.Refresh
End Sub

Private Sub HScroll11_Change()
Rem Check3.Value = 0
Rem Check3.Value = 1
End Sub

Private Sub HScroll12_Change()
Label23.Caption = "Olvasás idő : " & HScroll12.Value / 100
cmdIdotAd_Click
End Sub

Private Sub HScroll2_Change()

Label13.Caption = HScroll2.Value
cmdIdotAd_Click
Label13.Caption = HScroll2.Value

End Sub

Private Sub HScroll1_Change()

If Text10.BackColor = &HC0FFC0 Then
Text10.Text = HScroll1.Value
If Check1.Value = 1 Then
Command1_Click
Else
End If
Else
End If

If Text11.BackColor = &HC0FFC0 Then
Text11.Text = HScroll1.Value
If Check1.Value = 1 Then
Command13_Click
Else
End If
Else
End If

If Text12.BackColor = &HC0FFC0 Then
Text12.Text = HScroll1.Value
If Check1.Value = 1 Then
Command14_Click
Else
End If
Else
End If

If Text13.BackColor = &HC0FFC0 Then
Text13.Text = HScroll1.Value
If Check1.Value = 1 Then
Command15_Click
Else
End If
Else
End If

If Text14.BackColor = &HC0FFC0 Then
Text14.Text = HScroll1.Value
If Check1.Value = 1 Then
Command16_Click
Else
End If
Else
End If

If Text15.BackColor = &HC0FFC0 Then
Text15.Text = HScroll1.Value
If Check1.Value = 1 Then
Command17_Click
Else
End If
Else
End If

If Text16.BackColor = &HC0FFC0 Then
Text16.Text = HScroll1.Value
If Check1.Value = 1 Then
Command18_Click
Else
End If
Else
End If

If Text17.BackColor = &HC0FFC0 Then
Text17.Text = HScroll1.Value
If Check1.Value = 1 Then
Command19_Click
Else
End If
Else
End If

End Sub

Private Sub HScroll3_Change()
Text10.Text = HScroll3.Value
If Check1.Value = 1 Then
Command1_Click
Form1.Refresh
Else
End If
Form1.Refresh
End Sub

Private Sub HScroll4_Change()
Text11.Text = HScroll4.Value
If Check1.Value = 1 Then
Command13_Click
Form1.Refresh
Else
End If
Form1.Refresh
End Sub

Private Sub HScroll5_Change()
Text12.Text = HScroll5.Value
If Check1.Value = 1 Then
Command14_Click
Form1.Refresh
Else

End If
Form1.Refresh
End Sub


Private Sub HScroll6_Change()
Text13.Text = HScroll6.Value
If Check1.Value = 1 Then
Command15_Click
Form1.Refresh
Else
End If
Form1.Refresh
End Sub

Private Sub HScroll7_Change()
Text14.Text = HScroll7.Value
If Check1.Value = 1 Then
Command16_Click
Form1.Refresh
Else
End If
Form1.Refresh
End Sub

Private Sub HScroll8_Change()
Text15.Text = HScroll8.Value
If Check1.Value = 1 Then
Command17_Click
Form1.Refresh
Else
End If
Form1.Refresh
End Sub


Private Sub HScroll9_Change()
Text16.Text = HScroll9.Value
If Check1.Value = 1 Then
Command18_Click
Form1.Refresh
Else
End If
Form1.Refresh
End Sub

Private Sub HScrollsebesseg_Change()
Timer1.Interval = HScrollsebesseg.Value
StatusBar1.Panels(2).Text = "Mintavételi sebesség (ms) : " & HScrollsebesseg.Value
End Sub

Private Sub HScrollSkala_Change()


If HScrollSkala.Value = 9 Then
Text22.Text = "5"
Else
End If
If HScrollSkala.Value = 8 Then
Text22.Text = "4"
Else
End If
If HScrollSkala.Value = 7 Then
Text22.Text = "3"
Else
End If
If HScrollSkala.Value = 6 Then
Text22.Text = "2"
Else
End If
If HScrollSkala.Value = 5 Then
Text22.Text = "1"
Else
End If
If HScrollSkala.Value = 4 Then
Text22.Text = "0.1"
Else
End If
If HScrollSkala.Value = 3 Then
Text22.Text = "0.2"
Else
End If
If HScrollSkala.Value = 2 Then
Text22.Text = "0.3"
Else
End If
If HScrollSkala.Value = 1 Then
Text22.Text = "0.4"
Else
End If
If HScrollSkala.Value = 0 Then
Text22.Text = "0.5"
Else
End If
End Sub

Private Sub Label10_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Scroll bar értéke ebbe az érték boxba kerül (aktivált zöld box)."
End Sub


Private Sub Label13_Change()

If Option3.Value = False Then
Label14.Caption = Label13 * 50
Else
Label14.Caption = "?"
End If
MSComm1.Output = "S" + Label13.Caption + Chr(13)
Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1

End Sub

Private Sub Label23_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Paraméter kiolvasás időzítő ."
End Sub


Private Sub List1_Click()

If List1.Text = "" Then
MsgBox "Üres paramétersor nem betölthető."
GoTo 2
Else

End If


2
End Sub

Private Sub List1_DblClick()
Command36_Click
End Sub


Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Filében tárolt paraméterlista. "

End Sub

Private Sub Option1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Motor forgásirány léptető módban (+)."
End Sub


Private Sub Option2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Motor forgásirány léptető módban (-)."
End Sub


Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Pillanatnyi pozíció hiba grafikus megjelenítése."
End Sub


Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt velocity limit (sebesség határ) érték. "
End Sub

Private Sub Text10_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új velocity limit értéket itt adhatsz meg .  Scroll bar értéke ide kerül."
End Sub

Private Sub Text11_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új velocity feedback értéket itt adhatsz meg .  Scroll bar értéke ide kerül."
End Sub

Private Sub Text12_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új P gain értéket itt adhatsz meg . Scroll bar értéke ide kerül."
End Sub

Private Sub Text13_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új I gain értéket itt adhatsz meg .  Scroll bar értéke ide kerül."
End Sub

Private Sub Text14_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
StatusBar1.Panels(2).Text = "Új torque limit érték. " & "(PWM : " & Text14 / 2.56 & " %)"

If Err.Number = 13 Then
StatusBar1.Panels(2).Text = "Új torque limit érték."

Else
End If
End Sub

Private Sub Text15_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új EMS feedback értéket itt adhatsz meg . Scroll bar értéke ide kerül."
End Sub

Private Sub Text16_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
StatusBar1.Panels(2).Text = "Új beállított gear ratio érték (áttétel : 256=1:4 , 1024=1:1). Áttétel : 1:" & 1024 / Text16
If Err.Number = 13 Then
StatusBar1.Panels(2).Text = "Új beállított gear ratio érték (áttétel : 256=1:4 , 1024=1:1)."
Else
End If
End Sub

Private Sub Text17_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Új D gain értéket itt adhatsz meg .  Scroll bar értéke ide kerül."
End Sub

Private Sub Text2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt velocity feedback (sebesség visszajelzés) érték"
End Sub

Private Sub Text20_Change()

Dim minus As Integer

minus = 0
On Error Resume Next
If Err.Number = 380 Then
MsgBox "Hiba van : " & Err.Number
Else

Rem Hibajel.Value = Abs(Text20.Text)
End If
If Abs(Text20.Text) > Abs(Text24.Text) Then
Text24.Text = Text20.Text
Else
Text24.Text = Text24
End If




End Sub

Private Sub Text20_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Text18.Text = "N/A" Then
StatusBar1.Panels(2).Text = "Pozíció hiba érték NEM mérhető ."
Else
StatusBar1.Panels(2).Text = "Pillanatnyi pozíció hiba . "
End If

End Sub


Private Sub Text21_Change()
If Text21 >= 9000 / Combo2.Text Then
Text21.Text = 0
Text22.Text = "0"
Text23.Text = "0"
Picture1.Cls
Else
End If

End Sub

Private Sub Text26_Change()
If IsNumeric(Text26.Text) = True Then
Else
MsgBox "Csak numerikus egész értéket adj meg !"
Text26.Text = "1000"
End If
Check3.Value = 0


End Sub

Private Sub Text23_Change()
If IsNumeric(Text23.Text) = True Then
Else
MsgBox "Csak numerikus egész értéket adj meg !"
Text23.Text = "5"
End If
End Sub

Private Sub Text24_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Text18.Text = "N/A" Then
StatusBar1.Panels(2).Text = "Pozíció hiba NEM mérhető ."
Else
StatusBar1.Panels(2).Text = "Legnagyobb pozíció hiba . "
End If



End Sub

Private Sub Text3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt P gain (P tag) érték"
End Sub

Private Sub Text4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt I gain (I tag) érték"
End Sub

Private Sub Text5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt torque limit érték. " & "(PWM : " & Text5 / 2.56 & " %)"

If Err.Number = 13 Then
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt torque limit érték. "
Else
End If
End Sub

Private Sub Text6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt EMF érték"
End Sub

Private Sub Text7_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt gear ratio érték (áttétel : 256=1:4 , 1024=1:1). Áttétel : 1:" & 1024 / Text7

If Err.Number = 13 Then
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt gear ratio érték (áttétel : 256=1:4 , 1024=1:1)."
Else
End If

End Sub

Private Sub Text8_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Microcontrollerben jelenleg használt D gain (D tag) érték"
End Sub

Private Sub Text9_Change()
If IsNumeric(Text9.Text) = True Then
Else
MsgBox "Csak numerikus egész értéket adj meg !"
Text9.Text = "2000"
End If

If Text9.Text = "0" Then
Text9.Text = ""
MsgBox "Csak egész számérték a megengedett! 1-9999 között.", , "Hibás adatbevitel"
Else


End If


On Error Resume Next
Text9.Text = Int(Text9.Text)

    If Err.Number = 13 Then
    MsgBox "Csak egész számérték a megengedett! 1-9999 között.", , "Hibás adatbevitel"
    Text9.Text = ""
    GoTo 1
    Else
End If

1
End Sub


Private Sub Text9_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
StatusBar1.Panels(2).Text = "Léptetés P0 sebességen . 1 motor fordulat = encoder felbontása × 4"
If Err.Number = 13 Then
StatusBar1.Panels(2).Text = "Léptetés P0 sebességen . 1 motor fordulat = encoder felbontása × 4"

Else
End If
End Sub


Private Sub Timer1_Timer()
Dim szamlalo As Integer
Dim adatin As String
Dim KEZDET As Integer
Dim VEGE As Integer
Dim eredmeny As Integer
Dim servohiba As Integer
Dim szorzo As Integer
Dim vonalhoz As Integer
Dim elozo As Integer



If Combo1.Text = "2000" Then
Label18.Caption = "+2000"
Label19.Caption = "-2000"
Else
End If
If Combo1.Text = "1000" Then
Label18.Caption = "+1000"
Label19.Caption = "-1000"
Else
End If
If Combo1.SelText = "500" Then
Label18.Caption = "+500"
Label19.Caption = "-500"
Else
End If
If Combo1.SelText = "200" Then
Label18.Caption = "+200"
Label19.Caption = "-200"
Else
End If
If Combo1.SelText = "100" Then
Label18.Caption = "+100"
Label19.Caption = "-100"
Else
End If
If Combo1.SelText = "50" Then
Label18.Caption = "+50"
Label19.Caption = "-50"
Else
End If


szamlalo = 1
10
MSComm1.Output = "P9" + Chr(13)

Dim dummy
Do
dummy = DoEvents
Loop Until MSComm1.InBufferCount >= 1
adatin = MSComm1.Input

KEZDET = InStr(adatin, "")
VEGE = InStr(adatin, ":")
eredmeny = VEGE - KEZDET

On Error Resume Next
If Err.Number = 5 Then
MsgBox "Hiba : 5"
GoTo 2
Else
End If

1
servohiba = Mid(adatin, KEZDET + 2, VEGE - 3)
If servohiba = "0" Then
GoTo 2
Else
End If
elozo = servohiba - Text19.Text
Text18.Text = servohiba
Text20.Text = servohiba - Text19.Text
Text21.Text = Timer1.Interval + Text21

If Combo1.Text = "50" Then szorzo = 40
If Combo1.Text = "100" Then szorzo = 20
If Combo1.Text = "200" Then szorzo = 10
If Combo1.Text = "500" Then szorzo = 4
If Combo1.Text = "1000" Then szorzo = 2
If Combo1.Text = "2000" Then szorzo = 1



If Text20 >= 0 Then
Rem Picture1.PSet (Text21 * Combo2.Text, 2000 - (Text20 * szorzo))

Picture1.Line (Text22, Text23)-(Text21 * Combo2.Text, 2000 - (Text20 * szorzo))
Text22.Text = Text21 * Combo2.Text
Text23.Text = 2000 - (Text20 * szorzo)

Else
End If

If Text20 < 0 Then
minus = Abs(Text20.Text)
Rem Picture1.PSet (Text21 * Combo2.Text, 2000 + (minus * szorzo))
Picture1.Line (Text22, Text23)-(Text21 * Combo2.Text, 2000 + (minus * szorzo))
Text22.Text = Text21 * Combo2.Text
Text23.Text = 2000 + (minus * szorzo)
Rem Text24.Text = Text21 * Combo2.Text
Rem Text25.Text = 2000 + (minus * szorzo)
Else
End If

If Text18.Text = "" Then
Rem MsgBox "Skop leállt"
Command3_Click

Else
End If

2

MousePointer = vbNormal


End Sub

Private Sub Timer2_Timer()
 Dim dummy
If Check3.Value = 1 Then

Timer2.Interval = HScroll11.Value
Timer2.Enabled = True
Else
GoTo 10
End If

If Option1.Value = False Then
   MSComm1.Output = "+" & Text9 + Chr(13)

 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
 Option2.Value = False
Option1.Value = True
Else

MSComm1.Output = "-" & Text9 + Chr(13)

 Do
 dummy = DoEvents
 Loop Until MSComm1.InBufferCount >= 1
 MSComm1.Output = Chr(13)
Option1.Value = False
Option2.Value = True

End If

10
MousePointer = vbNormal
End Sub


Private Sub txtEncoder_Change()
If IsNumeric(txtEncoder.Text) = True Then
Else
MsgBox "Csak egész számérték a megengedett! 1-9999 között.", , "Hibás adatbevitel"
txtEncoder.Text = "500"
End If

If txtEncoder.Text = "0" Then
txtEncoder.Text = ""
MsgBox "Csak egész számérték a megengedett! 1-9999 között.", , "Hibás adatbevitel"
Else


End If


On Error Resume Next
txtEncoder.Text = Int(txtEncoder.Text)

    If Err.Number = 13 Then
    MsgBox "Csak egész számérték a megengedett! 1-9999 között.", , "Hibás adatbevitel"
    txtEncoder.Text = ""
    GoTo 1
    Else
End If

1
End Sub


Private Sub txtEncoder_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
StatusBar1.Panels(2).Text = "Encoder felbontása . "
End Sub


