VERSION 5.00
Begin VB.Form frmVars 
   Caption         =   "Variables Read/Write by index"
   ClientHeight    =   3450
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   5625
   LinkTopic       =   "Form1"
   ScaleHeight     =   3450
   ScaleWidth      =   5625
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton btnClose 
      Caption         =   "Exit"
      Height          =   375
      Left            =   2040
      TabIndex        =   6
      Top             =   2880
      Width           =   1455
   End
   Begin VB.TextBox ValueText 
      Height          =   375
      Left            =   2160
      TabIndex        =   5
      Top             =   1320
      Width           =   975
   End
   Begin VB.CommandButton WriteCmd 
      Caption         =   "Write"
      Height          =   375
      Left            =   3600
      TabIndex        =   4
      Top             =   2040
      Width           =   1215
   End
   Begin VB.TextBox IndexText 
      Height          =   375
      Left            =   2160
      TabIndex        =   2
      Text            =   "30"
      Top             =   720
      Width           =   975
   End
   Begin VB.CommandButton ReadCmd 
      Caption         =   "Read"
      Height          =   375
      Left            =   720
      TabIndex        =   0
      Top             =   2040
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "Index"
      Height          =   255
      Left            =   840
      TabIndex        =   3
      Top             =   840
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "Value"
      Height          =   255
      Left            =   840
      TabIndex        =   1
      Top             =   1440
      Width           =   1215
   End
End
Attribute VB_Name = "frmVars"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit



Private Sub btnClose_Click()
Unload frmVars
End Sub



Private Sub LabelVal_Click()

End Sub

Private Sub IndexText_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then Call ReadCmd_Click
 
End Sub

Private Sub ReadCmd_Click()
Dim res As Long, VarValue As Double, Index As Long

Index = Val(IndexText.Text)
res = SS940_ReadParamAsDouble(SHANDLE, Index, VarValue)
If res <> EC_OK Then
    MsgBox SERROR(res), vbCritical + vbOKOnly, "Error"
    Exit Sub
End If
ValueText.Text = Str(VarValue)
End Sub

Private Sub WriteCmd_Click()
Dim res As Long, VarValue As Double, Index As Long
Index = Val(IndexText.Text)
VarValue = Val(ValueText.Text)
  res = SS940_WriteParamAsDouble(SHANDLE, Index, ByVal VarValue)
  If res <> EC_OK Then
        MsgBox SERROR(res), vbCritical + vbOKOnly, "Error"
        Exit Sub
  End If

End Sub
