Campbell-scientific CR3000 Micrologger Manual de usuario Pagina 231

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 590
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 230
Section 7. Installation
231
'Declarations
Public rTime(9) As Long '(or Float)
Public rTime2(7) As Long '(or Float)
Dim x
DataTable(SecondTable,True,-1)
DataInterval(0,5,Sec,10)
Sample(1,rTime,NSEC)
Sample(1,rTime2,NSEC)
EndTable
'Program
BeginProg
Scan(1,Sec,0,0)
RealTime(rTime)
For x = 1 To 7
rTime2(x) = rTime(x)
Next
CallTable SecondTable
NextScan
EndProg
CRBasicExample46. NSEC—ConvertTimestamptoUniversalTime
'Application: the CR3000 needs to display Universal Time (UT) in human readable
'string forms. The CR3000 can calculate UT by adding the appropriate offset to a
'standard time stamp. Adding offsets requires the time stamp be converted to numeric
'form, the offset applied, then the new time be converted back to string forms.
'These are accomplished by,
'1) reading Public.TimeStamp into a LONG numeric variable.
'2) store it into a type NSEC datum in final data storage.
'3) sample it back into string form using the TableName.FieldName notation.
'Declarations
Public UTTime(3) As String * 30
Dim TimeLong As Long
Const UTC_Offset = -7 * 3600 '-7 hours offset (as seconds)
DataTable(TimeTable,true,1)
Sample(1,TimeLong,Nsec)
EndTable
'Program
BeginProg
Scan(1,Sec,0,0)
'1) read Public.TimeStamp into a LONG numeric variable.
TimeLong = Public.TimeStamp(1,1) + UTC_Offset
'2) store it into a type NSEC datum in Final Data Storage.
CallTable(TimeTable)
Vista de pagina 230
1 2 ... 226 227 228 229 230 231 232 233 234 235 236 ... 589 590

Comentarios a estos manuales

Sin comentarios