The Real Time Clock
The dataTaker real time clock keeps the Day Number or Date in three formats, and the Time of day in three formats. The real time clock is used for triggering Schedules, for date and time stamping data acquisition, Alarms, System Timers, and for other system timing functions.
The formats for date and time described below only apply if the Free Format data mode selected (/h).
The day can be returned as the Day Number or Date in one of three formats. The format is specified by the Parameter31 command as follows
P31=0 selects the Day Number format, for example Day 5316
This is the default date format for 50 Hz line frequency operation, as determined by the line frequency setting of the DIP switch.
P31=2 selects the MM/DD/YYYY format, for example Date 07/23/2003
This is the default date format for 60 Hz line frequency operation, as determined by the line frequency setting of the DIP switch.
The Time of day can be returned in one of three formats, which is specified by the Parameter39 command as follows
P39=0 (default) selects the hh:mm:ss format, for example Time 15:30:45
The character used to separate the hours, minutes and seconds can be defined as any ASCII character by the Parameter40 command. The default is ASCII 58 (:)
P39=1 selects the seconds from midnight format, for example Time 23465 Secs
The dataTaker also has a Decimal Day format for time, which is a decimal value for which the whole number is the day number, and the fraction is the time of day expressed as a fraction of a day.
The Decimal Day is returned by reading the System Variable 12 by the command
which returns the decimal day as follows
If the global maximum number of significant digits is increased to say 7 using the Parameter32=7 command, then greater resolution for the fraction of the day can be obtained as follows
Reading 12SV(FF0) returns the day number only.
Setting the Day or Date
The Day Number or Date is set in the format which is defined by the current setting of the Parameter31 command as follows
If P31=0 then the Day Number is set by the command
If P31=1 then the Date is set by the command
If P31=2 then the Date is set by the command
ddddd is the day number in the range 0 ñ 49,700
In the dataTaker the Date is referenced from 1/1/1989, which is equivalent to Day Number 0.
Using DeTransfer, the day number or date are set in the different formats by the commands for example
DeTransfer also has a special command for setting the date of the dataTaker
which sets the date according to the clock of the host computer. Note : The Date format for the dataTaker must be the same as the Date format set in the Regional Options applet of the Windows Control Panel.
There is no requirement to set the date format in DeLogger ñ DeLogger handles this automatically. The dataTaker date is set by selecting Set Date/Time on the dataTaker menu, or by clicking the Set Date and Time toolbar button.
Setting the Time
The Time is set in the format which is defined by the current setting of the Parameter39 and Parameter40 commands as follows
If Parameter39=0 then Time is set in the hh mm ss format, using the separator defined by Parameter40
There are a number of variations to this time set command as follows
T=hh sets clock to hh:00:00
hh is the hours
Using DeTransfer, the Time is set in hh:mm:ss format by the commands for example
DeTransfer also has a special command for setting the time of the dataTaker
which sets the time according to the clock of the host computer. Note : The Time format for the dataTaker must be set to HH:MM:SS to match the Windows time format.
If Parameter39=1 then Time must be set in seconds from midnight by the command
sssss is the number of seconds, 0 ñ 86,400
Using DeTransfer, the Time is set in seconds format by the commands for example
If Parameter39=2 then Time must be set in decimal hours by the command
hh.hhhhh is the time in decimal hours, 0.000277 hours = 1 second
Using DeTransfer, the Time is set in decimal hours format by the commands for example
There is no requirement to set the time format in DeLogger ñ DeLogger handles this automatically. The dataTaker time is set by selecting Set Date/Time on the dataTaker menu, or by clicking the Set Date and Time toolbar button.
Reading The Real Time Clock
The Day Number or Date and the Time 'channels' of the real time clock are treated in the same manner as other input channels. The date and the time of scanning input channels can be returned with the scan data by including the Day or Date and the Time channels in the schedule lists.
The Day or Date and the Time are specified by the identifiers
Day Number or Date
Using DeTransfer, the date and time of scanning input channels are included with the input channel data by the commands for example
which returns the Day Number or Date and Time at which each scan with the input channel data.
The date and time information is actually formatted by the dataTaker as these are transmitted to the host computer. Therefore if you are using DeTransfer, the format of date and time in logged data can be changed after data collection, before the logged data is returned to the computer.
Using DeLogger, the date and time of scanning input channels is included in the returned data by including the Date and Time channels in the program in the Program Builder as follows
Automatic Date and Time Recording
The dataTaker automatically records the date and time that Schedules are run to scan input channels, perform calculations, etc, even if the original Schedule does not include the D and T channels.
The return of this automatically recorded date with the logged or real time data is determined by the Date Switch command as follows
/D Enable return of automatically recorded date
The Date Switch defaults to /d when the dataTaker is powered up, hardware reset or executes a RESET command.
The return of this automatically recorded time with the logged or real time data is determined by the Time Switch command as follows
/T Enable return of automatically recorded time
The Time Switch defaults to /t when the dataTaker is powered up, hardware reset or executes a RESET command.
When the Date Switch and the Time Switch are enabled, then the date and time of data acquisition is returned at the start of the data block for each Schedule in the program. If date and time channels are included explicitly in the schedule lists, and the Date and Time Switches disabled (/d /t), then the date and time are returned in the position that they were placed in the schedule list relative to other channels.
DeLogger does not use the Date and Time Switches ñ DeLogger uses the Fixed Format mode for all data, which includes date and time stamps.
Assigning Date and Time to Channel Variables
The date and time can be assigned to Channel Variables whenever the real time clock is read in Schedules, and used in calculations, as test inputs and setpoints for alarms, etc.
The Day Number, Date and Time are assigned to Channel Variables by specifying the Channel Variable as a channel option, in the same manner as assigning data from input channels to Channel Variables (see Section III ñ Channel Variables and Calculations).
Using DeTransfer, assigning the date and time to Channel Variables is illustrated by the following examples
Irrespective of the current formats defined for date and time, the assignment of these to channel variables is fixed as follows
date is assigned as the number of days since 01/01/1989, which is day number 0
time is assigned as the number of seconds since last midnight
When these are read and assigned to a Channel Variable, the date and/or time is also returned to the host in the current format. This can be disabled by including the W or NR channel options in the command as follows
Using DeLogger, the date and time can be assigned to Channel Variables in the Program Builder as follows
Date and Time in Alarms
The date and time can also be used in Alarms (see Section III ñ Alarms) to test for the arrival of a particular date or particular time. The date or time 'channel' are used as an input channel for an alarm, and are tested against setpoints.
The date setpoints must be entered in the format currently defined by Parameter31, and the time setpoints must be entered in the format currently defined by Parameter39 and Parameter40.
Using DeTransfer, alarms which test for a date or time are entered by the commands for example
ALARM1(D>28/07/2003)"Tomorrow becomes today"
In the first example the alarm will become true at midnight, and remain true for the duration of the date.
In the second example the alarm will become true at 10:30:00, and remain true until16:30:00, each day.