02-11-2010 01:56 PM - edited 02-11-2010 01:57 PM
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!
Solved! Go to Solution.
02-11-2010 02:02 PM - edited 02-11-2010 02:04 PM
02-11-2010 02:03 PM - edited 02-11-2010 02:04 PM
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.
02-11-2010 02:13 PM
Here are 3 of the files. The files were generated using a separate Labview program.
02-11-2010 02:18 PM
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
02-11-2010 02:35 PM
02-11-2010 02:40 PM
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
02-15-2010 12:08 PM
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!
02-15-2010 12:21 PM - edited 02-15-2010 12:27 PM
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
02-15-2010 12:35 PM
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.