GSV-2 --- GSVread --- VB6

Software zur Datenerfassung: GSVcontrol, GSVmulti, GSVterm, ...;
Treiber: Labview, Windows-DLL, ...
Programmierung: Code-Snippets, ..
MichaelV
Beiträge: 2
Registriert: Do 9. Feb 2012, 07:59

GSV-2 --- GSVread --- VB6

Beitragvon MichaelV » Fr 10. Feb 2012, 08: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

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

Kabelitz
Beiträge: 409
Registriert: Fr 5. Aug 2011, 10:09

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

Beitragvon Kabelitz » So 12. Feb 2012, 19:08

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

MichaelV
Beiträge: 2
Registriert: Do 9. Feb 2012, 07:59

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

Beitragvon MichaelV » Fr 24. Feb 2012, 09:04

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

Sebastian Wetz
Beiträge: 16
Registriert: Fr 5. Aug 2011, 13:22

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

Beitragvon Sebastian Wetz » Fr 9. Mär 2012, 16:02

Hello Michael,

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

Regards,
Sebastian


Zurück zu „Software“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste