Technical Information

Application Development Manual | Sending data

Sending data


Write data to the communications device file for sending.


Detailed Description

The PRINT# statement writes the specified data to the communications device file for transmission--a command to a printer, for example.

Adding a semicolon to the PRINT statement suppresses the automatic carriage return normally added to the output.

Output control Output character

Suppress the automatic carriage return.

Program Output
PRINT #1, "ABC";"123"; ABC123

Add CR-LF pair.

Program Output
PRINT #1, "ABC123" ABC123 [CR] [LF]

Set fileno to the value specified when opening the communications device file.


Send the sequence "123456789", CR, LF via the CU

  open "COM1:115200" as #1
print #1, "1234567890"
close #1

Send the sequence ESC (1Bh), "M", LF (0Ah), NUL (00h) via the connector

  const ESC = chr$(&h1B)       ' define control codes
const LF  = chr$(&h0A)
const NUL = chr$(&h00)
open "COM2:115200" as #1
print #1, ESC;"M";LF;NUL;
close #1

Contact us