LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI aborts with no warning when compiling

When I compile a simple instrument driver with the CTRL-K shortcut in CVI 2009 (9.1) it aborts CVI without warning Smiley Surprised

 

No popup, no nothing.

 

All I had done was delete a typedef in the driver file for a structure containing GPIB configuration info.

 

After it did it about 5 times in a row it finally stopped when I included a header file that re-established the typedef for the GPIB struct.

 

So the problem was that this typdef appeared as a parameter type in a prototype in another header file, and when I eliminated the definition it caused the abort. The abort was immediate, I have to think it was something wrong in the preprocessor.  I do not have precompiled headers checked in the build options.  I am using the standard CVI compiler. 

 

Weird, huh.

 

Menchar

 

 

 

 

0 Kudos
Message 1 of 5
(3,182 Views)

Hi menchar,

 

Do you have a simple example project that exhibits this behavior. Based on your explanation, it looks like a bug we might have to report. If you can give me a simple example, I can reproduce the issue and subsequently submit a corrective action request to our R&D team. Is this possible?

Raj
National Instruments
Applications Engineer
0 Kudos
Message 2 of 5
(3,145 Views)

Some how I knew you'd ask for that Smiley Wink

 

I don't have a simple case. 

 

It was absolutley repeatable, I couldn't believe it when it first happened.

 

I had something like this in the driver file:

 

typedef struct _GPIBConfig {

  DWORDBus;

  ...

} GPIBCONFIG, * LPGPIBCONFIG;

 

and in a header file I had a prototype that used the typedef as a parameter type:

 

headerfile.h

 

INT myFunc (GPIBCONFIG config);

 

 

When I eliminated the typedef  from the driver file, I got the crash.

 

When I added another header that defined the GPIBCONFIG struct, the crashes stopped.

 

Restarting CVI did not cure the problem.  When I restarted, CVI did a popup saying the previous instance of CVI had been stopped abnormally.   I recovered the project per the popup.  Then when I restarted and recompiled, it crashed again, but when I restarted I didn't get the popup.

 

 Menchar

 

0 Kudos
Message 3 of 5
(3,143 Views)

Hi menchar,

 

I created a simple project on my end.

Added a function tree and a function panel window.

Created the .c and .h files for the function panel.

Added them to the project.

Added the following line in the instrument header file.

 

typedef struct _GPIBConfig {

  DWORD Bus;

} GPIBCONFIG, * LPGPIBCONFIG;

 

Compiled the code. It compiled successfully.

Added another header file to the project and inserted the following line under Global functions.

 

int myFunc (GPIBCONFIG config) 

 

Compiled the code. It compiled successfully.

 

I removed the typedef struct code from the instrument header file.

 

Compiled the code. It compiled successfully.

 

Is there something I am doing incorrectly here? Is there anything else that you would have me try to reproduce this issue?

Raj
National Instruments
Applications Engineer
0 Kudos
Message 4 of 5
(3,107 Views)

When I said "driver" I meant a C code module that I use as an instrument driver, without a function panel.    It's not a "driver" in any formal sense.

 

The crash occurred when the typedef was in the instrument module itself (not a header file) and I deleted it from the module.  

 

It may have been some perverse combination of editing and file manipulation that showed the problem ... if I see it again I will try to capture the sources so that you can try to diagnose it.

 

I had never seen this type of problem before despite using CVI 2009 for many hundreds of hours.  I wonder if it has something to do with the changes made to CVI to support precompiled headers, though I was not using precompiled headers at the time.

 

So I wouldn't do anything more with it for now if I were you, let's see if it happens again.

 

Thanks,

 

Menchar

0 Kudos
Message 5 of 5
(3,103 Views)