MULTIREADB

Purpose:

Reads an interlaced multi-channeled binary file and places it in a series of Windows.

Syntax:

MULTIREADB(

"filename", "vunits", "hunits", filetype, numseries, start, offset, byteswap,windows, deltax, slope, yoffset, islope, iyoffset)

"filename"

-

A string. The name of the binary file read. If no path is given, MULTIREADB searches the current working directory for the file.

"vunits"

-

Optional. A string, the vertical (Y) units.

"hunits"

-

Optional. A string, the horizontal (X) units.

filetype  

-

An integer, the binary data type.

numseries    

-

An integer, the number of series in the file.

start

-

Optional. An integer, the first series to be read as data. Defaults to all series.

offset  

-

Optional. An integer, the number of bytes to skip. Defaults to 0.

byteswap

-

Optional. An integer, the swap the order of the bytes read flag:

0:

do not swap bytes (default)

1:

swap bytes

windows  

-

Optional. List of destination Windows. Defaults to current Window.

deltax

-

Optional. A real, the spacing between data points (inverse of the sample rate).

slope   

-

Optional. A real, the y-multiplier. Defaults to 1.

yoffset  

-

Optional. A real, the y-offset. Defaults to 0.

islope  

-

Optional. An integer, the y-multiplier to apply to raw data. Defaults to 1.

iyoffset

-

Optional. An integer, the y-offset to apply to raw data. Defaults to 0.

Example:

W1: gsin(100,.01,1)

W2: gsqr(100,.01,2)

W3: gtri(100,.01,3)

W4: merge(W1,W2,W3)

 

writeb("merged.dat",double,W4)

multireadb("merged.dat",double,3)

 

W4 merges a sine, square and triangle wave. The interlaced series is written to the file merged.dat. The three original series are demultiplexed into W5, W6 and W7.

Example:

(s1, s2, s3) = multireadb("merged.dat",double,3)

 

same as above except the series are loaded into the variables s1, s2, and s3.

Remarks:

The file name must be in quotes or otherwise specified as a string. Specify the binary data as in READB. The number of series in the file is specified in num_series. Use this only if the data in the file is interlaced. MULTIREADB puts each series in a Window, starting with the current Window.

 

The slope, islope, yoffset, and iyoffset parameters provide methods for scaling the data.

 

If all scaling parameters are specified, the scaling occurs as follows: Yout = slope*(islope*Yin+iyoffset) + yoffset, where islope * Yin is an integer multiplication; + iyoffset is an integer addition; and slope and yoffset are floating point multiplications and additions. The integer scaling (islope, iyoffset) is performed using integer arithmetic.

See Also:

FREADB

FWRITEB

MERGE

READB

WRITEB