owTempGet (Function) |
Top Previous Next |
owTempGet returns the temperature of a specific 1-Wire temperature sensor. After the owSearch function has been carried out, the temperature of each device on the bus can be read. Place the number (between 1 and the number returned by the owSearch function) specifying which temperature sensor is to be read.
The function reads the temperature of the device and returns the temperature in 0.01°C multiplied with 100 - this means that 22.50 degrees will be returned as 2250 and -17.00 degrees will be returned as –1700.
The temperature sensors retrieve its power directly from the 1-Wire bus. This is called parasitic power and no external power is needed for remote temperature sensing. A temperature conversion takes approximately 0.8 -> 1.0 seconds in this mode. This is due to the power needed for a temperature conversion when operating in parasitic power mode.
Input: Device : SINT
Returns: DINT The current temperature - coded as Degrees * 100 + Decimal degrees. Example: a temperature of 22.76 Degrees is returned as 2276. -9999 - General error.
Declaration: FUNCTION owTempGet : DINT;
Example: INCLUDE rtcu.inc |