ADwin-Gold II
, Manual February 2013
197
Storage media (TiCoBasic)
Media_Read
ADwin
Media_Read
Media_Read
copies blocks of values from the memory card of
ADwin-Gold II
into an array.
Syntax
#Include
GoldIITiCo.inc
ret_val
=
Media_Read
(
start_block
,
count
_
blocks128
,
dest_array
[],
array
_
start_index
)
Parameters
Notes
Before using
Media_Read
, the array
media_datatable
[]
must be
initialized with
Media_Init
. The instruction
Media_Init
is only avail-
able in
ADbasic
, but not in
TiCoBasic
.
The execution time of
Media_Read
is quite long; therefore we recom-
mend to use it in a process with low priority.
The data transfer speed per data block increases with the number of
transferred data blocks.
The array
dest_array
[]
must be dimensioned with at least
count_
blocks128
× 128 elements.
See also
Valid for
Gold II-Storage-16
Example
- / -
TiCo
s t a r t _
block
Index (1…m) of the first data block on the memory
card which is to be read.
LONG
c o u n t _
blocks128
Number (1…m) of data blocks to be read. A data
blocks contains 128 values of 32 bit.
LONG
d e s t _
array
[]
Array where data is written to.
ARRAY
LONG
a r r a y _
s t a r t _
index
Index (1…n) of the first array element to be trans-
ferred.
LONG
ret_val
Status of data transfer:
= 0: The memory card has been completely
erased.
> 0: An error has occurred. Set Bits in
ret_val
refer to the error cause, see table.
LONG
Bit no.
Meaning
00
Bit = 1: Memory card does not reply.
01
Bit = 1: Timeout.
02:32
Bits may be set but cannot be used here.