In my program, do I need to initialize the GPIB board itself, or is
this done for me when I call the OpenDev function to open a given
device? The reason I ask is that my errors happen approximately 2/3
of the time, and I can't seem to find any real rhyme or reason to
them.
thanks,
John
/****************************************************************************/
te_booleen MultiMetreInitialise (void)
/****************************************************************************/
{
int idMultiMetre;
DisableBreakOnLibraryErrors ();
idMultiMetre = ibdev (0, 22, NO_SAD, T3s, 1, 0);
return idMultiMetre;
EnableBreakOnLibraryErrors ();
}
Hope this helps,
Daniel
John Nordling <x...@no.email> wrote in message news:<506500000008000000F9...@exchange.ni.com>...
The GPIB board does not have to be initialized and Daniel is right,
ibdev is the recommended method to obtain an instrument handle.
You may also want to test communication with IBIC. <a
href="http://www.ni.com/support/gpib/max/ibic.htm/">This webpage</a>
explains how to use IBIC.
Launching IBIC: Measurement and Automation explorer >> Tools >>
NI-488.2 >> Interactive Control
Also, the errors themselves may indicate what you may be doing wrong.
What errors have you been getting?
We had probably the same GPIB problem as you have. The program worked
fine for a while, but then crashed at some point. It was on Windows 95
or 98. For versions above that, I didn't test them.
We finally found out this workaround:
You have to find the GPIB first, before opening the device. It has to
be the same GPIB device than the one that you will open afterwards.
Here is an example (almost the same I gave you before, but I just
found the workaround in my sources again. It was missing at first):
/****************************************************************************/
int MultiMetreInitialise (void)
/****************************************************************************/
{
int idMultiMetre;
DisableBreakOnLibraryErrors ();
idMultiMetre = ibfind ("GPIB0"); /* This line solves the GPIB bug */
if (idMultiMetre>=0)
MultiMetre = ibdev (0, 22, NO_SAD, T3s, 1, 0);
EnableBreakOnLibraryErrors ();
if (idMultiMetre < 0)
{
// error message here
}
return idMultiMetre;
}
Hope this will help you, and please tell it here if it does, for the
next ones having this problem.
Regards,
Daniel
void InitializeGPIB()
{
GPIBboard = ibfind ("gpib0");
ibpad (GPIBboard, 0);
ibrsc (GPIBboard, 1);
ibsic (GPIBboard);
ibsre (GPIBboard, 0);
}
Additionally, in the driver file, I replaced the call
to OpenDev with a call to ibpad, and that also seems
to help.
again, thanks for all the help.
-John