Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make calls to my NI GPIB-PCI board using VC++ 1.52?

Solved!
Go to solution

gpibtester,

 

Attached is the NI Spy file you requested.

 

Let me know what you would like me to do next.

 

Thanks,

Erich

 

 

0 Kudos
Message 11 of 21
(3,136 Views)

Erich,

 

Thank you for the Spy capture! I see that it is opening a handle to the Device:

ibdev(0, 1, 0, 13, 1, 0)

Then with the handle that was returned by the ibdev( ) call, it was able to do a write using ibwrt( ) with the "*IDN?" command to the Instrument. With the ibrd( ) it was able to get the identification information from the Instrument.

 

So, now I must ask you, how are you opening a handle to the Device in your code? It would be helpful if I could see a snippet of your code that showed the calls that you use when opening a handle.

 

Thanks again for the Spy capture! Now we need to look at your code.

 

gpibtester

0 Kudos
Message 12 of 21
(3,132 Views)

gpibtester,

 

Sorry, I forgot that you had asked to see the code snippet. I have attached all of the file in which calls to the GPIB board. The call where the failure happens is in the FindDevice function and the gpib call is ibfind. The device name is read from a .ini file and is curently set to "DEV1" but I have also tried "GPIB0" without success. Ihave tried using the ibfind("DEV1") call using the Ineractive Control app and it seems to work fine.

 

Thanks,

Erich

Download All
0 Kudos
Message 13 of 21
(3,127 Views)

Erich,

 

Thank you for sending the code! Taking a quick look at it, nothing obvious jumps out. I am not able to look at it until Monday when I might have some more questions for you.

 

Thanks again for the code!

 

Have a good weekend!

 

gpibtester 

0 Kudos
Message 14 of 21
(3,121 Views)

Thanks! I have Monday off (Presidents day) but I'll be back on Tuesday to address any questions or suggestions you might have. Hope you enjoy your weekend.

 

Erich

0 Kudos
Message 15 of 21
(3,118 Views)

Erich,

 

In looking at the code some more, I am wondering about the contents of the .INI file that TPOWER.CPP is using. From the settings in the GetProfileString( ), it looks like it is a customized .INI file. Could you please include the .INI file that you are using?

 

If you are not able to send the .INI file, can you tell what the string is that gets returned in ElgarName by the call to GetProfileString( )?

 

TIA,
gpibtester

0 Kudos
Message 16 of 21
(3,088 Views)

gpibtester,

 

Thanks for your patience. I'm finally back at work and ready to tackle this problem again. The value returned in ElgarName is "DEV1" but I have also changed the value in the .INI file to return "GPIB0" and this did not work either. I have attached the .INI file as requested in case you see something I did not. Just so you know I have also tried hard coding the values "DEV1" and "GPIB0" into ElgarName without success.

 

I look forward to what you find.

Erich

0 Kudos
Message 17 of 21
(3,079 Views)

Erich,

 

Thank you for the .INI file!

 

I have good news and bad news. The good news is I know what the problem is, but it is also bad news because support for GPIB Win16 apps in 98 was dropped starting with the 2.0 release. That means that with 2.2, you cannot do GPIB Win16 apps on Windows 98. I apologize that I did not find out about that limitation sooner!

 

There are 2 options.

1. Downgrade the GPIB Win98 driver to 1.7.
   A. Uninstall 2.2.
   B. Reboot.
   C. Install 1.7.

   D. Reboot.

2. Switch to either Windows 2000 or XP for the operating system and install the GPIB software. Win16 is still supported on those operating systems. I realize this is probably not an option.

 

Thank you again for your patience and for sending all the Spy capture and code files! I apologize again for not figuring out what the real problem was earlier! I hope that downgrading to 1.7 is a viable workaround that will work for you, if you continue to work on WIndows 98.

 

gpibtester

0 Kudos
Message 18 of 21
(3,073 Views)
Solution
Accepted by topic author Kuhlman

Erich,

 

Almost forgot, the 1.70 driver cannot be downloaded from the web site. You must request the driver using the Legacy NI-488.2 Driver Request form. While it is a bit of an inconvenience to get the 1.70 driver, it still might be worth it if you want to do GPIB Win16 applications on Windows 98.

 

gpibtester

Message 19 of 21
(3,070 Views)

gpibtest,

 

I finally got the  1.70 driver and it works perfectly. Thanks for all your help this is great!

 

Erich

0 Kudos
Message 20 of 21
(3,057 Views)