The Themochron library adds data structures, data formatting and converting functions, and application specific functions to the library. This library documentation references terminology and data published in Dallas Semiconductor documentation of the Thermochron iButton. For clarity, it is assumed that the reader has access to this Dallas Semiconductor documentation.
The MissionStatusFlagType structure is convenient for holding the bit-level status of a mission read from a thermochron button.
The MissionTimeAlarmFlagType structure is convenient for holding bit-level setup parameters for a mission.
The function allocates a handle of 96 bytes and initializes this memory to zero prior to attempting to read the button alarm data. If the attempt to read the button fails or if no alarm data has been recorded, the memory in the returned handle will remain zero. In this case, the reason that the handle is zero can not be uniquely determined. For example, the button may not be attached to the probe or a mission may not have been started. If all data is returned as zero, read mission parameters such as status, sample rate or start time to determine a cause.
The function allocates a handle of 128 bytes and initializes this memory to zero prior to attempting to read the button histogram data. If the attempt to read the button fails or if no histogram data has been recorded, the memory in the returned handle will remain zero. If this is the case, the reason that the handle is zero can not be uniquely determined. For example, the button may not be attached to the probe or a mission may not have been started. If all data is returned as zero, read mission parameters such as status, sample rate or start date to determine a cause.
The function allocates a handle of 2048 bytes and initializes this memory to zero prior to attempting to read the button temperature data. If the attempt to read the button fails or if no temperature data has been recorded, the memory in the returned handle will remain zero. If this is the case, the reason that the handle is zero can not be uniquely determined. For example, the button may not be attached to the probe or a mission may not have been started. If all data is returned as zero, read mission parameters such as status, sample rate or start time to determine a cause.
The Thermochron button stores only one byte for each parameter. The function will return the binary byte (0-255) representation of the temperature alarm as stored in the button. The high order byte of the SWord variables will be set to zero.
Data Representation: In the thermochron button, temperature data is represented by a single byte binary integer. It is dimensionless. Temperature is related to engineering units by the following equations:
The two-byte start delay variable allows a range of 0-65,395 minutes. Only the least significant byte of the sample rate variable will be read, allowing a variable range of 1-255.
Note that if the mission is started with a non-zero start delay parameter, sampling will not begin until the delay in minutes has expired. The start delay variable will "count-down" to start. Reading the start delay variable with this function in real time will report the time remaining until mission start. Once the mission has started, the start delay variable will be zero.
The two-byte start delay variable allows a range of 0-65,395 minutes. Only the least significant byte of the sample rate variable will be written, allowing a variable range of 1-255. (If the sample rate variable is zero, the Thermochron manager will write this value, but it will not be a legitimate value for the button. Any data in the high order bytes of the Sample rate variable will be ignored.
While the name of this function implies that the mission will be started, that may not necessarily be the case. By design, a mission starts only after a defined start delay, and in the case where start delay is specified as zero, only on a minute-transition of the thermochron's real-time clock. To insure that the mission is indeed started, read the mission status byte or mission info after the specified start delay +1 minute.
Structure of a Mission
The MissionInfoType structure contains parameters necessary to setup and start a mission.
Thermochron Functions
The following calls can be used to manipulate mission objects.
TcrGetAlarmData
TcrGetControlSelection
TcrGetDateTime
TcrGetHistogramData
TcrGetMissionDeviceCount
TcrGetMissionSampleCount
TcrGetStartTime
TcrGetTempData
TcrGetTempSetpoints
TcrGetTimeRateSettings
TcrMissionControlAlarmsToFlags
TcrMissionStatusToFlags
TcrMissionTimeAlarmFlagsToControl
TcrReadMissionStatus
TcrReadMissionInfo
TcrSetDateTime
TcrSetTempSetpoints
TcrSetTimeRateSettings
TcrStartMission