ComRead() ![]()
Retrieves information from a serial device.
Syntax
ComRead([<cName>], [<nReceive>], [<cTerminator>], [<nTimeout>]) --> cReceiveString
Arguments
<cName> --> The optional name of the communications device to configure.
If
you intend to open more than one serial communications device then you must specify a communications device
name, e.g, "Weight Scale", "Cash Register", "Modem", "Serial Port 4",
etc., in order to allow CAPITAL to distinguish between them.
<nReceive> --> An optional number of characters to receive.
<cTerminator> --> The character code to optionally wait for, which will terminate the read process.
<nTimeOut> --> An optional number of seconds to wait before the reading process is considered complete. If not specified the default wait period is 5 seconds.
Returns
The result of the read process returned as a character string value.
Description
Reads information from a serial communications device.
You
must first set-up and open a communications device before you may write information to it, using the ComOpen()
or ComSetup()
functions.
Example
If ComOpen("My Device 1")
If ComWrite("My Device1 ", "Hello")
cResponse := ComRead("My Device")
Endif
ComClose("My Device")
Endif
____________________________
Related Topics:
Weight Scale Interfacing Example: Digi D770