LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unwanted values in a graph

Solved!
Go to solution

I have a program that reads multiple spreadsheet files and plots the data of every file on a graph. The problem I am having is labview is plotting zeros that are not contained in the file, making the graph not look right. Attached are 2 screenshots, one of the block diagram and one of the front panel.

 

If you look at the graph on the front panel, you can see the white plot starts at zero where the other plots do not. You can also see that all the plots except for the green one end at zero as well. I am trying to make all the plots look like the green one.

 

Thanks! 

Front.jpgblock.jpg

Message Edited by Derrick M on 02-11-2010 01:57 PM
0 Kudos
Message 1 of 18
(3,279 Views)
Attach a couple of the files you are reading. The problem is probably there. Have you done any basic troubleshooting like using a probe to look at the arrays or using a 2D array indicator to see what is actually read?
Message Edited by Dennis Knutson on 02-11-2010 01:04 PM
Message 2 of 18
(3,273 Views)

POST COLLISION* 

 

Just guessing...

 

The first file has something bogus in it.

 

There different numbers of vlaues in the various file so the final array coming out of the For loop get some zeros tossed into to keep it rectangular (same number of collumns for all rows).

 

Ben

 

* Not so bad if you are posting the sam ething as Dennis. Smiley Happy

Message Edited by Ben on 02-11-2010 02:04 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 18
(3,269 Views)

Here are 3 of the files. The files were generated using a separate Labview program.

 

0 Kudos
Message 4 of 18
(3,260 Views)

The files have a differnt number of lines so the extra empty lines from the short file get set to zero.

 

Try using "array Subset" before the data gets plotted so you can just display the valid data.

 

ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 18
(3,248 Views)
The problem is each file will differ in length. Is there any way to make Labview just ignore any value that is 0 or equal to 0 before plotting it?
0 Kudos
Message 6 of 18
(3,232 Views)

LV will not plot "NaN" (not a number).

 

Use a double nested For loops to check if = 0 and if true use "NaN" (hint a select node on compare palette wil let you choose between the value of NaN.

 

If you have trouble with that part code what you can and re-post to let someone give you anothe push.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 18
(3,229 Views)

Here is what I have so far. As you can see from the front panel screenshot, the zero at the beginning of the graph is gone, but the end zeros are still there. I have attached a screenshot of my block diagram as well.

 

I am teaching myself how to use LabView using programs that have already been designed here at my company as guides, and only have about 10 hours worth of programming experience so far. Any and all help is greatly appreciated, thanks!

 

Front Panel.jpg

Block Diagram.jpg

0 Kudos
Message 8 of 18
(3,172 Views)

wire the control "value to be graphed" directly, rather than using a local variable. There is no need for a local there. Also, move the control

outside the loop, it doesn't need to be continuously read. Finally, you can split the wire from a zero constant rather than having two individual zero constants

hooked up to your spreadsheet VI. Last comment, why isn't your company training you? haha

Message Edited by for(imstuck) on 02-15-2010 12:27 PM
0 Kudos
Message 9 of 18
(3,166 Views)

I made the suggested changees for(imstuck), but those changes do not change the function of the program, just clean it up a little bit. All of those were just leftover from experimenting, and never got around to cleaning the block diagram up.

0 Kudos
Message 10 of 18
(3,159 Views)