LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with a GPIB 488.2 Card

Hello, i'm using labwindows to communicate with a GPIB 488.2 Card, which is connected to an other card.

My problem is that i've made a basical programm with only a function "send". It works once and after it returns me this error when i click on "send":

thread id 0x00000528: Function Send: (iberr == 1 [0x1]).

The thing is that the GPIB Card works with a labview programm, so the card is ok.

Here is the source file i've used :

#include
#include
#include
#include "essai.h"

static int panelHandle;

int main (int argc, char *argv[])
{
int GPIBDev;
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "essai.uir", PANEL)) < 0)

return -1;
GPIBDev = ibfind ("gpib0");

DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}

int CVICALLBACK QuitCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}

int CVICALLBACK call (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
Send (0, 10, "a", 2, 1);
break;
}
return 0;
}

I hop you will be able to help me.
Thanks.
Download All
0 Kudos
Message 1 of 2
(2,979 Views)
I find the GPIB rioutines to be very finiky, so I would suggest using the GPIB diagnostics tools and breakout the GPIB commands. It is well documented and will almost always give you a status message or error message response.

My Guess is that on the second call of the devices is waiting for an acknowledgment from the other before it would respond again. Remember that GPIB is a multi device bus and you have to release the bus after tranmitting and receiving data.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 2
(2,979 Views)