
Take readings from the THUM using your
own programs
THUM OCX
THUM
ActiveX Control
The THUM OCX is an ActiveX control that allows custom applications to be
written that reads temperature, RH, and dew point measurements from the
THUM. This adds a great deal of flexibility to the
THUM. Temperature/RH
measurements can easily be taken and integrated into any ActiveX
compatible project or solution.
The THUM OCX can be used in programming environments such as Visual
Basic, Visual C, Delphi, VB script, VBA, etc.
Note: msvbvm60.dll is required for this OCX
The OCX is very easy to use. Install
the ocx on the development computer using the installation program.
Add the control to your project and use some simple code to acquire the
readings.
Methods
THUMocx1.Read - tells THUM to make a
reading
Properties
THUMocx1.Unit - sets or returns the
current unit of temperature and dew point readings read/write - valid
values F and C
THUMocx1.Temp - returns last
temperature reading - read only THUMocx1.RH
- returns last RH reading - read only
THUMocx1.DewPt - returns last Dew
point reading - read only
Note: Readings can not be taken from the THUM faster than one
reading every 3 seconds. Taking readings faster than this could raise
the internal temperature of the sensor. This could skew the temperature
and RH readings returned from the THUM.
License:
We require that you purchase one copy of a control per developer on a
project. If this is met, you may distribute the control with your
application royalty free. You may never distribute the license file or
installation program for the license file.
Sample Visual Basic code to read values from the THUM
‘Add a THUMOCX control to a form and name it THUMocx1
'Reads from THUM and returns temp and dew point values in °C
Dim returnvalue As Integer
Dim msg1 As String
'set Temperature/Dew point Unit
'Valid values are "F" or "C"
'if a non valid value is sent to the control the control will reset the
Unit to "F"
THUMocx1.Unit = "C"
'tell THUM to take a reading
returnvalue = THUMocx1.Read
'Check to see if reading was successful
If returnvalue = 1 Then
'successful read
Else
'failed read
msg1 = "Temp Humidity Sensor was not found." & Chr(10) & "Please
verifiy it is plugged into a USB port."
Call MsgBox(msg1, vbExclamation, App.Title)
Exit Sub
End If
'display values from last reading in labels
lblTemp.Caption = THUMocx1.Temp
lblRH.Caption = THUMocx1.RH
lblDewpt.Caption = THUMocx1.DewPt
Start monitoring your environment with your own programs
Secure Server Purchase
