LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

linear data correction

Solved!
Go to solution

Hi All,

 

I am working with data files that were generated by a data acquisition device. The files consist of 56 columns (the first column is a time stamp and the rest are voltage values from sensors). I am  interested in converting those voltage values to pressure values by using a linear correction (y=mx+b). Each sensor has a different slope and intercept thus I need some way of entering a slope and intercept for each column while leaving the first column unchanged.

 

Ideally the new 'corrected' values would be written to a new file. 

 

Any help with this would be greatly appreciated!!!

0 Kudos
Message 1 of 9
(2,947 Views)

Post your vi file and a sample data file and we'll see what we can do for you.

0 Kudos
Message 2 of 9
(2,944 Views)

Hi,

 

I haven't worked on a vi yet. I am extremely new to labview and am not even sure where to start with such a project.

 

Please find a sample file attached. Note: some of the columns read zero because those sensors were turned off.

0 Kudos
Message 3 of 9
(2,941 Views)

Here is a vi in 8.5 format.

Message 4 of 9
(2,909 Views)

Thanks for the quick reply.

 

Looking at the .vi I am not sure where to enter the values for m and b to scale the data. Since each sensor (each column) has different scaling factors I need to be able to enter a different m and b for each column.

 

Perhaps I am just missing it in the .vi.

 

Thanks for your help.

0 Kudos
Message 5 of 9
(2,899 Views)
There are two Initialize array functions at the lower left of the for loop. Unwire them and put your data values here. You could create an array numeric control on the front panel and enter your values, or read them in from a file. You will need to include a value for the timestamp column also. If you only enter items for the number of data columns, you will miss the last column of data.
Message 6 of 9
(2,889 Views)

Actually I do have the calibration data in a file. It would be great to be able to read it from the file and have the correction applied automatically.

 

The file is organized  with slope in the first column and intercept in the second column (so m and b). The first row is sensor one, second is sensor two and so on.

 

How would I wire this into the vi? so that the data is automatically corrected?

 

Please find the calibration data file attached.

 

Thanks again for the help!!!

0 Kudos
Message 7 of 9
(2,858 Views)
Solution
Accepted by topic author sjberg
Message 8 of 9
(2,839 Views)

Thanks!!!

 

I just need to add an extra line in the calibration file in order to push it over since it was starting with the time stamp.

 

 

0 Kudos
Message 9 of 9
(2,830 Views)