LINEOUT        Write one or more characters to COM port

Top  Previous  Next

Syntax:

LINELINEOUT

[ msg ]  [ /options ]

Alt Syntax:

SENDCMD

[ msg ]  [ /options ]

Arguments:

[ msg ]

Variable or string defining the characters to write to the COM port

Options:

/binchr=xx

Specify a binary (decimal) character, usually unprintable, to send; not permitted with SENDCMD syntax

 

/flush

Flush the receive buffer before writing characters to the Port and then flush the receive buffer of characters echoed back after the write completes

 

/termchr=lf

Terminate the string by writing a line-feed; this changes the default of a carriage-return terminating character; not permitted with SENDCMD syntax

 

/termchr=none

Do not write either a line-feed or carriage-return as a terminating character; not permitted with SENDCMD syntax

 

/timeout=xx

Time-out in seconds to wait for the receive buffer to be flushed (if /flush is specified) and/or for a character to be written; the default time-out is 30 seconds

 

 

This script command writes characters to an open COM port. By default LINEOUT terminates a string by writing a carriage-return character. You may alter this behavior by using either the /termchr=lf or /termchr=none options when using the LINEOUT syntax.

 

The /binchr=xx option may be used to send an unprintable (binary) character either appended to the end of the [ msg ] string or by itself. The xx must be a decimal value between 0 and 255. The binary character is sandwiched between the end of [ msg ] string (if present) and before the terminating character. To send the binary character by itself, the [ msg ] string should be empty and /termchr=none is specified.

 

The /flush option performs two functions. First, it flushes the receive buffer of spurious characters that may already be present before the write begins. Also, it flushes any characters from the receive buffer that may be echoed back during the write after the write completes successfully. Under certain conditions, you may want to enable this option to insure that a subsequent LINEIN command reads any response that may be received from the remote system rather than spurious or echoed characters to what was just written.

 

Consider the following examples.

 

;; write a carriage-return terminated string

LINEOUT "output string"

;; write a line-feed terminated string

SET string = "write this string"

LINEOUT string /termchr=lf /timeout=10

;; send Ctrl-C (hex 0x03) to the remote system

LINEOUT "" /termchr=none /binchr=3

 

This command is also used when sending script commands to be executed by FileLink running on a remote system. In this case you may want to use the alternate SENDCMD syntax to make your script files more readable. Consider the following example.

 

;; request a specific file be sent from remote system

SENDCMD "SENDFILE ’specificfile’"

;; this command could also be written a’s

SENDCMD ’SENDFILE "specificfile"’

Note

You must use single quotation marks when embedding a script command within an alpha-numeric string argument bracketed by double quotation marks and vice versa.

 

;; either of the following cause an invalid command error

SENDCMD "SENDFILE "specific file""

SENDCMD ’SENDFILE ’specific file’’

 

Related Command(s): FLUSH, LINEIN, READFILE, WRITEFILE, SENDCMD, REMOTECMD