Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Can build but cannot run a simple WPF Graph

Solved!
Go to solution

Hello,

I just received my NI Measurnments Studio package and I'm trying to add a graph to my WPF C# application but I'm having issues that I haven't seen in trial examples.  Prior to purchasing this package, I tweaked one of trial examples to plot my own data and it worked beautifuly.  Now I tried doing the same in my own project and it builds with no errors but I get exception at InitializeComponent() when I try to run it:

 

"The invocation of the constructor on type 'NationalInstruments.Controls.Graph' that matches the specified binding constraints threw an exception."

 

This is what I have:

  • Added these to my Project References (VS 2013)

C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.Common.dll

C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.Controls.dll

C:\Program Files (x86)\National Instruments\MeasurementStudioVS2012\DotNET\Assemblies\Current\NationalInstruments.Controls.Graphs.dll

 

  • Added this include to XAML

xmlns:ni="http://schemas.ni.com/controls/2009/xaml/presentation"

 

  • And added this chart control to XAML

<ni:Graph x:Name="graph" Grid.RowSpan="2" Interactions="Pan, Zoom, ZoomIn, ZoomVertical, ZoomHorizontal, ZoomOut, PanHorizontal, PanVertical">
<ni:Graph.Plots>
<ni:Plot Label="Channel 1" x:Name="Plot1" />
<ni:Plot Label="Channel 2" x:Name="Plot2" />
</ni:Graph.Plots>
</ni:Graph>
<ni:GraphInteractionPalette Graph="{Binding ElementName=graph}" />

 

Nothing else behind this so I should be able to at least run it and see an empty chart, right?

Please advice.

 

Thank you!

0 Kudos
Message 1 of 6
(5,325 Views)

 

I have the same problem in any WPF application.

XamlParseException occurred

 

Every MeasurementStudio 2013's UI element (LED, Graph, Gauge...) made XamlParseException error in WPF app of VS 2013.

Build is OK. Run-time error occurs with XamlParse Exception.

 

Does anybody successfully run WPF app of MeasurementStudio 2013 in VS 2013?

 

0 Kudos
Message 2 of 6
(5,286 Views)

Hi kirko7,

 

Can you post the exception details?


Thanks,

Daniel Dorroh
National Instruments
0 Kudos
Message 3 of 6
(5,273 Views)
Solution
Accepted by topic author kirko7

I got this to work.  Basically it was licening known issue in VS 2013.  I had to manually added .licx file to my project.  This is the email I got from NI which was very helpful:

 

"I notice that you are using Visual Studio 2013 with Measurement Studio 2013. Currently Measurement Studio 2013 is only officially supported by Visual Studio 2012, however several of our customer have been able to make Measurement Studio 2013 work with Visual Studio 2013. We have a KnowledgeBase article that walks through working with Measurement Studio 2013 in Visual Studio 2013. It might be good to go through this article to make sure you have followed each step: http://digital.ni.com/public.nsf/allkb/C51E3B38578FAD2786257C070069F386

It does look like you are using the correct assemblies, and we were able to test the XAML code on our side. This worked just fine, so it doesn't seem like there is anything going on with the code. Another thing we can try is to Clean Solution and Rebuild Solution in Measurement Studio. This will be a good step to make sure there are no old lingering files."

 

Thanks

0 Kudos
Message 4 of 6
(5,270 Views)

Check my reply above.  I'm sure you have the same issue.  NI is working on VS2013 integration but for now you gotta do it manually.

0 Kudos
Message 5 of 6
(5,266 Views)

Hi kirko7,

 

Thanks for posting the follow up. However, to be clear, I would not say this is a 'known issue.' Having to configure a licenses.licx file manually is expected when using Measurement Studio with versions of Visual Studio for which integration is not supported. Please refer to the following help documentation that explains this further: Creating a .licx File Without Visual Studio-Integrated Tools.

 

I'm glad to hear you were able to get things up and running.

 

Thanks,

Daniel Dorroh
National Instruments
0 Kudos
Message 6 of 6
(5,263 Views)