LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

ViOpen causes General Protection Fault

The following code causes a General protection Fault once viOpen is called:
 
error = viOpenDefaultRM (&defaultRM);
error = viOpen(defaultRM, "PXI6::9::INSTR",VI_NULL, VI_NULL, &vi);
 
I am trying to debug my application.  I do not have a PXI chassis connected to my system, however, I would think the function would return an error....not cause my application to have a GPF.  Help please!  Thanks,
 
Cathleen
St. Louis MO
0 Kudos
Message 1 of 3
(3,057 Views)

OK... perhaps a silly question but it does not hurt to ask...Your handle variables are defined as what type? They should be type ViSession.

And yes... it should return a "resource not found" error if it can't find the requested resource.

 

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 2 of 3
(3,054 Views)

GPF is a common result if you pass an uninitialised handle. You should check that the first call you made does not return an error code: if it does then it is likely that defaultRM is left at its original value (0?) - your second call will then most likely GPF with this 0 value. Just don't make that second call if you get an error from the first. Smiley Happy

JR

0 Kudos
Message 3 of 3
(3,047 Views)