[C] GSV-2AS VC++ issue

Antwort erstellen

Diese Frage dient dazu, das automatisierte Versenden von Formularen durch Spam-Bots zu verhindern.
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode ist eingeschaltet
[img] ist eingeschaltet
[flash] ist ausgeschaltet
[url] ist eingeschaltet
Smilies sind eingeschaltet

Die letzten Beiträge des Themas

Ansicht erweitern Die letzten Beiträge des Themas: [C] GSV-2AS VC++ issue

Re: [C] GSV-2AS VC++ issue

Beitrag von Kabelitz » Do 10. Mai 2018, 06:30

Hello Aclabo
to get only one value on demand, you must configure the device into "logger -Mode". Then you can produce one value with getvalue and read this value with getvalue
Best regards

Re: [C] GSV-2AS VC++ issue

Beitrag von Aclabo » Fr 4. Mai 2018, 09:24

Hello Kabelitz,

Thank you for your support !

So i tried differents things with your remarks.

I add the GSVgetvalue() before calling GSVread() but i had no more results.

So i put the GSVread() in a while loop, here, i have the first value == 0 and after that i get a value != 0 on the second call and more (an other strange thing is that the value (-0.000xx)is not in accordance with the value from the GSV control software(-0.xxx)).

Is it possible to get just one value? I just want to push with a jack and take the value just one time for verify it is arround 50N, so this is very simple and i don't need the permanently acquisition.

Many thx for your help!

Re: [C] GSV-2AS VC++ issue

Beitrag von Kabelitz » Sa 28. Apr 2018, 08:08

Hello Aclabo,
my first idea is, that there is no value ready to read, because GSV-2 device is configured in "logger" mode.
In this case you must use GSVgetvalue first, to create one value.

You can check, wheather GSV-2 is in logger mode with GSVmulti or GSVcontrol.

Or you load default settings. After that GSV-2 is sending pemanently values with 10 Samples per second.
But you should read them fast enough, e.g. with GSVreadmultiple. If not, you wil get values from the past (which are first in the output buffer)

Best regards

[C] GSV-2AS VC++ issue

Beitrag von Aclabo » Mi 25. Apr 2018, 16:25


i'm developping a system with straingauss and i'm currently having some issues with the software part.

I try to read the value from a GSV-2AS with Microsoft VisualStudio IDE.

GSVactivate works fine by after the GSVread() fonction is not working for me and return 0.

I'm using the snippets bellow:

#include <windows.h>
#include <stdlib.h>

#include "Megsv.h" // MeGSV header
#pragma comment (lib, "MEGSV.lib") // MeGSV libraries

#define ComNr 5
#define BuffSize 1000

double read(void)

 double ad = 0;

 if (GSVactivate(ComNr, BuffSize) != GSV_OK) // Works fine
  printf("\n[!] initialisation failed.\n");
  return 0;

 if (GSVread(ComNr, &ad) == GSV_TRUE) // GSVread() return 0 and ad is not updated
  //printf(" %1.3f\n", ad);
  printf("%lf\n", ad);

 return ad;

int main(void)
 double val = 0;
 val = read();
 return 0;

I've no linking or dependancies issues.
Am i missing something ?

Thank you very much for your help by advance !!!

Nach oben