serial_readarray()
Reads data trough serial COM port and saves it to array.
Syntax
serial_readarray(port, hnd, size, timeout);
Parameters
| port | COM port name. Use string type, e.g. “COM10”. | |
| hnd | Array handle | |
| size | Data size limit to be read. Special values are: | (optional) |
| 0 - no limit in data size | |
| 256 - Max value of limit | |
| timeout | Timeout value in milliseconds. After time is elapsed, COM port will not read any incoming data. | (optional) |
| Return Value | Return value is data size. Returned value is integer number. | |
Example
hnd = array_new();
result = serial_readarray("COM10", hnd);
array_printdata(hnd);
array_delete(hnd);
result:
5; 0x11,0x22,0x33,0x44,0x55
See also