Hello,
We are trying to create a 15 min averaging data table for sending weather data to a national network (USDA-ARS LTAR). In this data table, we have three data columns (variables that are for the most part non-numeric constants for every data record). Is there a way in CRBasic code to add a non numeric value in a column for every data record for variables LTARSiteAcronym: UMRBStP Also, RecordType: C
This seems like fairly straightforward but cannot find any command to do it off hand.
This network also requests ISO8601 time in the following format: yyyy-mm-ddTHH:MM:SST-06:00 (-6 is UTC offset). This is not a standard time available for our CR3000s. I see some code for other time/date formats but am not sure how this could be done in CRBasic - would like to avoid doing in an outboard program.
Any help would be greatly appreciated
Thank you,
Peter
USDA-ARS SWMRU
'ISO8601 date/time string format
Public ISO8601 As String * 28
Dim tString As String * 24
Dim offsetString As String
Dim UTCOffset As Long
'Main Program
BeginProg
Scan (1,Sec,0,0)
UTCOffset = Status.UTCOffset
offsetString = IIF(UTCOffset >=0,"+","-") & FormatLong(ABS(UTCOffset/3600),"%02u") & ":" & FormatLong(ABS((UTCOffset MOD 3600)/60),"%02u")
tString = Status.Timestamp(4)
ISO8601 = Mid(tString,1,10) & "T" & Mid(tString,12,8) & offsetString
NextScan
EndProg
The non numeric columns can be added to your data table by sampling variables of type string.
Thanks for the help, I am still learning some basic programming.
When sampling strings into your stored DataTables be sure to check your table fill times. In general, strings take a lot more memory than numeric data.
When you first send the program to the datalogger check its details:
https://www.campbellsci.com/tips-details
If the program is running you can find that information in the Station Status or Data Table Info Table:
https://www.campbellsci.com/news-tip-status-table