RFAUXPORT.QueryPort

BSTR QueryPort(short nPort, short cStart, short cEnd, short nMaxLength, short nTimeout, BSTR pszRequest)

Function QueryPort(nPort As Integer, cStart As Integer, cEnd As Integer, nMaxLength As Integer, nTimeout As Integer, pszRequest As String) As String

Return value
The data received from serial port.

Parameters

nPort 
    WLCOM1, WLCOM2.

cStart 
    Start character for received data, or 0 (WLNOCHAR).
    Or WLNOCHAR constant to start with any character.

cEnd
    Stop character to terminate the data reception, or 0 (WLNOCHAR).
    Or WLNOCHAR constant not to stop with a specific character.

nMaxLength
    Maximum length for received data. If reached, function returns.
    Or WLNOMAXLENGTH constant not to limit the input length (system limitations).

nTimeout
    Maximum time in seconds for waiting for received data. If reached, function returns.
    Or WLWAITFOREVER constant not to limit the input time-out (battery life limits...).
Zero means that function doesn't wait for received data.

pszRequest
    Data to send before receiving, may be empty.

Remarks
Check for errors before using the returned value. Configure the port before calling this function.

Example
bResult = wsRfAuxPort.ConfigurePort(WLCOM1, BAUD9600, DATABITS8, STOPBITS1, PARITYNONE, NOFLOWCTL)
sBuff = wsRfAuxPort.QueryPort(WLCOM1, WLNOCHAR, 13, 100, 30, "Hit Enter")
Sends "Hit Enter", and waits (30 seconds tops) for data (100 characters tops) from COM1:, starting with any character, and ending with CR (0Dh).

See also    RFAUXPORT, ConfigurePort