Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with analysis histogram function

I'm trying to use the (NationalInstruments.Analysis.Math.Statistics.Histogram) function to create a histogram for an application developed in VB.Net 2005.  The application works fine on my development machine, but when I publish and run it on another machine I get the following error.

Please Help.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'AN.a' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at AN.a..cctor()
   --- End of inner exception stack trace ---
   at AN.a.a(Double[] , Int32 , Double , Double , Int32[] , Double[] , Int32 )
   at NationalInstruments.Analysis.Math.Statistics.Histogram(Double[] inputData, Double histogramBase, Double histogramTop, Int32 histogramIntervals, Double[]& centerValues)
   at Puck_Electrical_Test.modMain.Test_Part(Boolean ReTest, Boolean Standard)
   at Puck_Electrical_Test.modMain.ProcessToolBarClick(Object sender, ToolBarButtonClickEventArgs e)
   at System.Windows.Forms.ToolBar.OnButtonClick(ToolBarButtonClickEventArgs e)
   at System.Windows.Forms.ToolBar.WmReflectCommand(Message& m)
   at System.Windows.Forms.ToolBar.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 
0 Kudos
Message 1 of 14
(5,912 Views)
Also, I encounter the same type of error when calling

NationalInstruments.Analysis.Math.ArrayOperation.MaxMin1D

Any Ideas?
0 Kudos
Message 2 of 14
(5,890 Views)
I tried using a newer version of the analysis assembly and I still get an error on all systems I publish and deploy to except my Development machine.  Below is the error message.
 
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'NationalInstruments.Analysis.Internal.AnalysisDll' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at NationalInstruments.Analysis.Internal.AnalysisDll..cctor()
   --- End of inner exception stack trace ---
   at NationalInstruments.Analysis.Internal.AnalysisDll.MaxMin1D(Double[] x, Int32 n, Double& max, Int32& iMax, Double& min, Int32& iMin)
   at NationalInstruments.Analysis.Math.ArrayOperation.MaxMin1D(Double[] inputData, Double& maximum, Int32& indexOfMaximum, Double& minimum, Int32& indexOfMinimum)
   at Puck_Electrical_Test.modMain.Test_Part(Boolean ReTest, Boolean Standard)
   at Puck_Electrical_Test.modMain.ProcessToolBarClick(Object sender, ToolBarButtonClickEventArgs e)
   at System.Windows.Forms.ToolBar.OnButtonClick(ToolBarButtonClickEventArgs e)
   at System.Windows.Forms.ToolBar.WmReflectCommand(Message& m)
   at System.Windows.Forms.ToolBar.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 
0 Kudos
Message 3 of 14
(5,877 Views)
I tried publishing the Histogram Example from 'C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Examples\Analysis\Histogram\vb\Histogram.2005.sln' just to prove it wasn't anything in my code; and I got the same type of error message.
0 Kudos
Message 4 of 14
(5,875 Views)

Anyone have any ideas on this one?

0 Kudos
Message 5 of 14
(5,865 Views)
Hello hilks

Which version of Measurement Studio are you using? We released a patch for using Measurement Studio 8.0 with VS 2005.

http://digital.ni.com/softlib.nsf/websearch/58142402AAA023B4862570C7007AE4FB?opendocument&node=132070_US

Make sure you have this patch installed and have followed the patch instructions.

Let me know if you have any questions about this.

Bilal Durrani
NI
0 Kudos
Message 6 of 14
(5,856 Views)
The instructions for the patch mention nothing about the NationalInstruments.Analysis namespace?
0 Kudos
Message 7 of 14
(5,854 Views)
I wanted to make sure you have the patch downloaded  since it fixed some problems associated with mstudio and 2005. You are correct that it does not have any updates for analysis. But your problem sounds like a case of incorrect ilbraries being deployed. I tried this and it seems to have worked fine on my deployment machine.
When I deployed the histogram example, a couple of assemblies are installed in the same folder as the application. Can you tell me the names and version numbers of the assemblies present in the app folder on the deployed machine?

Im assuming the licx file was updated with the correct version of the analysis component. Otherwise it would not have worked on your development machine as well.

Thanks

Message Edited by bilalD on 01-03-2006 11:25 AM

Bilal Durrani
NI
0 Kudos
Message 8 of 14
(5,850 Views)
A few questions:
 
I'm deploying (Publishing) with ClickOnce, where should I look for the App folder with the assemblies you are refering to?
 
Also the Readme for MStudio800VS2005Patch instructs to use assemblies from C:\Program Files\National Instruments\MeasurementStudioVS2003...
Should this be 2005 ?
0 Kudos
Message 9 of 14
(5,847 Views)

The default installation folder is MeasurementStudioVS2003 because we don't still fully integrate with VS 2005. Measurement Studio 8.0 fully integrates with VS 2003 only. We are working on fully supporting VS 2005 in the next version of MStudio.

When I saw your problem, I initially thought you were using the setup projects in VS 2005 to create an msi installer. That is why I asked about your application folder. The process for ClickOnce will be a little different.

The problem here is that the ClickOnce publisher is not detecting the unmanaged dependencies for the analysis libraries. The analysis libraries uses the Intel Math Kernel libraries (MKL) in the lower layers and these libraries have to be present on the machine. You can use the msi that ships on the mstudio CD to make these available to the client. You can find it on the CD under .\Parts\MKL700

In addition to MKL, you will need nianlys.dll (found under Program Files\National Instruments\Shared\Analysis ) which you can add to to your project. In the publishing settings, set the publish status for that dll to Include.

This should give you everything you need.

Let me know if you have any questions.



Message Edited by bilalD on 01-04-2006 10:02 AM

Bilal Durrani
NI
0 Kudos
Message 10 of 14
(5,832 Views)