owiButtonReadData (Function) |
Top Previous Next |
owiButtonReadData will read a block of data from a memory iButton previously written by the owiButtonWriteData function.
Before a read can be done, an owiButtonGetID must be completed.
When a read request is executed, the index and data size is verified against the following possible values:
If the iButton found by owiButtonGetID is not present at the time of reading, an "iButton not present" (-2) will be returned.
On a successful read operation, the number of bytes actually read from the iButton will be returned, which may be less than the requested size.
A "no data" (-5) will be returned if there is no data or the data found was not previously written by owiButtonWriteData function.
Note: partial data may be read in case of an unsuccessful read operation.
Input: index : INT(1..Max) Location number the data should be loaded from.
data : ADR Address of the memory block that receives the loaded data.
size : INT(0..Max) Maximum number of bytes to load into "ptr".
Returns: INT
Declaration: FUNCTION owiButtonReadData : INT;
Example: INCLUDE rtcu.inc |