LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

offset elimination on csv file

Hello everybody,
 
i'm not really used to lab view 😞 but i would like to read a csv file with voltage data. this data has a 3V offset.
 
how can i eliminate the offset.
 
i tried to substract the offset by placing a minus icon.. but that wasn t working.
 
it would be great, if someone would have an example file
 
u all have a great weekend
 
Greets from germany
Josef
0 Kudos
Message 1 of 7
(3,305 Views)
How did you read the csv file, and how did you try to use the "minus sign"? What is the format of your csv file? Is it a single column? E.g.:

0 Kudos
Message 2 of 7
(3,300 Views)
Hi smercurio
 
i added a screenshot    i hope this will help
 
the csv file is like
 
"2.495177,2.495177,2.493971,2.493971,2.496383,2.491559,2.496383,2.492765,2.495177,2.491559,2.491559,2.491559,2.492765,2.491559,2.490354"
 
all in one line.
 
thank u for ur quick answer!!
 
Greets josef
0 Kudos
Message 3 of 7
(3,290 Views)
Hi aj,

you should change for the "spreadsheet string to array" function in the aquisition part:
-array constant from string type to dbl type
-use a format string of "%.;%f" as you use a German LV with an English data file
-use "," as tab delimiter input

This way you get a DBL array where you easily can do any math (as shown above)!

And please: Never attach downscaled pics of block diagrams - attaching the vi is preferred here... (As a bonus you may get reworked vi with added commentsSmiley Wink)


Message Edited by GerdW on 07-04-2008 06:03 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,273 Views)

I agree with Gerd,

Attaching the VI would be much better than an image which only shows a section of the code.

R

0 Kudos
Message 5 of 7
(3,254 Views)
Josef,

It looks as though you may be subtracting an empty array from your data (in the area of the image marked "Offset"). Remove the constant, empty array and connect a DBL constant with the value = 3.0. The elementary math functions are polymorphic, meaning that they can adapt to various input types. Subtracting a scalar from an array as I described above has the effect of subtracting the scalar from each value in the array and returning an array with the offset removed.

Lynn
0 Kudos
Message 6 of 7
(3,230 Views)

Thanks to everybody!!

I did what Lynn said. I connected a DB constant.

Now it is working!

 

have a great week!

Josef

0 Kudos
Message 7 of 7
(3,193 Views)