LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I capture a data point and graphing it?

I am reading out a data for a current sensor and voltage sensor using NI's ELVIS.  I would like to capture the data point's values and have it added to the graph and continue capturing  up to 10 additional data point values.  The ultimate goal is to do a linear fit on the captured data points and determine the slope of the line.  I have included the initial vi that reads the current and voltage but I do not know where to go from here.  How do I capture and store the data to graph it and later on do a fit to the captured data?
 
0 Kudos
Message 1 of 4
(3,277 Views)

Star Man,

First, in your example you are using an X-Y graph, but you are only graphing one point. You are using build array to make your data compatible with the graph, but you are only putting one point into that array.  Each iteration overwrites the point in the array so the array never grows.  Here is a very simple way (not the most effecient) but simple, and if you are only doing 10 points, it will work fine.  I added a shift register and then each iteration of the loop you add the latest measurement to the array (using the same build array function expanded one element).  One of the caveats with this method, is if you let the code run for a long time, you would run out of memory because the build array function is not bounded.  LabVIEW would keep making that array as large as it could.  This doesn't address your data saving or curve fitting, but it's the first step in making that stuff work.

 



Message Edited by StevenA on 05-10-2008 12:31 PM
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 2 of 4
(3,252 Views)

Steve,

Thanks for the reply.  How will this work with real time readout and then saving individual points at different times?  I would like the students to see the voltage and current as they are making changes to the circuit and then be able to capture the one data point after each of the changes that they make.  They will be making about 10 changes for this part of the lab.  I can see having each of the data points added to an array which is what your changes do but how do I make it so the students can add the data points to the array when they have completed the changes?

Thanks for your help.

Kent

0 Kudos
Message 3 of 4
(3,213 Views)

Star Man,

Just put a case structure around the build array functions and control that case structure with a user "OK" button.  The students can make the changes, then when they see the value they want to record, they just hit the button.



Message Edited by StevenA on 05-12-2008 10:02 AM

Message Edited by StevenA on 05-12-2008 10:03 AM
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
Download All
0 Kudos
Message 4 of 4
(3,205 Views)