Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NationalInstruments.UI.WindowsForms.DigitalWaveformGraph ends displaying large red X

I am evaluating MeasurementStudio 2015.  I have a program that reads CAN data and displays digital data in a DigitalWaveformGraph.  It works well for about 30 seconds, then ends display of data and rather displays a large red X.  A screen capture is attached.

 

After the screen is locked with a red X, the program continues to run.  There is no debug output or runtime errors posted in the output window (VS2013).

 

The DigitalWaveform that is being plotted is created as a global and has its data updated every second, then is replotted.  The DigitalWaveform update and DigitalWaveformGraph

PlotWaveform update are called from a thread.  The objects are created outside the thread as global objects.

 

 

Is this a known issue?

 

How should I go about finding out why DigitalWaveformGraph locked up?

0 Kudos
Message 1 of 7
(4,195 Views)

I have just found that if no values in the DigitalWaveform change, the update of the graphic seems to update without error for many minutes going on an hour.  These obviously is a most unuseful configuration.

0 Kudos
Message 2 of 7
(4,187 Views)

Did you create this Measurement Studio application from scratch or did you start with one of the examples provided?

 

Additionally, you could create another indicator that will show you what data the graph is trying to write, and see what data is being written when the  graph is erroring out.  

 

Lastly, from what I can tell this is not known issue leading me to believe that this issue is isolated to your senario.

 

 

Ryan,

Applications Engineer

 

Ryan
Group Manager
FlexLogger
NI R&D
0 Kudos
Message 3 of 7
(4,156 Views)

I am no longer observing the behavior.  My project is from scratch; however, I had the CustomDigitalStates.2013 open for copy-paste.

 

I have a hypothesis for why the red X was occuring. CustomDigitalStates.2013 uses a Forms Timer to redraw the screen every 1000msec.  I was increasing the update rate to 1msec.  I am guessing that the redraw function is on a thread and takes more than 1msec to redraw.  So I think the function is thread unsafe.

 

CustomDigitalStates.2013 simulates incoming data.  So it can fill the wave structure in an instant and make the graph look like it has 1sec of new data.  As the graph becomes more complicated (due to signals changing or additional signals) it takes longer to redraw.  Hence, as the signal activity increases, the thread breaks.

 

I wandered through many timing methods.  Stopwatches and System timers were not accurate enough to provide a steady time axis.  I finally have multi-media timers working such that my tick occurs at 10+-3msec. 

 

I have questions.

  1. Does PlotWaveform need to be called only once?  CustomDigitalStates.2013 seems to call once a second.  I have called it once, then every 500msec there after.  But the plot is clearly updating as the DigitalWaveform is updated.
  2. When you have data coming in from multiple sources, how do you sync up the time axes?  What I am doing is using the multimedia timer to look at the multiple sources every 10msec and plot.  If the data is unstable within those 10msec, I take the state at the timer tick and that is that.  Noise is lost.  For my purposes, that is probably enough for now.
  3. What is the fastest update rate experienced users implement?  And how do they achieve it?  I know I cannot create a 100MHz oscilosope, especially considering my data is from the CAN bus and the fastest update achievable is just over 1kHz.
0 Kudos
Message 4 of 7
(4,145 Views)

 

1. Yes PlotWaveform only needs to be called once, your DigitalWaveformGraph will update whenever the DigitalWaveform changes.  

 

Explained here: http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/6af38a16/

 

2. I believe that our examples should show the ways we recommend synchronization.  These examples are DAQmx based.

 

Link: http://zone.ni.com/reference/en-XX/help/370473H-01/mstudiowebhelp/html/daqmxexamplesnet2008/  

 

This link shows allo fhte DAQmx emaples and gives an overview of each.  For your senario it sounds like MultiFunctionSyncAI_ReadDigChan may be a good place to start

 

3. What exactly do you mean by this?  Are you looking for frequency that the graph is redrawn? Please elaborate further on this point

 

Ryan

Applications Engineer

Ryan
Group Manager
FlexLogger
NI R&D
0 Kudos
Message 5 of 7
(4,116 Views)

I am asking for the maximum frequency you can expect to redraw a graph - order of magnitude only?  Can you expect to redraw a graph in 1msec, 10msec?

0 Kudos
Message 6 of 7
(4,112 Views)

Sadly, there's no direct way to answer this question.  The redraw rate for your program is going to be based on a wide array of factors including but not limited to PC performance and code optimization.

 

I can tell you in house with programs I have built the redraw rate is not noticable.

 

Ryan

Appliactions Engineer

Ryan
Group Manager
FlexLogger
NI R&D
0 Kudos
Message 7 of 7
(4,082 Views)