|
Prev: Princeton Applied Research 283 Potentiostat cables needed, urgent!!!
Next: Need octave analysis in signal spectrum, not power
From: Lview dude on 7 Sep 2005 12:12 I'm using Labview 7.1 and I'm graphing a group of data sets on a single graph display. These data sets have different numbers of total points and the sets with a less number of points wind up going back to the origin (0,0). This seems to be due to where they stop in data points labview fills in the vacancy with a 0,0. The result is (other than addiing erroneous data points) is the scaling is way off because I'm not near the origin. How can I( get round this problem? Thank you, Philip
From: Lview dude on 7 Sep 2005 13:12 Lynn, I was thinking of that, but I would like to allow users to simply plug in the data and view the graph (keep it as simple as possible). I could automate the padding, but again, here if the data goes to zero and I have some condition looking for that it could give an invalid graph display. Thank you...
From: altenbach on 7 Sep 2005 14:13 OK, we need more information. Are you usig an xy graph or a waveform graph. How is you data organized? (e.g. one big 2D array, array of clusters, etc.). Why do you even have "vancancies"? Could you attach a simplified version of your VI containing some example data as default values?
From: Lview dude on 7 Sep 2005 15:43 Hereis the VI... I'm using the X/Y graph I've limited the number of data sets to 4 (it would busy with more than that on one graph) I read in a text file with columns of data and I have one graph that i use an active scaling factor in order to determine a different valiable for the data collected. Read from Text File chirpTemp thing.vi: http://forums.ni.com/attachments/ni/170/141361/1/Read from Text File chirpTemp thing.vi
From: altenbach on 7 Sep 2005 16:43
Your code seems to be highly flawed. Does it even work at all? Some comments. - If you load more than one data file, the data from the files read in the previous iteration gets lost. You'll only get the set that you read last. (for example, the 2D array output from case "=0" will be empty at all later iterations. That's why you get all these zeroes! - Why do you need to do all the array extraction and manipulation at every while loop iteration. Everything prior to the division by the FP control belongs outside the while loop. - "Array subset" is better than "delete from array". - The while loop spins at infinite rate calculating the same old stuff over and over again, millions of times/second. Use an event structure so it recalculates exactly once whenever the control changes. - All the Array manipulation is done identically in four different places, you only need that code once in a loop, you can even do it right in the FOR loop when you read the data. - The label.text properties need to be written exactly once, ouside the loop. - You don't need to connect an indicator to the slide. Just right-click on the slide and do "show..digital display". - You don't need a stacked sequence. It only hides code and forces backwards wires, making the code hard to debug. - You don't need to transpose following by gettting a row. Just get a column instead! Attached is a quick attempt at some simplification according to my comments above. I cannot test it so it probably needs a few tweaks here and there. Still, it should give you some ideas. Modify as needed.:) Read_from_Text_File_chirpTemp_thingMOD.vi: http://forums.ni.com/attachments/ni/170/141375/1/Read_from_Text_File_chirpTemp_thingMOD.vi |