07-13-2012 10:16 AM - modifié 07-13-2012 10:20 AM
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?
le 07-18-2012 04:38 AM
somebody here?...
le 07-19-2012 02:52 AM
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