Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Non-numeric constant in data table


ganzlin Sep 23, 2015 03:24 PM

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


JDavis Sep 24, 2015 08:51 PM

'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


JDavis Sep 24, 2015 08:52 PM

The non numeric columns can be added to your data table by sampling variables of type string.


ganzlin Sep 24, 2015 08:56 PM

Thanks for the help, I am still learning some basic programming.


jra Sep 28, 2015 02:49 PM

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

Log in or register to post/reply in the forum.