Asynchronous Serial Communications Programmer's Reference Manual (32022-90052)
Chapter 3 59
Common Device Control Functions
Opening Asynchronous Devicefiles
NOTE
The ccode function used in the examples is a Pascal/iX intrinsic
function that returns the condition code bits from the status register. If
you are using a language other than Pascal/iX, you should see the
reference manual for that language for information on how to access
the condition code bits.
After the FOPEN calls are successfully executed, the variable
fileid_in
will contain the file number of a file that can be read from,
and the variable
fileid_out
will contain the file number of a file that
can be written to.
It is possible to issue a single FOPEN call that will allow you to read
and write from a single file. However, to do so you must include some
additional parameters in the FOPEN call. You must specify a formal
file designator in the formaldesignator parameter of the FOPEN call
(HPFOPEN item number 2) instead of using one of the system defined
files ($STDIN, $STDINX or $STDLIST). You must also specify the logical
device number of the terminal device in the device parameter
(HPFOPEN item number 20). You can use the WHO intrinsic to
determine the logical device numbers of the devices being used as the
input and output devices for the current job or session.