GSV-2 --- GSVread --- VB6
Verfasst: Fr 10. Feb 2012, 09:26
Hello,
I had written a smal programm, to read values from the GSV-2.
The programm itselve works fine, but the reveived data are unclear
for me.
The return value is around -0,04...., and the display of the GSV-2
shows -3,6... Nm.
What is the rule to translate the -0,04.. to -3,6..Nm ?
Can anybody help me ?
Regards
I had written a smal programm, to read values from the GSV-2.
The programm itselve works fine, but the reveived data are unclear
for me.
The return value is around -0,04...., and the display of the GSV-2
shows -3,6... Nm.
What is the rule to translate the -0,04.. to -3,6..Nm ?
Can anybody help me ?
Regards
Code: Alles auswählen
Option Explicit
'These parameters and functions are declared in the module
'Public Const ComNr As Long = 6 ' Nummer der seriellen Schnittstelle
'Public Const BuffSize As Long = 1000 ' Größe des Puffers, in dem die AD-Werte
' abgelegt werden, bis sie mit dem Befehl
' GSVread gelesen werden
'Public Declare Function GSVread Lib "MEGSV" Alias "#21" (ByVal no As Long, ByRef ad As Double) As Long
'Public Declare Function GSVmodel Lib "MEGSV" Alias "#2" (ByVal no As Long) As Long
'Public Declare Function GSVactivate Lib "MEGSV" Alias "#10" (ByVal no As Long, ByVal buffersize As Long) As Long
'Public Declare Sub GSVrelease Lib "MEGSV" Alias "#11" (ByVal no As Long)
Private Sub Command1_Click()
Dim tmp As String
If GSVactivate(ComNr, BuffSize) <> GSV_OK Then
Text1.Text = "Initialisierung des GSV fehlgeschlagen"
Else
tmp = GSVmodel(ComNr)
Text1.Text = "Baugruppen-Modell: " & tmp
Timer1.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
GSVrelease ComNr
End Sub
Private Sub Timer1_Timer()
Dim ad As Double
If GSVread(ComNr, ad) = GSV_TRUE Then
Text2.Text = CStr(ad)
End If
End Sub