LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange line in graph plot

Howdy all!

I'm doing a simple temperature/time graph using LabView 8.5.  The results look good except for an odd diagonal line that connects from somewhere on the x-axis to the latest point placed on the graph.  As the graph adds new points of data, this line moves along with the new data.  I've included a picture of the graph.  Anyone have any idea what's causing this?

********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 1 of 8
(3,657 Views)

is this an xy graph or a chart?  look at the data going into the graph, see if this is an extra data point is at the end of the data set and is therefore being plotted.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 8
(3,643 Views)
Posting an image inside a word document really doesn't provide a lot of information. If you want to post just an image, why paste it into a word doc? From the image, we can't even tell whether you have chart, graph, or xy graph.
0 Kudos
Message 3 of 8
(3,638 Views)
It's a graph, and I plopped the image into a word document so most people could open it and see a picture of what I was talking about.  I figured this might be something someone has seen before and recognized what was causing it.

BUT....just to make you happy I've attached the chunk of code that generates the data for the graph.
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 4 of 8
(3,630 Views)
Hi spaceman,

simple pics can be viewed by everybody (unlike "most people can open *.doc") Smiley Wink

Well you attached a piece of code that shows overuse of local variables and sequences, but the data generation is missing...
Can you insert some constant data instead of device communication vis? (Make an indicator to show the data, run the vi & collect data, convert indicator to constant
...)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 8
(3,623 Views)
It's a hectic day today, so I haven't had a chance to do the code changes you requested.  M'bad.

But I will give you this info - it's a simple serial communication with an external device that replies with temperature readings.  Roughly every ten seconds I interrogate the device for a temperature reading, which is read into the "Temp array".  I'm including another snapshot (a jpg!) of my latest run, and here are the values in the arrays:

array   time        temp
0         4.0          80
1         13.12      80
2         22.26      79
3         33.29      79
4         42.42      80
5         51.54      84
6         62.57      86
7         71.70      85
8         82.73      84

I stopped the run at this point.  All array values are zero from here out.

And I LIKE LOCAL VARIABLES!!  There!  I said it!  And I'm not ashamed!!   😉


Message Edited by spaceman spif on 01-28-2008 11:09 AM
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 6 of 8
(3,619 Views)

Looks like you have 0,0 (just extrapolate your plot and you can see that the data line goes to 0,0) the end of your data and this is what you are plotting.  You can either use a subset of the data in your plot (take a subset from 0 to n where n is the last point recieved) or even better you initialize your un used values of time and temp to "nan" this will not shoud up in your plot and is a great trick when plotting data with undefined values.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 8
(3,610 Views)
Simple and worked like a charm!  I had an initialization routine that set all array value to 0.  I changed that to set all array values to "NaN", and that solved the problem!

Thanks!
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 8 of 8
(3,605 Views)