Back to Top
(1) Introduction
MISLIB is a library of general purpose routines which are needed
frequently for common tasks in the Auditory Lab computing environment.
MIS stands for "miscellaneous" because these are routines that don't
fit well into other broad categories. Additional routines for the
Auditory Lab are available in
DAFLIB (data storage and retrieval),
NUMLIB (numerical),
DCPLIB (data collection),
DSSLIB (hardware control)
and PLTWIN and PLTMFC (graphing and plotting).
This document contains a description of the routines in MISLIB as well
as suggestions for how to use them.
It is a work in progess, so not all routines may be listed here.
The routines in MISLIB were first written for the Harris computer
(mid 1970's), then converted for the PDP-11 (RSX-11M, early 1980's)
and VAX/VMS (late 1980's) and finally for the 32-bit Windows
system (late 1990's).
In their present version, most of them work on both OpenVMS and Windows,
but a few may work on one but not the other.
These cases are noted in the description of the relevant routines.
(2) Usage
VAX/VMS: The routines described in this report are all
in library MISLIB and may be linked to user programs as follows :
LINK program,........,L:MISLIB/L
The library MISLIB resides in directory L: on the VAX.
Windows 9x/NT/2000/XP:
The routines in this report are all in library MISLIB.LIB which
presently resides in folder c:\audstuff\L on the c: drive.
When linking with a MS Visual Studio project (e.g.) you should
select Project -> Settings -> Link Tab.
Then select Category -> Input and in the "Additonal library path"
field, enter c:\audstuff\L and in the "Object/library modules" field,
insert mislib.lib at the beginning of the list of libraries for the
current project.
You will also need to include the header file c:\audstuff\L\mislib.h
at the start of your C or CPP file.
To avoid hard-coding the folder location in the source file, include
the header file as follows:
#include "mislib.h"
and then specify the path in the project settings as follows:
In MS Visual Studio, select Project -> Settings -> C/C++ tab.
Then select category -> Prepocessor and in the "Additional include paths"
field, enter c:\audstuff\L, or append it to what is already there.
In most of the routines described below, an error code value NER is
returned. The value of NER indicates whether the routine completed
successfully or whether an error condition was detected. In all cases, a
value of NER=0 indicates successful completion. If NER is non-zero, it
can indicate a variety of problems.
A complete list of error code descriptions can found in file
c:\audstuff\d\error.txt
All integer arguments must be declared type INTEGER. On the VAX
this means 4-byte integers. In a few cases the integer arguments must be
explicitly declared as INTEGER*2 or as INTEGER*4. These cases are
mentioned with each routine where applicable.
The routines can be called from any VMS or Win32 compatible language,
e.g. FORTRAN or C or C++. From FORTRAN, they are all called as subroutines,
e.g. "CALL PCUR(..)".
Examples of use are provided in a separate section below.
See below for a detailed description of the arguments of these routines.
(3) Description
(4) Examples of Use
The following are examples of C and FORTRAN programs used to fetch some
basic information from a data file and a data set. In these examples the
checking for error codes (NER) has been omitted for brevity. In a real
case, you should always check the value of NER after every call to a
MISLIB routine which returns NER.
<...The examples will be added in a future version...>
Back to Top
(5) References
(6) Acknowledgements
The work described in this report has been carried out under the
overall supervision of Dr. W.S.Rhode.
Supported in part by a grant from NIH.
Back to Top
(7) Error Codes
If you have questions or suggestions about this document,
please send them by e-mail to
Return to Documentation Page
void DEFTER(NRD,NER)
Initialize the console mode I/O routine
NRD : Terminal logical unit number
NER : Error code (normally zero)
NRD must be supplied while NER will be returned.
This routine should normally be called (once) before any other
terminal I/O routines such as PCUR, ERAZE etc.
For Windows, the value of MRD is ignored, but must still
be supplied, you can set it to 0 (e.g.)
Compatibility: VMS and Win32
Header: mislib.h
Link: mislib.lib
void ERAZE(chCode)
This routine can be used to erase all or part of the console
window screen. At the moment, the Windows version ignores
the value of chCode and always erases the entire screen.
For VMS, chCode is a Fortran character string and is
interpreted as follows:
chCode : A Fortran Character String interpreted as:
'HL' = Erase the current line where cursor is
'BL' = Erase from beginning of line to cursor
'EL' = Erase from cursor to end of line
'HS' = Erase the entire screen
'BS' = Erase from beginninbg of screen to cursor
'ES' = Erase from cursor to end of screen
chCode must be supplied.
Routine DEFTER must called before this routine.
For use from C/C++, use the equivalent routine ERAZEI (see below).
Compatibility: VMS and Win32 (Fortran)
Link: mislib.lib
void ERAZEI(Code)
This routine can be used to erase all or part of the console
window screen. At the moment, the Windows version ignores
the value of "Code" and always erases the entire screen.
This routine is identical in function to the routine ERAZE (see
above) with the difference that here "Code" is supplied as a
zero-terminated C-style char array (or a Fortran integer or byte
array). This variant is provided solely for convenience for
C/C++ users.
Compatibility: VMS and Win32
Header: mislib.h
Link: mislib.lib
void PCUR(chCode,IPX,IPY)
Position the cursor to specified location on console or terminal
screen.
chCode : Positioning code (Fortran character string)
Can be one of the following:
'AB' = Cursor is positioned to absolute position
'RL' = Cursor is positioned to relative position
IPX : X-position (1 to 80)
IPY : Y-Position (1 to 24)
All parameters must be supplied. The value of "chCode" is
ignored in Windows but must still be supplied. Windows only
supports chCode='AB' (i.e. absolute positioning).
The position is specified from the upper left corner of
the screen. Thus PCUR('AB',1,1) would position the cursor
to the upper left corner of the screen, PCUR('AB',80,1)
would position it to the upper right corner, and so on.
Routine DEFTER must called before this routine.
For C/C++ users, the equivalent routine PCURI is available (see below)
Compatibility: VMS and Win32 (Fortran)
Link: mislib.lib
void PCURI(Code,IPX,IPY)
Position the cursor to specified location on console or terminal
screen.
This routine is identical in function to the routine PCUR (see
above) with the difference that here "Code" is supplied as a
zero-terminated C-style char array (or a Fortran integer or byte
array). This variant is provided solely for convenience for
C/C++ users.
Compatibility: VMS and Win32
Header: mislib.h
Link: mislib.lib
void RALPHA(LEN,BBUF,NER)
Read an alphanumeric string from the console/terminal
at the current cursor position.
LEN : Length of buffer to read (integer)
BBUF : Byte array to hold buffer (or C-style char string)
NER : Error or special key code
LEN must be supplied, while BBUF and NER will be returned.
The value of NER is interpreted as follows:
NER=0 No error and no special key preseed
NER=1 User pushed
Back to Top
Back to Top
Code Interpretation
---- --------------
101 Data set not found in data file
102 Invalid schema name
.This data set is not suitable for RAP analysis
103 INITSC or HINITSC must be called first
105 This is not an integer*4 variable
106 Variable name not found in schema
107 This is not a type REAL variable
108 This is not a repeating group name
109 This variable is not type "character"
110 Cannot divide by zero
115 Invalid number of repeating group occurrences
116 RG did not occur this many times
117 Variable does not occur within specified RG
118 File not suitable for RAP analysis
121 Supplied buffer is too small
122 Number of spikes exceeds buffer size
123 Variable value is undefined
127 Invalid repeating group length
128 This variable is not type "vector string"
129 This variable is not type "vector RG"
130 Error converting Harris character to VAX character string
131 Error converting Harris integer to VAX integer
132 Error converting Harris floating point to VAX floating pt.
133 Invalid repeating group occurrence number
134 Number of points is too small
135 This is not Tuning Curve data
137 Frequency increment is improper
139 Character variable number out of range
140 Improper Schema name for this operation
146 Impossible error, consult programmer
147 Error converting from integer array to character string
148 Unable to obtain value of variable
149 Unable to extract unit number from DSID
151 Too few or too many points
152 Number of points must be power of two
153 Invalid time resolution
155 Trial number is outside range specified by user
159 Specified character string is of improper length
160 Syntax error
161 Variable value is out of range
162 Too many windows
163 Too few columns
164 Invalid spike number
165 Improper analysis for this program
166 Value must be positive, non-zero
167 Invalid message number
168 Invalid Unit Event Timer channel number
173 Indexing is improper
174 Unable to form a new DSID
175 Work buffer is too small, try again, or consult programmer
201 Parameter 1 is invalid
202 Parameter 2 is invalid
203 Parameter 3 is invalid
221 Too few entries in directory
222 No entries were deleted
223 The FROM number cannot exceed the TO number
224 Invalid data set number
225 INITDF or INITRF must be called first
226 Entry already exists in directory
228 Data File directory is full
229 Bad Directory Header
231 Unable to read Event Flag, consult programmer, or try again
232 Unable to create VMS mailbox, consult programmer
241 Bad data in file
250 File Read error
251 File Write error
252 File Open error
.Please use the DIR command to check for file existence
.Also make sure you are authorized to access the file
253 Invalid Logical Unit Number
254 File name already includes directory spec
264 Invalid pointer into buffer
265 Too many real variables, Buffer is full
266 Too many character variables, Buffer is full
267 Variable already defined as a different data type
272 Too many points in Tuning Curve, buffer overflow
274 Improper number of values in line-table buffer
275 Unable to get logical unit number
280 Improper data storage format
285 No space to create temp. array, out of memory space
286 Invalid array size
289 Array is undefined
290 Array sizes are not the same
291 Invalid array number
292 This array already exists with a different size
294 A user file is already assigned to this number
.File open failed, try a different number
301 Improper STATUS table type
.This data may not be suitable for RAP analysis
303 Invalid histogram type
307 Improper number of RA variables
308 Invalid number of plots along X-direction
310 Improper number of repetitions
311 Improper number of sequences
312 Improper number of STATUS table pointers
314 Invalid time base
315 Invalid stimulus duration
316 Invalid repetition interval
317 Improper number of DSS's
318 Invalid master DSS number
319 No data recorded at this stimulus point
320 Invalid value of sync. coefficient
321 Invalid Rise/Fall envelope shape
322 Invalid units for duration time
323 Invalid units for repetition interval
324 Invalid units for delay
325 Invalid units for time base
328 Invalid repetition number
329 Only Type-2 STATUS table supported for this operation
330 STATUS Tables for the two data sets must be the same TYPE
331 Number of reps for the two data sets must be the same
332 Stimulus duration for the two data sets must be the same
333 Repetition interval for the two data sets must be the same
334 Number of RA variables for the two data sets must be same
335 Variable increments for the two data sets must be the same
337 Invalid variable type for this operation
338 Array element is out of bounds
339 Only Type-1 STATUS table supported for this operation
340 No data within specified time range
.Please pick a different range
355 Invalid number of histogram bins
356 No binning frequency specified
357 This is not one of the RA variables
360 Variable number is out of range
362 Spike time cannot be negative
363 Invalid variable name
375 Invalid binning frequency
410 Destination file format is improper
430 Keyword not found in database
443 Invalid time format, consult programmer, or try again
Back to Top
kochhar@physiology.wisc.edu.
Return to Computing Page
Back to The Basement
This page last modified on : July 24, 2003