LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error graph XY discontinuos data

Solved!
Go to solution

 

Hi.

 

I have two arrays, one in Time Stamp Format and another with numbers in DBL.

The array X is non continuos dates, because this is a configuration of different possibilities for the client applicattion.

 

When graph, LabVIEW show dates (hours) than that not exist in the array, and show a line of interpolation bettwen they.

I need line of interpolation bettwen my numbers of the array, but i don't need the dates (hours) not included in the array.

 

Do you have a possible solution?

 

Captura de pantalla 2024-02-18 194252.png

 

0 Kudos
Message 1 of 6
(350 Views)

Sorry, I cannot look at your Vi because I only have LabVIEW 2020 here. Consider "save for previous" before attaching.

 

  • To create gaps in graphs, you can insert a y=NaN for a given x.
  • For the picture, it seems your time points are equally spaced, so you don't really need an xy graph.
  • You could also just graph points without interpolation.

 

 

0 Kudos
Message 2 of 6
(319 Views)
Solution
Accepted by topic author Toni_Grau

Here's one possibility, but I am sure there are simpler ways using a waveform graph.

 

I am sure it would need to be tuned a little bit. How accurate are these timestamps?

 

altenbach_0-1708290799241.png

 

0 Kudos
Message 3 of 6
(306 Views)
Thank you very much.
I was unaware that entering a NAN value could break data interpolation.
The data do not always have the same increment, they come from a consumption file of the electricity meter.
We want to carry out analyzes for example on specific days of the year, for example consumptions that we have had on Thursdays, or for example consumptions that we have had on public holidays (the interval is not always the same, since state holidays are scattered in the calendar).
Perhaps I like the idea of ​​incorporating the NAN data when generating the array to be performed, although I would like the data not to be separated but together, even though it may seem strange, but it is otherwise when it represents all the consumptions of holidays of the year the points may be very close but the graph very wide.
I am uploading version 2020 in case someone else is encouraged to look for a possible solution.
Thanks
0 Kudos
Message 4 of 6
(257 Views)
  • Please do not use code tags for the body of your post!!!
  • Please don't attach a new VI with the same name as an earlier VI (you could have named it "consulta NI_2020.vi".
  • Your example does not need a while loop and timing.
  • Please keep the front panel reasonable (add scrollbars to arrays and make them fit the panel, don't maximize the panel, etc.)

If the spacing is random, there is no way for the code to tell if there is a gap or not.  Do you have metadata to absolutely tell if there are gaps? My comparison adds a gap if the distance from the previous point is more than a certain reasonable value. You can tune that value to better fit your definition of "gap".

The NaN are only inserted to the data going to the graph. You don't need to modify the original arrays.

 

Why not just graph the data without interpolation?

altenbach_0-1708359165909.png

 

0 Kudos
Message 5 of 6
(245 Views)

Thank you very much for the contribution given and sorry for the errors in the publication of the post.

The truth is that your solution is the most feasible.

I have implemented a calculation for him before entering the loop doing the subtraction between the dates array[1]-array[0] so that in this way he can calculate the time difference and in this way replace the constant with this result .

Thus, whenever there is the same deficiency, it does it correctly, whether it is a difference of one hour between date and date, or whether it is a difference from day to day or from week to week.

I still have some representative graphs to make, for example the weekend consumption of the whole year. I will continue to research, but I appreciate the answer given as it has taught me a little more how to graph LabVIEW.

0 Kudos
Message 6 of 6
(232 Views)