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

FCONTROL

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Performs control operations on a file or a device.

Syntax

          I16V    I16V      *
FCONTROL(filenum,controlcode,param);

Use

The FCONTROL intrinsic performs various control operations on a file or on the device on which the file resides. It applies to files on disk and tape as well as to files on terminals and printers. The controlcode parameter determines the action taken by the FCONTROL call.

The following pages describe the use of the FCONTROL intrinsic for control of asynchronous devices. Chapters 3 and 4 also include discussions on FCONTROL. For a complete explanation of FCONTROL functions for disk and tape files, refer to the MPE/iX Intrinsics Reference Manual.

The characteristics that define the relationship between a specific asynchronous device and the MPE/iX system are initially set through system configuration or through the configured terminal or printer type of the device. When you issue calls to most of the FCONTROL functions, you are temporarily changing the operating characteristics of the device on which the file (specified in filenum) resides.

An exception to this applies to calls to FCONTROL using controlcode 25 through 29. These calls affect only the file specified in the filenum parameter of the call. They do not affect the operating characteristics of the device itself or any other files that might be opened against the same device.

You will generally need to issue several calls to FCONTROL, each specifying an appropriate controlcode, to set up the combination of device characteristics that your program requires. However, for most controlcode values, you only need to issue one call for a specific characteristic to be in effect for all files opened against a device. Exceptions to this include the following.

Controlcode 4 sets a read timeout value for the next read (timeout value), and controlcode 22 returns the time taken for the last read to your program. Each of these timer functions, if desired, must be issued for every read.

A number of FCONTROL functions return information to your program. Some only return information, while others set a new value and return the old value. You can then use the value returned as input to a call which resets the device to its previous setting when your program ends.

Parameters

filenum

16-bit signed integer by value (required)

Contains the file number of the target devicefile as returned by FOPEN (or HPFOPEN).

controlcode

16-bit signed integer by value (required)

A code that specifies the control operation to be performed. The codes used for asynchronous device control are listed below. With the exception of controlcode = 1, which sends a carriage control directive to a device, these controls apply only to terminals.

1

Sends a carriage control directive to the device.

4

Sets a read timeout value for the next read.

10

Changes the line speed of a device. Both input and output speed are affected.

11

Changes the line speed of a device. Both input and output speed are affected.

12

Enables character echoing.

13

Disables character echoing.

14

Disables the system break function.

15

Enables the system break function.

16

Disables the subsystem break function.

17

Enables the subsystem break function.

22

Obtains the time required for the last read to complete.

23

Disables parity checking.

24

Enables parity checking.

25

Defines additional end-of-record (AEOR) character for terminal input.

26

Disables Binary Mode.

27

Enables Binary Mode.

28

Disables User Block Mode.

29

Enables User Block Mode.

34

Allows printing of !!! when the line deletion character is entered.

35

Prevents printing of !!! when the line deletion character is entered.

36

Defines parity setting.

37

Sets both terminal type and speed.

38

Sets terminal type.

39

Determines current terminal type.

40

Determines current speed setting.

41

Enables transparent editing.

param

type varies passed by reference (required)

The meaning of param depends on the controlcode being used. However, no matter what the controlcode is, a value must always be assigned to param.

NOTE: For a number of the controlcode functions param has no meaning. In those cases it must be coded as a dummy parameter, with a value of 0, because it is a required parameter.

The following pages describe each controlcode value. Each description includes the use of param, the meaning of condition codes, and any special considerations or additional discussion.

Feedback to webmaster