Statistical Analysis and Plotting
Technical Notes
Table of Contents
  1. Introduction
  2. Inter-Process Communications
  3. Event Flags
  4. Notes
  5. References
  6. Acknowledgements

See also: STATPK Users Guide

Statpk logo
Ravi Kochhar
Department of Physiology
University of Wisconsin
Madison, Wi. 53706
Technical Report no. 21
Dec. 26, 2000
Rev. 1.002, June 27, 2002
Back to Computing Page

Back to Top


These are the programming notes for STATPK, a program for data analysis and plotting. It is used primarily by users of the Auditory Lab for data plotting and management, but can also be used for more general purposes. Usage details are in the Users Guide.

STATPK is available for VMS (VAX and AXP) and MS Windows/NT/2000. Differences between the two versions are noted below where applicable.

Inter-Process Communications

Communication between the main program (STATPK) and the analysis programs are carried on as follows:

When a command is received to initiate an analysis program (e.g. "GR SP"), STATPK first checks to see whether the program has been initiated earlier. If it has (been initiated), then STATPK sets the proper flag to start execution of the analysis program, Before doing so, it writes out the array "TABLE" and the temporary variables into the global section "STATB1" where they can be accessed by the analysis program. The main program (STATPK) then suspends itself and waits for the analysis program to finish and signal that event by setting the proper flag.

If the analysis program is not currently in memory (i.e. has not been initiated earlier), then STATPK starts it from disk as a sub-process. Parameter passing is the same as described above.

When the analysis program is done with it's assigned task, it suspends itself by waiting for a flag, and re-starts the main program by setting the proper flag. Before suspending themselves, the analysis programs write back the array] "TABLE" into STATB1.

To summarize:

(1) Once an analysis program is initiated, it stays in memory so long as the main program doesn't exit.

(2) All parameter passing is via the Global Common Section "STATB1" (or the Memory Mapped Object of the same name in Windows).

Array STCOM1 Contents (Global Section STATB1)

         Word #          Contents
         ------          --------
         1-8000          Macro at level-1
      8001-16000         Macro at level-2
     16001-24000         Macro at level-3
     24001-24640         -----avail-----
     24641-24859         Temp. variables
     24860-25000         -----avail-----
     25001-27000         Temp. character variables
     27001-28000         Arrays LAB and NLAB
     28001-30000         Command Buffer (ICBF)
     30001-33200         Array TABLE
     33201-38400         -----avail-----

Event Flags

STATPK uses "Common Event Flags" (VMS) or "Event Objects" (Windows) to synchronize communications between it's various components. Essentialy, these are global variables whose value can be set to 0 or 1, and a process can wait for an event flag to be set to signal completion of some task.

On VMS, the event flags are numbered, e.g. 65, 66 etc. In Windows, event objects can have names, so in order to keep things consistent, they are assigned names like STATPKFLAG65 (e.g.) to use in place of flag no. 65. The following table summarizes event flags currently in use and their function:

      VMS Flag #     Windows Object     Function
      ----------     --------------     --------
          65         STATPKFLAG65       Synch. between STATPK and
                                        current analysis program

          66         STATPKFLAG66       Synch. between STATPK6 and STATPK6P1
                                        (Windows only)

          67         STATPKFLAG67       Synch. between STATPK and STATPK6

          68         STATPKFLAG68       Synch. between STATPK and STATPK7

          69         STATPKFLAG69       Synch. between STATPK and STATPK5

          70         STATPKFLAG70       Synch. between STATPK and STATPK8

          71         STATPKFLAG71       Synch. between STATPK and STATPK3

          72         STATPKFLAG72       Synch. between STATPK and STATPK9

          73         STATPKFLAG73       Synch. between STATPK7 and STATPK7P1
                                        (Windows only)

Back to Top


This work was done under the direction of Dr. W.S. Rhode. It also benefited from the comments of the many users of the Neurophysiology Auditory Laboratory.

Support provided in part by a Grant from NIH.

Back to Top

If you have questions about, or suggestions for, this document, please send e-mail to

Return to Documentation Page
Back to The Basement
This page last modified on : June 27, 2002