owSearch (Function) |
Top Previous Next |
Each 1-wire device has a unique ROM-number like the iButton. This number is used to point out one specific device of many devices on the bus. Before any devices can be accessed, the ROM-number has to be discovered. By using the 1-Wire search function, all devices on the 1-Wire bus are discovered and the ROM-numbers are stored in a temporary list placed inside the RTCU device. When the device is powered off, the list is erased and a new search has to be performed on power on. The devices are sorted in the order they are discovered on the 1-Wire net. If a device is removed from the bus, all devices after this one will move one position down the list when a new search is carried out. As the search function is generally intended for 1-Wire use, a family number has to be supplied when making the function call. For 1-Wire temperature devices, the family number is 1.
owSearch returns the number of family-specified devices found on the 1-Wire bus. This function is essential in order to access the 1-Wire devices on the 1-Wire bus (except the iButton). Call the function at least at device power-on.
Please consult the Logic IO 1-Wire basics application note for information on 1-Wire devices.
Input: family : SINT The family of 1-Wire devices to search for. 1 = Temperature sensors (current only family code 16#28 as maxim's DS18B20).
Returns: INT
Declaration: FUNCTION owSearch : INT;
Example: INCLUDE rtcu.inc |