LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with XY Graph looking like a scribble

I am having problems reading a CSV file and getting the XY graph to display properly.  I am reading blood glucose values in a CSV format.  The best way to describe the outcome is that it looks like a scribble.  If the X axis is simply an index number, it gives me nice results, but when I try to make the X-axis show time/date stamp, it looks like a scribble.  I have tried both the XY graph and a waveform graph.  I have attached the code and a screen capture of what the graph looks like.

 

MikeBowen_0-1743212664505.png

 

Mike
0 Kudos
Message 1 of 26
(406 Views)

Can you do a "save for previous" (2020 or below) and attach again. Make sure to include your data and how you read the file.

0 Kudos
Message 2 of 26
(351 Views)

I have attached the code in rev 20, there is one sub vi that I could do away with.  I have also attached a sample file. 

 

The code throws away the top 2 rows because they contain header information.  Then after filtering for data that is between the start and end dates I throw out unused columns (empty data) and move one column to the end, as that contains information like meals, medication, etc.  After that the data is converted to a decimal value (glucose values) and the time/date stamp is converted to a double.  After that it is bundled for display.

 

I also tried the xy graph but that gave a similar unuseable result.

Mike
0 Kudos
Message 3 of 26
(329 Views)

You attached LabVIEW 2025 version, not the down converted code for the "Read_....vi". (only the conversion VI is OK).

0 Kudos
Message 4 of 26
(321 Views)

Third time's a charm?  I updated to Rev 10, and eliminated the sub vi

Mike
0 Kudos
Message 5 of 26
(316 Views)

Now it is stuck in a virus scan. Can't win! 😞

 

0 Kudos
Message 6 of 26
(313 Views)

Let's try it again

Mike
0 Kudos
Message 7 of 26
(309 Views)

Your time values are not sorted, and I I just graph all timestamps, here's what I get.

altenbach_0-1743272104471.png

 

A lot of your code is pure Rube Goldberg, for example to append a row to a 2D array, Built array is the correct way (not measuring the array followed by insert)

 

Can you explain which columns you want to graph? (Your code is way too convoluted!). You should also ensure to replace all missing data with NaN instead of zeroes.

0 Kudos
Message 8 of 26
(301 Views)

Thanks for the input.  As you mentioned it I do recall that when I was looking at the data in Excel I did have to sort it first.  Looks like I need to sort the data before graphing it.  The columns I want to graph are the time, the History glucose, the Scan glucose, and the strip glucose.  I also keep the comments for referral back to later.  I based the work off of two examples, one that uses an x-y graph and the other that uses a waveform graph.

 

I'l take a look at rewriting my code and see what I get.

 

Mike

Mike
0 Kudos
Message 9 of 26
(291 Views)

Here's something to get you started. I am sure you need to tweak a few things... (e.g. I only graph two columns and don't retain the comments)

 

altenbach_0-1743273709649.png

 

Message 10 of 26
(288 Views)