Storage media (ADbasic)
Media_Read
ADwin
192
ADwin-Gold II
, Manual February 2013
Media_Read
Media_Read
copies blocks of values from the memory card of
ADwin-Gold II
into an array.
Syntax
#Include
ADwinGoldII.inc
ret_val
=
Media_Read
(
media_datatable
[],
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
available in
ADbasic
, but not in
TiCoBasic
.
Media_Read
should only be used in low priority process section:
•
anywhere in a low priority process
•
in the sections
LowInit
or
Finish
of a high priority process
If used in a high priority process only a small number of data blocks may
be transferred. Otherwise the communication between PC and
ADwin
system would be stopped too long, and would therefore lead to an error
message (timeout).
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.
T11
m e d i a _
datatable
[
]
Array containig data for the operation of the
memory card, see
Media_Init
.
ARRAY
LONG
s t a r t _
block
Index (0…
m
-1) of the first data block on the
memory card which is to be read.
m
is the return value of
Media_Init
.
LONG
c o u n t _
blocks128
Number (1…
m
-1) of data blocks to be read. A data
blocks contains 128 values of 32 bit.
m
is the return value of
Media_Init
.
LONG
d e s t _
array
[]
Array where data is written to.
Both data types Long or Float are allowed.
ARRAY
LONG
FLOAT
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 data have been read successfully.
> 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.