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.

how to enter alphanumeric value LNDB loggernet database


AMK Jun 16, 2021 06:00 PM

Hello forum,

I add a site ID tables output on CR1000 and CR1000x. The last round of programing we did we set the site ID that starts with a CC01. This value isn't being output with the data. 

Is there a correct way to enter a string (eg. not a number) as a value?

"TOA5","24397","CR1000X","24397","CR1000X.Std.05.00","CPU:CC01_151_V01.CR1X","30191","Table105"
"TIMESTAMP","RECORD","SiteID","LoggerID","PROGID","STAGE","BATTERY_V"
"TS","RN","","","","feet",""
"","","Smp","Smp","Smp","Smp","Smp"
"2021-06-15 16:00:00",0,"NAN",151,30191,1.605,12.46
"2021-06-15 16:05:00",1,"NAN",151,30191,1.605,12.46
"2021-06-15 16:10:00",2,"NAN",151,30191,1.605,12.46
"2021-06-15 16:15:00",3,"NAN",151,30191,1.605,12.46
"2021-06-15 16:20:00",4,"NAN",151,30191,1.605,12.47
"2021-06-15 16:25:00",5,"NAN",151,30191,1.605,12.47
"2021-06-15 16:30:00",6,"NAN",151,30191,1.605,12.47
"2021-06-15 16:35:00",7,"NAN",151,30191,1.605,12.47

The abbreviated program syntax is below:

 

'Declare Constant
Const LID = 151 ' Logger ID
Const SID = "CC01" ' Site ID

Public SiteID
Public LoggerID

DataTable ( SYS,SITE_VISIT <> NAN,1000)
  TableFile ("USB:CC01_151_SYS",8,-1,0,0,Hr,0,0)
  DataInterval (0,5,Min,10)
  Sample (1,SiteID,FP2)
  Sample (1,LoggerID,FP2)
EndTable

BeginProg
  Scan (15,Sec,3,0)
    ' Set the site and logger ID as defined by SID and LID
    SiteID = SID
    LoggerID = LID

'5 Minute OUtput
    CallTable Table105
    CallTable SYS

  Next Scan

EndProg

 


AMK Jun 16, 2021 06:10 PM

Trying this route:

 

Public SiteID As String

 


pokeeffe Jun 16, 2021 06:30 PM

Declare the Const as string too, and fix your Sample datatype


AMK Jun 17, 2021 05:54 PM

Absolutely - I love easy solutions. Thanks @pokeeffe. 


AMK Jun 17, 2021 06:00 PM

Actually, this doesn't compile, so am I misunderstanding @pokeefe? 

Const SID    = "CC04" As String ' Site ID

 


GTProdMgr Jun 17, 2021 09:38 PM

Declare the String data type on SiteID like this:

Public SiteID As String

Don't put "As String" on the Const declaration of SID, it is fine as it is - it will get interpreted as a string when it gets pushed into SiteID. Then sample out your value as a string (not FP2) in the table like this:

Sample (1,SiteID,String)

marissaadrianna83 Jun 18, 2021 10:40 AM

Declare Const as string and fix Sample datatype And this will help you

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