Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Win98->Win2k

Hello Steve,
I am filling in for Geneva this week. Try calling ibfind, ibonl, and ibrsc at the very beginning of your code to explicitly initiate communication. I'd also try ibdev. If doing a scan for instruments is affecting whether your program runs or not, it is likely that either your instrument or computer is not in a state compatible with communicating. For example, scan for instruments asserts ibrsc, which makes the gpib card the system controller. (You may not have system controller checked in MAX)

Ray K
NI Applications Engineer
0 Kudos
Message 11 of 18
(1,649 Views)
I'll give this a try a bit later. Due to prior commitments for my lab,
it is going to be impossible for me to work on this for this week and
next week. I will give your suggestion a try the week of 30 Sept to 3
Oct. I will reply to this same thread if that's appropriate. Let me
know if I should start another thread because of this time gap.

thanks
steve

Ray K wrote:
>
> Hello Steve,
> I am filling in for Geneva this week. Try calling ibfind, ibonl,
> and ibrsc at the very beginning of your code to explicitly initiate
> communication. I'd also try ibdev. If doing a scan for instruments
> is affecting whether your program runs or not, it is likely that
> either your instrument or computer is not in a state compatible with
> communicating.
For example, scan for instruments asserts ibrsc, which
> makes the gpib card the system controller. (You may not have system
> controller checked in MAX)
>
> Ray K
> NI Applications Engineer
0 Kudos
Message 12 of 18
(1,649 Views)
Steve,

I am so sorry that no one answered your posting while
I was away. Thank you for posting the Spy capture
files. From the nature of the errors, it appears that
the gpib-32.dll is not being loaded successfully in
your application. When the Scan for Instruments in
MAX is run, the DLL is loaded into memory, so when
your application runs after that, it has no problems.

Does Quattro Pro have a different way of loading DLLs
in Windows 2000? Is it possible that a Quattro Pro
update or Windows 2000 service pack might eliminate
the issue?

Here's an idea. Did you package an older version of
the gpib-32.dll in your application? Is it possible
you have multiple versions of the DLL on the machine
in different locations? I believe Windows will search
for a DLL in the application directory before it goes
to the Windows system directories.

Alternatively, are you specifying a path to find the
DLL? If you were using the Windows directory for Win
98, it would be Windows >> System, but for Windows
2000, it is Winnt >> System32. I believe if the DLL
is not found in the path, loading it fails.

Another idea regards using private assemblies or
private DLLs. I read on another discussion forum that
this is a private copy of the DLL that your
application uses, while other applications use the
system DLL. I believe you have to register this DLL
yourself.

I found the discussion info about private assemblies
when searching Google for "view dll loaded in
memory". I found a utility that perhaps you can run
while running your application. Then, when you
compare that to running MAX, you may discover
something. Note that I have not tested these DLL
utilities myself, so I can't really tell you to use
them, but I thought I'd pass along the idea.

I hope these ideas help. Again, I am very sorry that
your question has been left hanging.

Regards,
Geneva L.
GPIB/Serial Product Support Engineer
National Instruments
http://www.ni.com/support
0 Kudos
Message 13 of 18
(1,649 Views)
OK, I am back now and have a few minutes here and there to check this
out. Attached is a zip file containing 3 GPIBspy files. One for before
MAX, the 2nd for MAX itself and the 3rd is for after MAX has scanned for
instruments. For the before/after MAX files, I created a simple
application (actually a DLL as discussed earlier) which uses only the
function calls you suggested, ibfind, ibonl and ibsrc. As you can see,
ibfind can not even find the GPIB card until after MAX has scanned for
instruments.

Since it has been so long let me know if I should start a new thread.

Thanks
Steve



IR Detector Lab wrote:
>
> I'll give this a try a bit later. Due to prior commitments for my lab,
> it is going to be impossible for me to work on t
his for this week and
> next week. I will give your suggestion a try the week of 30 Sept to 3
> Oct. I will reply to this same thread if that's appropriate. Let me
> know if I should start another thread because of this time gap.
>
> thanks
> steve
>
> Ray K wrote:
> >
> > Hello Steve,
> > I am filling in for Geneva this week. Try calling ibfind, ibonl,
> > and ibrsc at the very beginning of your code to explicitly initiate
> > communication. I'd also try ibdev. If doing a scan for instruments
> > is affecting whether your program runs or not, it is likely that
> > either your instrument or computer is not in a state compatible with
> > communicating. For example, scan for instruments asserts ibrsc, which
> > makes the gpib card the system controller. (You may not have system
> > controller checked in MAX)
> >
> > Ray K
> > NI Applications Engineer
0 Kudos
Message 14 of 18
(1,649 Views)
Ray K did respond but as I said i had previous commitments for the lab
for Sept so I am just now getting back to this issue.

>
> Does Quattro Pro have a different way of loading DLLs
> in Windows 2000? Is it possible that a Quattro Pro
> update or Windows 2000 service pack might eliminate
> the issue?
No, QP loads my add-inn DLLs using the macro command {DLL.Load
MyAddin.DLL}. What QP does after this macro command i have no way of
knowing. I have installed the latest service pack for QP. My version
of Win2K is SP3 and i have regularly done the Windows Update feature.

