Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Vision - Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Hi all!
 
I'm trying to develop an application in Visual Studio .NET 2005 with NI Vision but when I try to use the function LearnCalibrationGrid, I get a RunTime error as specified in the subject (Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))).
 
I've been reviewing all the parameters and everything seems to be ok, so I don't understand the origin of this error!
 
Can anyone help me out with this?

Txs.

Nuno

0 Kudos
Message 1 of 4
(7,373 Views)
Hi

Could you send me your code please?
I want to check if i can reproduce the problem in my machine.
Do you have this exception each time you launch your code?

Kamal
NI France
0 Kudos
Message 2 of 4
(7,354 Views)

Good morning!

 

The code I was implementing is something like this:

 

CalibrationGridOptions.GridDescriptor.Unit = CWIMAQCalibrationUnits.cwimaqCalUnitMillimeter;

CalibrationGridOptions.GridDescriptor.XStep = float.Parse(txtSpacing.Text);

CalibrationGridOptions.GridDescriptor.YStep = float.Parse(txtSpacing.Text);

CalibrationGridOptions.ThresholdRange.Initialize(0, float.Parse(txtThreshold.Text));

LearnCalibrationOptions.CalibrationMethod = CWIMAQCalibrationMethods.cwimaqNonlinearCalibration;

LearnCalibrationOptions.CorrectionRegionMode = CWIMAQCorrectionRegionModes.cwimaqFullImage;

LearnCalibrationOptions.CorrectionScalingMode = CWIMAQCorrectionScalingModes.cwimaqScaleToPreserveArea;

LearnCalibrationOptions.LearnCorrectionTable = true;

LearnCalibrationOptions.LearnErrorMap = false;

CWIMAQRegions regions = new CWIMAQRegions();

regions.AddRectangle(Vision.MakeRectangle(0, 0, CalibrationTemplate.Width, CalibrationTemplate.Height));

{

NationalInstruments.CWIMAQControls.

CWIMAQVision testtt = new CWIMAQVision();

NationalInstruments.CWIMAQControls.

CWIMAQImage testimage = new CWIMAQImage();

testimage.SetSize(640, 480);

testimage.ArrayToImage(byBuffer);

testtt.LearnCalibrationGrid(testimage, CalibrationGridOptions, LearnCalibrationOptions,

ref QualityScore, regions);

}

 

Where bybuffer is a byte[640,480] that holds the data of the image. I don't know if I'm missing any initialization that can be needed, but I've looked to the documentation and I can't find anything about it!

I'm using Visual Studio .NET 2005, Framework 2.0, Windows XP and the NI Vision 8.2.

Thanks for your support!

Nuno Mendonça

 

 

0 Kudos
Message 3 of 4
(7,333 Views)

Hi Nuno,

First of all keep in mind that you have to specify all the following attributes in a calibration:
* Specify grid calibration
* Specify dot image: It is the image acquired in your condition replaced  by the dot image
* Specify what kind of calibration it is (non linear distorsion in your case)
* Specify the treshold level to separate the dots of the grid from the background of the image
* Specify the space between the dots (dx and dy and yhe units)
* You also have to specify a coordinate system.

I am almost sure that you don't have use all this attributes. So send your project i will check!

Is the error appears during the compilation or when you are executing your code? Do you have tested a simple calibration instead?

Thanks
Kamal
NI France

 

 

 

Message 4 of 4
(7,306 Views)