Discussions au sujet des autres produits NI

annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

GPIB and K1944A

Hi,

 

I'm actually using a GPIB and a voltmeter ( KETHELEY). I generate a signal (sine for instance) thanks to a frequency generator and I want to acquire it with the voltmeter and send measures through the GPIB to plot them on a graph.

I want to give you an extract of the code where I have troubles to understand :

short k1944a_device (void)  {   return bd;  }

short k1944a_ready (void)
{
    short i;
    do { ibwait (bd, 0x4800); ibrsp (bd, &sp); i++; }
    while ((!(sp & 16))&&(i<10));
    if (i==10)
        {
         MessagePopup ("", "Le volmËtre ne rÈpond plus");
         return 0;
        }
    return 1;
}
short k1944a_ecrire (char *texte)
{
    short ok;
    ibwrt (bd, texte,(long)strlen(texte));
    ok=k1944a_ready ();
    if (ok==0) return 0;
    return 1;
    }

 

 

 When I run the code and click and the button acquire the programm freezes and I can read in RUN TIME window the following error:

NON-FATAL RUN-TIME ERROR : "K1944lab.c",line38,col5,trhead id 0x0000234: Function ibwrt(iberr == 6(0x6)) 

 

Moreover, when I try to run the code I get this message : NON-FATAL RUN-TIME ERROR..... Local 'i' was referenced before being initialized. Should I absolutely initialize it? 

0 Compliments
Message 1 sur 3
5 579 Visites

somebody here?...

0 Compliments
Message 2 sur 3
5 568 Visites

Hi,

 

Thanks for posting on NI Forum.

 

You can find at this link a possible solution to your problem.

 

Best regards,

Nicolas M.
National Instruments France


Journées Techniques LabVIEW 2012 : du 27 septembre au 22 novembre
2 sessions en parallèle : Débuter avec LabVIEW - Développer avec LabVIEW

0 Compliments
Message 3 sur 3
5 564 Visites