03-28-2024 06:04 AM - edited 03-28-2024 06:05 AM
I'm reading the data from a .csv file and trying to display it in a chart. I can show the data by adding a 2D array with a wave chart, but I want the timestamp on the wave chart to be the timestamp read in .csv. I also want to simulate the data according to the refresh interval of the VI in Excel. For example, the time elapsed between each row in the first column (time). If it is 1 ms, data must continue to be added to the graph every 1 ms in labview.
I tried a few ways but I couldn't get exactly what I wanted.
I've included sample data I read below.
Anyone have an idea about this?
__________________________________
Every opinion given is worthy of respect.
03-28-2024 02:20 PM
Hi
since you're running windows, you won't have the resolution to plot precisely the data at 1ms rate for example. (Windows is not real time).
what you could do is use the time stamp and wire that information to a wait function that will run on a loop where you plot your chart. At every new data to be plotted it will wait for the time (within windows interference).
You must create a loop and pass the data into the loop with auto index to plot one data at a time not the whole array (otherwise the plot will show all the data at once.
If the time stamp data is equally spaced you can use that information to write the chart property note prior to the beginning of plot to adjust to the time stamp ( you may need to dig the manual how to properly setup that).
03-30-2024 12:48 AM
@LVNinja wrote:If the time stamp data is equally spaced you can use that information to write the chart property note prior to the beginning of plot to adjust to the time stamp ( you may need to dig the manual how to properly setup that).
I definitely cannot run LabView at the same refresh intervals. What I am thinking of is adding data at every refresh.
The data I am trying to read is as follows. It is the time data in the first column. How can I use this time data instead of the timeline here?
03-30-2024 01:53 PM - edited 03-30-2024 01:53 PM
03-31-2024 01:47 AM
GerdW thanks for answer.
Well, only the time column and the column next to it are shown here. So, at the same time, the other 3 data branches need to be drawn on the screen according to the time in the 0 column in a graphic. How can this be done?
In other words, I want to plot the data one by one based on time in this .csv file. In a way, the data is simulated in real time. We can think of it like a video, with play and pause buttons.
03-31-2024 02:38 AM
Hi worker,
then you need to implement more code:
04-01-2024 05:47 AM
I have created a small example here but here it only takes the value of one column and it does not plot the whole chart in the chart.
04-01-2024 09:27 AM - edited 04-01-2024 09:41 AM
your code is plotting column 13 fromn the csv file.
If you want to plot all three columns, then you need to read all the 3 columns (accelX,accelY,accelZ)
and create a cluster xy for each plot then build and array of clusters to plot on the XY graph.
NOTE> The while loop inside the for loop is not necessary.
If you enable indexing on the for loop you can eliminate the index array , it will automatically pass one value at a time.
Using a control on Wait time let's you change the speed of plot as it plays back.
04-01-2024 09:31 AM
try using the 3D Cornet plot you will be able to see 3d image
04-01-2024 11:53 AM - edited 04-01-2024 12:07 PM
Hi worker,
@constructionworker wrote:
- it only takes the value of one column
- it does not plot the whole chart in the chart.
Your VI, just cleaned up slighty…
Suggestion:
Cleaned up a little bit more, now with a XYgraph showing the "whole" plot…
I don't recommend to update graphs so fast. And I don't recommend to plot so many samples into such small graphs…