03-01-2016 08:37 AM
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?
03-01-2016 10:09 AM
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.
03-02-2016 01:26 PM
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
03-03-2016 07:54 AM
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.
03-04-2016 10:42 AM
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
03-04-2016 12:29 PM
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?
03-07-2016 04:48 PM
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