ReadRecord()
Description
In order to use this function, library named <record_parser> must be included.
This function reads records from module internal memory records.
Syntax
ReadRecord(PARSE_RECORD, sensor_array[], arg);
Parameters
Variable | Input |
|---|---|
| This is command and stays always the same - PARSE_RECORD |
| User defined array into which data is going to be stored. Recommended initial array size is 1000 elements. |
| Array element number, from which to start to read |
Returns
Return value | Return explanation |
SCRIPT_OPERATION_SUCCESS | Success |
SCRIPT_OPERATION_FAILED | Failed |
SCRIPT_PARAM_INVALID | Passed array is too small. |
Function call example
Example of reading record
#include <record_parser>
new sensor_buffer[1000];
new tmp = 0;
main()
{
for(;;)
{
if(ReadRecord(PARSE_RECORD, sensor_buffer, 0) != 0) // Check if ReadRecord is not empty and store records into internal array of `sensor_buffer`
{
GetSensor(sensor_buffer, Sensor_Course, tmp); // Get sensor data into variable named `tmp` from array named `sensor_buffer`
}
Delay(1000);
}
}
Notes and Warnings
This function uses lots of memory, include library only if you're going to use this function.