.peekdata Method
Function: |
For the selected serial port (selection is made through ser.num), returns the string that contains the "preview" of the data from the RX buffer. The data is NOT deleted from the buffer. |
Syntax: |
ser.peekdata(maxinplen as word) as string |
Returns: |
String containing data from the RX buffer |
See Also: |
Part |
Description |
maxinplen |
Maximum amount of data to preview (word). |
Details
The length of the received data is limited by one of the three factors (whichever is smaller): the amount of data in the RX buffer itself, the capacity of the "receiving" string variable, and the limit set by the maxinplen argument.
String variables can hold up to 255 bytes of data, so this method will only allow you to preview up to 255 "next" bytes from the RX buffer.
In the UART mode (ser.mode = 0 — PL_SER_MODE_UART), the data is received "as is." For the Wiegand and clock/data mode (ser.mode = 1 — PL_SER_MODE_WIEGAND and ser.mode = 2 — PL_SER_MODE_CLOCKDATA), each data character represents one data bit and only the "0" and "1" characters are possible.