HP OpenVMS Systems

ask the wizard
Content starts here

Help with BASIC I/O, TN3270 and pseudo-terminals?

» close window

The Question is:

 
I am writing a communications process that has to drive a UCX TN3270
terminal session in a subprocess.  It has to capture the output and use the
info to drive an automated process.   I have found the Pseudo Terminal
driver, FTAx: device using the calls PT
D$create, read and write.   The control process is written in DEC Basic.
 
The PTD$ routines require that the IO buffers be page aligned and be in
contiguous pages, etc.  I create the pages using the sys$expreg call and use
the return address in the ptd$create and that returns ok.
 
How do I get my IO buffers in Basic to point to this newly created space?
Using MAP, Declare and/or Record statements in Basic?  See the OpenVMS I/O
User's Reference Manual, Appendix C.
 
I am stumped and/or my brain's memory block is swapped out and can't get
beyond this.
 
Or, alternatively, are there other Pseudo Terminal-like devices I could use
for the control function for the subprocess?  Mailboxes won't work because
the TN3270 driver has to see a VT-like device.
 
Thanks in advance.
 
Charlie
 
 


The Answer is :

 
  BASIC typically uses its own internal I/O buffer pool.
 
  If you wish to manage your own buffer pool, you will want to use
  operations that support the specification of your own buffers, and
  a programming language that makes use of pointers acceptably possible
  for your needs.  (BASIC does have the ability to work "by reference",
  but this can cause you some problems.)
 
  If you can recode the BASIC record buffers -- as differentiated from
  the internal I/O buffers -- to use a separate program section, you may
  well be able to achieve what you want by overmapping the BASIC record
  buffer section with your own buffer pool using the LINKER.  Also using
  the LINKER, you can specify page alignment -- pages on Alpha can be up
  to 64 kilobytes in size -- for the buffers based on the program section.
  (Though the Wizard is not at all certain that directly connecting the
  BASIC record structures to the pseudo-terminal transfers makes any
  sense -- the Wizard would tend to assume that the two record structures
  would differ and would thus require some sort of translation or the
  relocation of field(s) in the BASIC buffer into the field(s) in the
  pseudo-terminal buffer.)
 
  The Wizard would strongly recommend moving to a non-terminal based
  protocol for communications with the remote system -- the TN3270
  terminal interface is intended for user use, and not particularly
  for programmatic control.  You obviously have IP available, can you
  use a peer-to-peer or client-server IP protocol -- your own, or RPC
  or similar -- to control the remote communications?
 
 

answer written or last revised on ( 25-NOV-1998 )

» close window