Seite 1 von 1

GSV-2 --- GSVread --- VB6

Verfasst: Fr 10. Feb 2012, 09:26
von MichaelV
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

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

Re: GSV-2 --- GSVread --- VB6

Verfasst: So 12. Feb 2012, 20:08
von Kabelitz
Hello,
propably you must multiply the value "ad" with the scaling factor, which is stored in the eeprom of the gsv-2.
You get scaling factor with "getnormalization".
Best regards
Holger Kabelitz

Re: GSV-2 --- GSVread --- VB6

Verfasst: Fr 24. Feb 2012, 10:04
von MichaelV
Hallo Holger Kabelitz,

thanks for your answer.
I had searched inside the documentation (MEGSVPGM.PDF and ba-megsv.pdf), but i did not found a function
which is called getnormalization.
Is there a new function name for this ?

Regards
Michael Vogel

Re: GSV-2 --- GSVread --- VB6

Verfasst: Fr 9. Mär 2012, 17:02
von Sebastian Wetz
Hello Michael,

that function is called
double WINAPI GSVDispGetNorm(int no);

Regards,
Sebastian