From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CSV conversion pro

Solved!
Go to solution

Hi Guys,

 

I'm new to lab view and was wondering if someone could piont out where i have gone wrong please,

 

I am looking at a Wheatstone bridge with a NTC thermistor (resistance drops as temp increases).

i'm trying to write the data to a CSV (2b data collection) which i think is working as expected.

 

Then in a separate Vi i'm reading the CSV and trying to plot in on the graph (after converting the voltage into temperature) (i believe this is where it is going wrong). as the output graph is a single data point. i also cant seem to get the warning lights working but that isn't my main stumbling block.

 

if any one could tell me where im going wrong or point me in the right direction i would be very appreciative.

 

Cheers

Richard

 

0 Kudos
Message 1 of 14
(2,512 Views)

Since you're not Appending to file when you write you'll start over on your result file each time, only writing the last result. 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 14
(2,493 Views)
Solution
Accepted by topic author NewRichard

Look at the format of your date/time data in the file and compare it to the scan string code where you convert from string to time!

 

Your file has 22/04/2020 11:39:17.619189

Your code is %<%I:%M:%S %p %m/%d/%Y>T

 

Problems:

1.  Your actual date is day/month/year but you are looking for month/day/year.

2.  Your actual date is 24 hour without the am/pm, but you are looking for am/pm.

3.  Your time as 6 decimal places in the second, but you are looking for integer seconds.

4.  Your date comes before the time by 2 spaces,  but you are looking for the time before the date.

 

Your scan code should be   %<%d/%m/%Y %I:%M:%S%6u>T.

 

#3 is what is giving it all the same timestamp, but all 4 are making it so your date/time are read wrong.

 

You should also set your X-axis on the graph to be formatted for absolute time rather than "automatic".

Message 3 of 14
(2,491 Views)

That's perfect, thank you for your help. 

0 Kudos
Message 4 of 14
(2,427 Views)

Actually that %I should be a %H.  Because %I would be for a 12 hour clock and if you had %p for am/pm.  Since you don't, you need %H for a 24 hour clock.

0 Kudos
Message 5 of 14
(2,411 Views)

Thank you for sharing your knowledge :),

It doesn't seem to change the output but this may be due to the fact i work in the morning hence it doesn't go past 12:00.

 

Is there any chance you could help me out again, I have some alarms if it get too hot or too cold, but i cant seem to get them to go off, is there something i am doing wrong ?

 

 

0 Kudos
Message 6 of 14
(2,392 Views)

Yep.  That is okay for morning hours.  I just tested it for an 24 hour input and found that any hour after 12 pm  (13, 14, .... 23)  causes the hour to stay stuck at 12 pm.

 

As for your alarm situation, I'm not sure what you are trying to do.  I only see alarm booleans in CSV to dataprocessing VI.

 

You do a comparison within a For Loop and that goes to the indicators.  Those indicators will flash by so rapidly, you won't even see them and they will be left at whatever the last value of the file compares to.

 

This isn't some continuous monitoring program, but a batch file processing program.

Message 7 of 14
(2,375 Views)

Hi all,

 

I'm new to labview and was wondering if anybody can help me could help me.

I am reading from a csv file, i index the array and then run it through a decimal string to number box,

but it seems to round everything to 1 dp, when i need as may as possible (7 dp min)

i've read the help but it doesn't mention increasing the accuracy.

 

Can any one help me or point me in the right direction please

 

cheers

Richard

Download All
0 Kudos
Message 8 of 14
(2,363 Views)

HI Ravensfan,

 

Can you help me one last time,

The string to number block seems to be rounding the data to .dp is there a way to have this not round it ?

 

Cheers,

Richard

0 Kudos
Message 9 of 14
(2,339 Views)

Hi Richard,

 


@NewRichard wrote:

The string to number block seems to be rounding the data to .dp is there a way to have this not round it ?


The StringToFloat function does NOT round the input data, so the problem is in your code.

Unfortunately you didn't attach your VI…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 14
(2,335 Views)