COMM SEND statement

Purpose

Send a string of binary data through a serial port.

Syntax

COMM SEND [#] hComm, string_expression

Remarks

Places a copy of the data in string_expression into the transmit buffer to be sent to the serial port.  The data is appended to any data that may already be waiting in the transmit buffer.  If string_expression is empty, no data is added to the transmit buffer.

The data is sent without trailing CR/LF ($CRLF or CHR$(13,10)) bytes appended to the data.  If you are sending lines of text, you can either append CR ($CR or CHR$(13)) and/or LF ($LF or CHR$(10)) bytes to the text, or use the COMM PRINT statement instead.

The Number symbol (#) prefix is optional, but recommended for the purposes of clarity.

Restrictions

It is not always appropriate to use fixed length strings in string_expression, as the entire length of the string is added to the transmit buffer.  Do not use ASCIIZ strings for binary data as any embedded CHR$(0) characters will be misunderstood as indicating the end of the string.

See also

Serial CommunicationsCOMM CLOSE, COMM functionCOMM LINE, COMM OPEN, COMM PRINT, COMM RECV, COMM RESET, COMM SET

Example

A$ = "ATDT1,555-1234;"

COMM SEND #hComm, a$