3.6 Parallel

3.6.1 @octave_parallel/fclose

Function File: res = fclose (obj)

Closes parallel connection obj

3.6.2 @octave_parallel/fopen

Function File: res = fopen (obj) (dummy)

Opens parallel interface obj

This currently is a dummy function to improve compatibility to MATLAB

3.6.3 @octave_parallel/fread

Function File: data = fread (obj)
Function File: data = fread (obj, size)
Function File: data = fread (obj, size, precision)
Function File: [data,count] = fread (obj, ...)
Function File: [data,count,errmsg] = fread (obj, ...)

Reads data from parallel instrument

Inputs

obj is a parallel object.
size Number of values to read. (Default: 1).
precision precision of data.

Outputs

data The read data.
count values read.
errmsg read operation error message.

3.6.4 @octave_parallel/fwrite

Function File: numbytes = fwrite (obj, data)
Function File: numbytes = fwrite (obj, data, precision)

Writes data to parallel instrument

Inputs

obj is a parallel object.
data data to write.
precision precision of data.

Outputs

returns number of bytes written.

3.6.5 parallel

Loadable Function: parallel = parallel ([path], [direction])

Open Parallel interface.

Inputs

path - the interface path of type String. If omitted defaults to ’/dev/parport0’.
direction - the direction of interface drivers of type Integer, see: PP_DATADIR for more info. If omitted defaults to 1 (Input).

Outputs

The parallel() shall return instance of octave_parallel class as the result parallel.

3.6.6 pp_close

Loadable Function: pp_close (parallel)

Close the interface and release a file descriptor.

Inputs

parallel - instance of octave_serial class.

Outputs

None

3.6.7 pp_ctrl

Loadable Function: pp_ctrl (parallel, ctrl)
Loadable Function: c = pp_ctrl (parallel)

Sets or Read the Control lines.

Inputs

parallel - instance of octave_parallel class.
ctrl - control parameter to be set of type Byte.

Outputs

If ctrl parameter is omitted, the pp_ctrl() shall return current Control lines state as the result c.

3.6.8 pp_data

Loadable Function: pp_data (parallel, data)
Loadable Function: d = pp_data (parallel)

Sets or Read the Data lines.

Inputs

parallel - instance of octave_parallel class.
data - data parameter to be set of type Byte.

Outputs

If data parameter is omitted, the pp_data() shall return current Data lines state as the result d.

3.6.9 pp_datadir

Loadable Function: pp_datadir (parallel, direction)
Loadable Function: dir = pp_datadir (parallel)

Controls the Data line drivers.

Normally the computer’s parallel port will drive the data lines, but for byte-wide transfers from the peripheral to the host it is useful to turn off those drivers and let the peripheral drive the signals. (If the drivers on the computer’s parallel port are left on when this happens, the port might be damaged.)

Inputs

parallel - instance of octave_parallel class.
direction - direction parameter of type Integer. Supported values: 0 - the drivers are turned on (Output/Forward direction); 1 - the drivers are turned off (Input/Reverse direction).

Outputs

If direction parameter is omitted, the pp_datadir() shall return current Data direction as the result dir.

3.6.10 pp_stat

Loadable Function: stat = pp_stat (parallel)

Reads the Status lines.

Inputs

parallel - instance of octave_parallel class.

Outputs

The pp_stat() shall return current Status lines state as the result stat.