LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

General Protection Fault during Initialization of an IVI driver

I'm trying to debug some IVI drivers that I've modified from existing IVI drivers. All three drivers that I've modified give me a "first chance General Protection fault" when I try the Initialization functions. All the other functions work, it's just on the Initialization functions. I'm testing the functions by pressing the "Run Function Panel" button on the panel. I also made a project with the source code(*.c, *.h, *.fp) from the Agilent ESG IVI driver that I downloaded from the NI site, and I also get the GPF. I hope I'm doing something fundamentally wrong and someone can point it out to me. Anyone have any ideas?

I'm using CVI 6.0 on a WindowsXP system.

Thanks for your help.
0 Kudos
Message 1 of 6
(2,997 Views)
Hi MarkNSN,]

Do you meet the minimum requirement for the ESG driver
eg IVI compliance 2.0 and VISA 2.60?

You can check the version by launching MAX and checking the Software components

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 6
(2,997 Views)
Hi Ray,

Thanks for your feedback. I have IVI 2.1 and VISA 3.0.1. The ESG driver Initialize functions work fine if I use them in a separate project, it's only when I create a stand-alone project with its source files(to try to duplicate making a instrument driver dll) that I have trouble with it.

Thanks for your help.
0 Kudos
Message 3 of 6
(2,997 Views)
Hi Mark,

Do you only get these errors when you are debugging? Do these errors disappear when you run it in release mode? If so, you can always turn of first chance exception breaks. To do this, go to Run >> Break On, and make sure First Chance Exceptions is unchecked.

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 4 of 6
(2,997 Views)
Sure enough, they went away. I checked on the run options and the First Chance Exceptions was unchecked. Do you have any ideas on what could cause this?

Thanks for all your help!
0 Kudos
Message 5 of 6
(2,997 Views)
Hi Mark,

From what you've given me so far, it's hard to tell what could cause this. I would try a variety of tests to see if we can narrow down the problem. Is it possible to step thru the Initialization code to see what command it breaks on? Also, you mentioned that it works fine when in its own project, but when you add them to another project, it fails. Have you checked to see if it's the extra code you're inserting that causes the problem? Lastly, these faults usually occur when you're trying to access or allocate memory that you're not supposed to touch. Is there anywhere in your code that you do something of the sort?

Jeremy L.
National Instruments
Jeremy L.
National Instruments
0 Kudos
Message 6 of 6
(2,997 Views)