>
> Here's an idea. Did you package an older version of
> the gpib-32.dll in your application? Is it possible
> you have multiple versions of the DLL on the machine
> in different locations? I believe Windows will search
> for a DLL in the application directory before it goes
> to the Windows system directories.
Here is where my lack of programming knowledge shows. My C++ projects
are linked using the Borland language interface file that shipped with
the GPIB driver. It is something like borlandc_gpib-32.obj and the
appropriate .H file is used after an #include statement in each module
containing a GPIB function call. I did not specifically 'package' a
GPIB-32.DLL in the project. At least until now, if I put the #include
for the .h file in each module and also link in the right .OBJ file,
then my add-in DLLs have always worked fine, at least through previous
versions of Windows (98, 95 and 3.x) and previous versions of Quattro
Pro (5, 6, 7 & 8). I would appreciate your insight/experience here. It
could well be that I have gotten these things to work so far due to some
quirk rather than accepted programming methods.

>
> Alternatively, are you specifying a path to find the
> DLL? If you were using the Windows directory for Win
> 98, it would be Windows >> System, but for Windows
> 2000, it is Winnt >> System32. I believe if the DLL
> is not found in the path, loading it fails.
If i understand correctly, this applies to direct entry programming
methods which I do not use.

>
> Another idea regards using private assemblies or
> private DLLs. I read on another discussion forum that
> this is a private copy of the DLL that your
> application uses, while other applications use the
> system DLL. I believe you have to register this DLL
> yourself.
Please explain how? Is this a 1 time thing for the installation of the
GPIB driver or is it done each time the PC boots or is it each time the
DLL is loaded? I do not know what "register this DLL" means.

>
> I found the discussion info about private assemblies
> when searching Google for "view dll loaded in
> memory". I found a utility that perhaps you can run
> while running your application. Then, when you
> compare that to running MAX, you may discover
> something. Note that I have not tested these DLL
> utilities myself, so I can't really tell you to use
> them, but I thought I'd pass along the idea.
I used one of the utilities mentioned and made the following
observations. On the Win2k PC, after QP loads the DLL containing the
GPIB calls, then there are 2 DLLs in memory; GPIB-32.dll and
GPIB-VDD.dll. At this point, my GPIB function calls return errors.
When I load N.I. MAX and scan for instruments, then GPIBN32.dll is
loaded into memory. I can now run the functions in my QP add-in DLLs.
On a Win98 PC, the following GPIB DLLs are loaded when QP loads my
add-in DLL into memory, GPIBMNGR.dll, GPIB-32.dll and NISPYLOG.dll. As
mentioned earlier, when using Win98 these QP add-in DLL functions
perform as expected without using MAX and scanning for instruments.
0 Kudos
Message 15 of 18
(1,649 Views)
Hello Steve,
I discussed this behavior with Geneva and we think that this behavior is being caused by more than one gpib driver being installed in your system. MAX and your code might be referencing different drivers. MAX might be loading the driver assigned to your card and your program might be loading the other driver. Your program is running after a scan for instruments because the correct driver has already been loaded into memory.

Check add/remove programs to see if more than one 488.2 driver is listed, if so, delete both, shutdown, take out the card, install the driver again, and put the card back in.

If you see only one 488.2 driver, delete it and any other NI software. Shutdown, take out the card, and install 488.2 ver 2.0 (this version will cle
an up registry entries and any leftover files). If you want to use version 1.7 instead, uninstall 2.0, and install version 1.7.

Regards,
Ray K
NI Applications Engineer
0 Kudos
Message 16 of 18
(1,649 Views)
I had some time to experiment and try a few of your suggestions. First,
I tried removing the GPIB card AND the driver for the card, then
rebooting. I then went through the reinstallation of the driver and
card as directed again, still it did NOT work properly. Then, just out
for fun, uninstalled the version 1.7 driver, rebooted, then shut down,
rebooted and I installed the version 1.6 driver and then the card and
tried the same tests. The version 1.6 driver could not even get MAX to
find the instruments, much less my own in-house written applications. I
then uninstalled the 1.6 driver and card, rebooted, shut down rebooted
and installed the 1.7 driver and card again. Same results again. I then
went through the same uninstallation and removal procedures above but
now installed the version 2.0 driver. Everything seems to work
perfectly now.

The question I now have is, do I need to recompile all my applications
(remember, they are just spreadsheet add-in DLLs) with the new header
file or is that only required if I use some new functions or something
else declared in the new header?

Thanks
Steve



Ray K wrote:
>
> Hello Steve,
> I discussed this behavior with Geneva and we think that this behavior
> is being caused by more than one gpib driver being installed in your
> system. MAX and your code might be referencing different drivers.
> MAX might be loading the driver assigned to your card and your program
> might be loading the other driver. Your program is running after a
> scan for instruments because the correct driver has already been
> loaded into memory.
>
> Check add/remove programs to see if more than one 488.2 driver is
> listed, if so, delete both, shutdown, take out the card, install the
> driver again, and put the card back in.
>
> If you see only one 488.2 driver, delete it and any other NI software.
> Shutdown, take out the card, and install 488.2 ver 2.0 (this version
> will clean up registry entries and any leftover files). If you want
> to use version 1.7 instead, uninstall 2.0, and install version 1.7.
>
> Regards,
> Ray K
> NI Applications Engineer
0 Kudos
Message 17 of 18
(1,649 Views)
No, you shouldn't have to recompile your apps.

Ray K
NI applications Engineer
0 Kudos
Message 18 of 18
(1,649 Views)