readdata


Usage

>> readdata [ dataset | size | offset ]

Security

Open.

Description

This command allows to read data from the datasets.

  1. dataset [= <index>], <index> is the dataset index to be read.
  2. size [= <value>], <value> is the amount of data to be read, if not set, readdata will use the last size used.
  3. offset [= <value>], <value> is the dataset index to be read, if not set, readdata will use the offset corresponding the offset of the last byte read +1.

The command replies as any other command by confirming the key values pairs dataset, size and offset effectively reported followed by a <CR><LF>. Then send a binary stream composed of:

  1. <data> is the actual binary data, delimited at the start by the <CR><LF> and bounded in length by size parameter returned.
  2. <crc> is a 16-bit CRC using the CCITT polynomial f(x) = x^16 + x^12 + x^5 + 1, feeding bytes into the generator LSB first and using 0xFFFF as a seed value. If the bytes of the computed <crc> are swapped and appended to the data, the host can include them in its CRC-check as an extra two bytes: if the CRC is correct, this always gives a result of zero.


No acknowledge mechanism is implemented; failed transfers can simply be requested again. 

For the Standard data storage format, the dataset number is always 1; all deployment information is stored in a single dataset. 
For the EasyParse format, the three major components of deployment data are each assigned a dataset as follows:

  1. the deployment header is in dataset 2,
  2. the sample data is in dataset 1, and
  3. events are in dataset 0.

The readdata command knows nothing of the structure of the retrieved data in any of these cases, it is simply transferring a block of bytes of unknown content. 
Internally, requests for very large amounts of data in a single instance of the readdata command are broken down into smaller blocks. Such a transfer could take a considerable time, and if necessary it may be aborted by sending the pseudo-command abort, followed by a <cr> character. The transfer then stops at the next internal block boundary, and terminates with the message operation aborted

Examples

>> readdata dataset = 1, size = 1000, offset=0
<< readdata dataset = 1, size = 1000, offset = 0<cr><lf><bytes[0..999]-of-data><crc>
>> readdata dataset = 1, size = 1000, offset = 1000
<< readdata dataset = 1, size = 1000, offset = 1000<cr><lf><bytes[1000..1999]-of-data><crc>
>> readdata dataset = 1, size = 1000, offset = 2000
<< readdata dataset = 1, size = 12, offset = 2000<cr><lf><bytes[2000..2011]-of-data><crc>

Errors

Error E0108 invalid argument to command: '<invalid-argument>' 
The supplied argument was not recognized.