I've been keeping up with reported rating curves at a few sites by updating the programs with new equations. However, this has reached what I would consider to be critical mass. Does anyone have a example program/script that can read in a text file residing on the logger and act like a a lookup table? Thanks.
There are multiple ways of doing this. A simple method is to put the data in a text file with a pair of values on each line. A loop is needed to read lines from the file at startup. SplitStr will break the line into two numbers and place them in the array.
Const MaxCount = 20 'Maximum number of lines in your rating table
Dim DataLine As String * 48
Dim LineLength As Long, FileHandle As Long
Dim k As Long
FileHandle = FileOpen ("CPU:RatingTable.csv","r",0) 'Open the csv text file
For k = 1 To MaxCount
LineLength = FileReadLine (FileHandle,DataLine,48) 'The Read Length should be the same as the destination string size
If LineLength > 1 Then
RatingTable(k,1) = NAN 'Fills missing values with NAN
RatingTable(k,2) = NAN
FileClose(FileHandle) 'Closing the file is important
'Measurements etc. go here
I am having a hard time understanding how you would match up the sensor measurements to the values in the text file?