From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-30-2018 07:00 AM
Hi all,
I have a Network Data Stream that is sending data to my UI from my RT target.
On the UI side, the data is being read in a while loop direct from a stream and is updating a waveform chart with a large chart history buffer.
Weirdly, when I send eg. 1000 data points the chart goes up to ~1100, approximately 10% more data than is being produced.
I have a counter on both the write and read loops and these say 1000 points each so the chart seems to be "creating" data out of nowhere.
The chart history is set to zero each time I press go so I'm not sure what's happening here!
Any suggestions?
Solved! Go to Solution.
11-30-2018 07:04 AM
11-30-2018 08:13 AM
Apologies, I am reluctant to attach the VI as the code is part of a large project and I hoped it could be resolved from text alone.
I've attached some screenshots of the relevant sections of code.
I have a "Record" button that when pushed, resets the chart history to empty (see Record_Event) and sends a signal to my FPGA to collect some data. I am also programatically setting the end point of the x-axis of the chart to be the maximum number of data points I should receive. This data is processed then transferred via a network stream (see Record_Writer and Writer2) to the reader on the UI side which adds each data point as they come onto the chart (see Record_Reader)
As it is, my chart updates with more data points than either;
a) the writer is sending
b) the reader is reading
Hope this makes it clearer.
If it really is necessary to see the actual VIs, I will attempt to partition this out from the rest of the code.
11-30-2018 09:15 AM
I suspect race conditions (unsyncronized chart clearing, index checking and data sending)
Am I right number of read points (loop index) is less than displayed on chart?
Make autoindex from loop, stop before chart overfills, read chart history, compare data. What are these extra data?
Separate commands "Clear chart" and "start sending data" - chart should be empty and nothing updating untill you "start sending data".
11-30-2018 09:22 AM
- That was my initial suspicion but its worth noting that in the screenshots I attached to the post above - the reader is set to timeout at -1 - ie it will only proceed when there is a data point for it to take.
- You are right that the number of read points from the loop index (which is the same as the number of points generated) is less than the data displayed on the graph.
- Im not sure what you want me to auto-index here, the data isn't being generated from an array. The extra data seem to be valid points which is the weird thing - if they were repetitions it would be obvious.
- The chart is cleared before the command to start collecting, processing and sending data is given already.
12-04-2018 02:59 AM
I actually found the solution for this by accident whilst reducing my VI's down to post on here.
Turns out that the data binding set to "Shared Variable Engine" but not connected to any variable on the graph was enough to cause some data to duplicate on a delay which created additional data points.
Not sure what was causing this to occur, maybe a memory issue? But regardless this was the solution that worked for me.