HPlogo Asynchronous Serial Communications Programmer's Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 Intrinsics Reference

FCONTROL(4)

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Parameters

controlcode

4 — Sets a read timeout value for the next read.

param

16-bit unsigned integer by reference (required)

Passes a timeout value (in seconds) to the device that owns the file whose file number is specified in filenum.

Notes

A call to FCONTROL with a controlcode value of 4 allows you to set a time limit on the next read from a terminal. The timeout value is specified in seconds, with a maximum value of 65535.

Any read that does not complete before the time limit expires is transferred to the user buffer and the read length is returned. A condition code of CCL is returned to the calling program. A call to FCHECK after the timeout returns Error code 22, Software Timeout.

If you are setting a timeout value for a read posted against a device connected through a PAD, DTC Telnet, or Telnet/iX, you should take care to add enough time to compensate for any time delays that might be caused by the network.

A timeout value should be used any time your program is reading from an unattended device, to prevent "hangs" that might occur if the device is not ready or a problem exists with the device or its connection to the system. You can also use a timeout value to terminate binary reads. Refer to the discussion of FCONTROL(26,27) for more information on terminating reads in binary mode.

The timeout value is in effect only for the next read from the terminal, and must therefore be reissued for each read. A timeout value of 0 cancels the timeout.

During block mode reads the timer halts when the DC2 character is received. At this point, the block mode read timer is activated by the system. The block mode read timer is set by the system software, and its values are not user changeable.

Condition Codes

CCE

Request granted.

CCG

Not returned by this intrinsic.

CCL

Failed; timeout value not accepted.

Additional Discussion

See also FCONTROL(26,27) in this manual.

Feedback to webmaster