Realtime – Campbell Scientific CR5000 Measurement and Control Module User Manual
Page 195

Section 8. Processing and Math Instructions
8-23
RealTime
Used to pick out year, month, day, hour, minute, second, usecond, day of
week, and/or day of year from the CR5000 clock.
Syntax
RealTime(Dest)
Remarks
RealTime Example
This example uses RealTime to place all time segments in the Destination array. If
the remark (‘) is removed from the first 8 Sample statements and the last Sample
statement is remarked, the results will be exactly the same.
Public rTime(9)
'declare as public and dimension rTime to 9
Alias rTime(1) = Year
'assign the alias Year to rTime(1)
Alias rTime(2) = Month
'assign the alias Month to rTime(2)
Alias rTime(3) = Day
'assign the alias Day to rTime(3)
Alias rTime(4) = Hour
'assign the alias Hour to rTime(4)
Alias rTime(5) = Minute
'assign the alias Minute to rTime(5)
Alias rTime(6) = Second
'assign the alias Second to rTime(6)
Alias rTime(7) = uSecond
'assign the alias uSecond to rTime(7)
Alias rTime(8) = WeekDay
'assign the alias WeekDay to rTime(8)
Alias rTime(9) = Day_of_Year
'assign the alias Day_of_Year to rTime(9)
DataTable (VALUES, 1, 100)
'set up data table
DataInterval(0, 1, mSec, 0)
'set up data table
' Sample(1, Year, IEEE4)
'place Year in VALUES table
' Sample(1, Month, IEEE4)
'place Month in VALUES table
' Sample(1, Day, IEEE4)
'place Day in VALUES table
' Sample(1, Hour, IEEE4)
'place Hour in VALUES table
' Sample(1, Minute, IEEE4)
'place Minute in VALUES table
' Sample(1, Second, IEEE4)
'place Second in VALUES table
' Sample(1, uSecond, IEEE4)
'place uSecond in VALUES table
' Sample(1, WeekDay, IEEE4)
'place WeekDay in VALUES table
' Sample(1, Day_of_Year, IEEE4)
'place Day_of_Year in VALUES table
Sample(9, rTime(), IEEE4)
'place all 9 segments in VALUES table
EndTable
BeginProg
Scan (1, mSec, 0, 0)
RealTime(rTime())
CallTable VALUES
Next Scan
EndProg