Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Exception when plotting NaN values

Hello,
I have a real-time graph which should display gaps from time to time. I tried to use NaN values but I am getting System.OverflowException after application runs for some time. Attached the sample project that demonstrates the problem.
Thanks.
0 Kudos
Message 1 of 5
(3,919 Views)
I ran your project and noticed that the plot's ProcessSpecialValues property was set to false. Set the plot's ProcessSpecialValues property to true and your application will behave correctly.

ProcessSpecialValues means the plot will process NaN and Infinity values. GDI+ by itself cannot handle NaN and Infinity values.

Brock
0 Kudos
Message 2 of 5
(3,911 Views)
The problem is that you do not have the ProcessSpecialValues property on the plot set to true. The plot has to perform a lot of extra processing to handle NaN and +/-Infinity values, which can have a negative impact on performance. ProcessSpecialValues lets you choose if you want to take the performance hit. Most applications do not work with NaN and +/-Infinity values, so the default value is false in the interest of performance. For more information, see the Knowledge Base article "Why Does Plotting NaN or Infinity Values Generate an Exception Using .NET Graph Controls?".

- Elton
0 Kudos
Message 3 of 5
(3,909 Views)
Here is the external link for the knowledgebase that Elton mentioned.
Bilal Durrani
NI
0 Kudos
Message 4 of 5
(3,893 Views)
Oops ... sorry for posting an internal link. I thought it was an external link. Sorry for the confusion.

- Elton
0 Kudos
Message 5 of 5
(3,890 Views)