Darren

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Darren

  1. I recently found some code (I think in the DAQFactory Express help files - can't find it now) to read two columns of data from a file and put the results into V channels with associated time. I modified this code to get data from 8 different columns of a .csv file and create a V.channel for each column. It worked fine, I was using this to create graphs from data I had captured with my Labjack combined with data I was gathering using other applications having first manipulated the data into a single .csv file using a spreadsheet. I then decided it was about time I checked for updates for DAQFactory Express and the Labjack software, installed them, now the data is not getting read correctly. I'm getting the correct time and then the 10 digit DAQFactory time for most values after 18 rows of this I get one with Nan then the one with the correct value then 18 with DAQF time then 1 with correct value then one with time the 18 DAF time etc. etc. etc. . The .csv files do have some blank values but not in a 20 or 40 row pattern I'm doing this without the labjack connected.... Whats happening..... Here is the sequence I use to read the data Private.hFile = File.Open("c:\Documents and Settings\Darren1\My Documents\vegoil\Logs\Labjack Logs\glowplug\special\GP-cold-drive.csv",1,0,0,1) V.Cyl4GP.ClearHistory() V.Coolant_Temp.ClearHistory() V.Cyl4IQ.ClearHistory() V.DF_Mark.ClearHistory() V.IQ.ClearHistory() V.rpm.ClearHistory() V.VAG_Mark.ClearHistory() Private.strIn = File.Read(Private.hFile) while (1) Private.strIn = File.Read(Private.hFile) if (Private.strIn == "") break endif Private.x = StrToDouble(Parse(Private.strIn,1,",")) Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) V.Cyl4GP.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,2,",")) Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) V.DF_Mark.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,3,",")) Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) V.VAG_Mark.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,4,",")) Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) V.rpm.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,5,",")) Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) V.IQ.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,6,",")) Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) V.Coolant_Temp.AddValue(Private.x) Private.x = StrToDouble(Parse(Private.strIn,7,",")) Private.x.Time = StrToDouble(Parse(Private.strIn,0,",")) V.Cyl4IQ.AddValue(Private.x) endwhile File,Close(Private.hFile) After looking about to try and find out why this would be happening I noticed that I could use Read.FileDelim but could not find a good example of this in use. I'm new to coding and this is all a steep learning curve although I am (was) making gradual progress adding buttons to the graphing page to tune the way the data was displayed etc.