OPENSER

OPENSER statement is used to handle the Serial IO.

Serial IO to the COM ports on NT and to device files, achieves this on UNIX by using the sequential file statements. In addition, you can perform certain control operations using the IOCTL function.

COMMAND SYNTAX

    OPENSER Path,DevInfo | PIPE TO FileVar THEN | ELSE Statements

SYNTAX ELEMENTS

Path is the pathname of the required device.

DevInfo consists of the following:

Baudbaud rate required
FlowyX-ON X-OFF flow control (default)
nno flow control
iinput flow control
ooutput flow control
ParityyX-ON X-OFF flow control (default)
nno flow control
iinput flow control
ooutput flow control

PIPE specifies the file is to be opened to a PIPE for reading.

NOTES

The PIPE functionality allows a process to open a PIPE, once opened then the process can execute a command via the WRITESEQ/SEND statement and then received the result back via the GET/READSEQ statements.

EXAMPLES

       FileName = "/dev/pts/1"
       OPENSER FileName TO File ELSE STOP 201, FileName
       WRITESEQ "ls -l" TO File ELSE NULL
       LOOP
          Terminator = CHAR(10)
          WaitTime = 4
          GET Input SETTING Count FROM File UNTIL Terminator RETURNING TermChar \
                WAITING WaitTime THEN
             CRT "Get Ok, Input " :Input: " Count " :Count: "TermChar" :TermChar
          END ELSE
             CRT "Get Timed out Input " :Input: " Count " : Count: " TermChar" \
                :TermChar
          END
       WHILE Input NE "" DO
       REPEAT
Last update: Sat, 16 Jul 2022 15:34