SerWait
(Engine-Level Function)
Description: | Serial Port Wait. This function returns true when the receive buffer is a specified length. |
Returns: | Boolean |
Usage: | Steady State only. |
Related to: | COMPort | SerCheck | SerIn | StrLen | SerOut | SerRcv | SerRTS | SerSend | SerStrEsc | SerString | GetStreamLength |
Format: | SerWait(Port, Count) |
Function Groups: | Serial Port |
Parameters: |
Port |
Required. Any numeric expression for the serial port number (opened with a ComPort function) or any stream value. |
Count |
Required. Any numeric expression, which gives the number of bytes to wait for. Value must be in the range 0 to 65500. |
Comments: |
The return value is true when at least Count or more bytes have been received from Port. This is treated as a high priority function, and anything using the return value of SerWait will be executed as soon as Count or more bytes are received from Port. |
Example:
If SerWait(3, 16); [ recBuff = SerRcv(3, 16); ]
This action trigger will be true when 16 or more bytes are in the receive buffer from port 3, at which point the script will execute and the bytes in the receive buffer will be read into the buffer called recBuff.