owSearchX (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All devices with 1-Wire

Firmware version:

2.80 / 1.00.00


An advanced version of the owSearch function that allows detection of all 1-Wire devices on the bus which belong to the specified families.

 

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.

 

The list of known devices will be update when the following functions are called:

 owSearchX

 owSearch

 owiButtonGetID

 

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 will move one position down the list when a new search is carried out As the search function is intended for general 1-Wire use, a family number can be supplied when making the function call to optimize the search.

 

Current official list of Maxim 1-Wire family codes:


16#01

DS1990A, DS1990R, DS2401, DS2411.


16#02

DS1991.


16#04

DS1994, DS2404.


16#05

DS2405.


16#06

DS1993.


16#08

DS1992.


16#09

DS1982, DS2502.


16#0A

DS1995.


16#0B

DS1985, DS2505.


16#0C

DS1996.


16#0F

DS1986, DS2506.


16#10

DS1920.


16#12

DS2406, DS2407.


16#14

DS1971, DS2430A.


16#1A

DS1963L.


16#1C

DS28E04-100.


16#1D

DS2423.


16#1F

DS2409.


16#20

DS2450.


16#21

DS1921G, DS1921H, DS1921Z.


16#23

DS1973, DS2433.


16#24

DS1904, DS2415.


16#27

DS2417.


16#28

DS18B20.


16#29

DS2408.


16#2C

DS2890.


16#2D

DS1972.


16#37

DS1977.


16#3A

DS2413.


16#41

DS1922L, DS1922T, DS1923, DS2422.


16#42

DS28EA00.


16#43

DS28EC20.

 

To optimize the search time, only conduct a single search for all devices.

 

Input:

first        : INT [0..255] (default 0)

Skips devices with lower family codes.

 

last        : INT [0..255] (default 255)

Does not search for devices with higher family codes than this.

 

reset        : BOOL [TRUE, FALSE] (default TRUE)

Deletes all known devices before search.

 

Returns: INT

>= 0


Number of devices found within family range.

-1


General error or not supported on target.

 

Declaration:

FUNCTION owSearchX : INT;
VAR_INPUT
  first : INT := 16#00;
  last : INT := 16#FF;
  reset : BOOL := TRUE;
END_VAR;

 

 


Example:

 

Please see the "Examples - Generic OneWire Example"