LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

chart does not plot correctly after 10 sec

I am running LV 8.2 and am having problems with charts.  I am using waveform data that is coming out of DAQmx read (analog 1D Wfm Nchan 1 samp) and is plotted on a chart after being scaled.  The data displays all 6 channels correctly for about the first 10 seconds (updating every 1 sec), but after that, the x axis stops adjusting and the data starts plotting in the y direction (obviously not correct).  The chart buffer is set at 1024, but it resets after about 15 data points enter the buffer (I verified this by using a property node for the chart history and checking the size of the array).  When the history resets, this corresponds to the chart plotting incorrectly.  There are attached screenshots that show the plots before and after the problem.  This problem does not seem to affect anything else in the program.
 
Thanks for your help in advance.
Craig
0 Kudos
Message 1 of 6
(2,785 Views)
Hi Craig,

could you attach your vi (maybe stripped down to the core) with some default data to show the problem?
It's mostly easier to find the problem in the vi than in a screenshot!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,779 Views)

Here is the source distribution for the project.  I have been running it with a simulated device (inc. in MAX config file).  The same problem occurs with simulated and real device.

 

Craig

0 Kudos
Message 3 of 6
(2,772 Views)
Hi Craig,

I'm sorry, but I cannot help you on this 😞
Reasons:
- Programming guidelines/hints neglected:
  - your vi is way too big. I'm using standard LCD screen with 1280×1024 resolution and your vi is roughly 9 times that big... I couldn't get an overview!
  - wires from right to left
  - unneeded sequences - (dataflow gives execution order!)
  - big case structures with duplicated cases where only ONE parameter is changed
  - no comments in the code
- missing 'Write to spreadsheet file-strings.vi' in 'header information output.vi'

Sorry...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(2,765 Views)
I apologize for being a novice.  But the problem still stands.  I'm sorry my code is not clean.
0 Kudos
Message 5 of 6
(2,757 Views)

Look at the error wire coming out of the DAQmx read VI and you will see that you are getting an error.  Therefore you are not getting any data and the chart gets really funky.  I am not a DAQ guru but here is what you have configured.

The task is set to sample at 1k with 100 points.   Then in the loop you read 1 point every second.  So you don't come even close to getting the data out fast enough.  I would suggest looking at some of the single point examples and see how they configured the tasks etc.  You can also use the DAQ assistant to show you how.

0 Kudos
Message 6 of 6
(2,729 Views)