Digital PDFs
Documents
Guest
Register
Log In
AA-2124D-TC
October 1977
150 pages
Original
6.8MB
view
download
OCR Version
6.3MB
view
download
Document:
ftnExtns Oct77
Order Number:
AA-2124D-TC
Revision:
0
Pages:
150
Original Filename:
AA-2124D-TC_ftnExtns_Oct77.pdf
OCR Text
FORTRAN/RT-11 Extensions Manual Order No. AA-2124D-TC FORTRAN/RT-11 Extensions Manual Order No. AA-2124D-TC October 1977 This document describes the purpose and function of the FORTRAN/RT-11 language extensions for real-time support, and FDT, the FORTRAN debugging technique. FORTRAN/RT-11 Extensions Manual Order No. AA-2124D-TC SUPERSESSION/UPDATE INFORMATION: This document completely supersedes the document of the same name, Order No. DEC-11-LRTEA-C-D, published September 1976. OPERATING SYSTEM AND VERSION: SOFTWARE VERSIONM: RT-11 VO3 FORTRAN/RT-11 Extensions V02 FDT V02 To order additional copies of this document, contact the Software Distribution Center, Digital Equipment Corporation, Maynard, Massachusetts 01754. digital equipment corporation - maynard. massachusetts First Printing, Reviged: March 1975 June September October 1975 1976 1977 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Digital Equipment Corporation assumes no responsibility Corporation. for any errors that may appear in this document. The software described in this document is furnished under a license and may be used or copied only in accordance with the terms of such license. Digital Equipment Corporation assumes no responsibility for the use or reliability of its software on equipment that is not supplied by DIGITAL. Copyright C) 1975, 1976, 1977 by Digital Equipment Corporation The postage prepaid READER'S COMMENTS document requests the user's critical paring future documentation. The following are trademarks form on the last page of this evaluation to assist us in pre- of Digital Equipment Corporation: DIGITAL DECsystem-10 MASSBUS DEC DECtape OMNIBUS PDP DIBOL 0Ss/8 DECUS EDUSYSTEM PHA UNIBUS COMPUTER LABS FLIP CHIP FOCAL RSTS RSX COMTEX INDAC TYPESET-8 DDT LAB-8 TYPESET-10 DECCOMM DECSYSTEM-20 TYPESET-11 CONTENTS PREFACE 1 RT-11 1.1 WHAT FORTRAN ARE THE EXTENSTIONS FORTRAN Control Digital and THINGS 1.2 EXTENSIONS? Time-Interval Input TO and Sampling Output Analog-to-Digital Sampling Digital-to-Analog Graph Plotting (A/D) Conversion and (D/A) Conversion KNOW ABOUT RT-~11 AND THE FORTRAN EXTENSIONS Completion Routines Considerations in Using Routines W Software U Action [] N L] W W . W L] Service Routine CTRL/C Requirements Acquisition for High-Volume - CONVENTIONS Syntax Conventions Notation Conventions DESCRIPTION B = of Programming Data Completion Clock SYSLIB Library The RT-11 User » . . NN N B RS e L 1.2.1 OF THE FORTRAN EXTENSTONS L2 CLRD (Clear Display) Routine CVSWG (Convert Switched Gain NN L] = ROUTINES Value) W b U DRS (Digital Read-in Sampling) Routine DXY (Display X-Y Data Pairs) Routine FLTl6 (lo-bit Flcating—-Point Conversion) Routine F5H (Flash) Routine FXY (Flash X-Y Data Pairs) Routine HIST (Time Interval Sampling Techniqgue) . o . . DIS © 0~ [] I N S L) . TSNS = I Routine (Display < |- £ Routine = CHAPTER IADC Data) Routine : (Single Analog-to-Digital Conversion) Routine 1.4.11 IDIR (Digital Reading Memory 1.4.12 a Input Digital Reading) Input Routine Register Bit and Byte Manipulation of a Reading the Software Clock IDOR (Digital Output Register) Loading Memory Reading or a Location a Digital Output Single Word Routine Register or Location and Resetting iii the Software Clock CONTENTS (CONT.) . L] (Stop SETR (Set 1-59 Sampling) of Routine Routine the Programmable A REAL-TIME SUPPORT System Configuration Standard Changing the Revised Specifications Configuration The Real-Time Support Library Generating the Library Accessing the Library MESSAGES DEBUGGING INTRODUCTION USING FDT TECHNIQUE (FDT) FDT COMMAND TYPES Control Commands Information Transfer FDT Control Commands FDT CONVENTIONS AND Commands TERMINOLOGY [y . L] Lo NN Syntax Conventions Current Procedure The Location Offset Named Specification Location Location [~ V8] L) * Locations Subscripted Name Locations Mode Codes FDT Pause Vb ~N oy THE CONTINUE DIMENSTION ERASE GOTO a Label IF MACRO Implicit Macro L] [] [ STEP STOP [l START [] PAUSE . NAME RESET TYPE WATCH FDT COMMANDS - Wi . . . [ L] wur o OF ACCEPT Defining . Definition DESCRIPTION . b o * U ab o e« * U1 U O U Gt NNDNNMNDNNDNDND Relative BB WWWNNN ERROR > L1BRARY System Configuration Assembling Clock) HENOO U UL . . L] L] L] | CW S O Sy Sy Wy L] L} L] [0 W N BUILDING A 1-55 1-56 Routine Display) Rate = .« N Routine Control) Routine Program NRONONND NN Routine 1 NNNNNNNNN!}JNNNNNNNN | L] - L] - Eo R L] S RTS cC L] U LUt Ut = ) Y Iy SR (Wait) SDIS N [ (LED Routine iv [F9) L] L] N (Repeated - R S (Relay ] R REL R A LWATIT LED Binary to BCD) BCD to Binary) Display) Routine w N N (Convert FORTRAN . NN (Convert . CHAPTER KB2BCD KBCD2B S L] L] Page 3 = TECHNIQUES Named N . AND ADVANCED . CAUTIONS LY WHAT . (CONT.) L] NI N CONTENTS How PITFALLS Common FDT Octal Generates Addresses Offsets Names Relative Addressing Subscript Gl > W Addressing Addressing Format Conversion Routines On-line Debugging Technique Execution APPENDIX ARGUMENT APPENDIX B OBJECT APPENDIX C ERRCR APPENDIX D FDT COMMAND APPENDIX FDT LOCATION APPENDIX FDT MODES APPENDIX FDT ERROR AND AND (ODT) Speed b NN . L] N Ll N L] > L] Indirect DEFAULT SOURCE SUMMARY SUMMARY TABLE FILES TABLE SUMMARY SPECTFICATION FORMATS MESSAGES INDEX Index~1 and Circular Array Arrays Pointers TABLES TABLE 2-1 FDT Mode Codes [} Linear Circular TM FIGURE - FIGURES PREFACE The RT-11 real-time RT-11 is FORTRAN support documented in the and Manual describes FDT, FORTRAN following RT-11 the Introduction to Pocket System Guide (DEC-11-ORRCB-A-D) User's Guide (DEC-11-ORGDA-A-D) RT-11 Advanced RT-11 Documentation Programmer's System Message System Generation RT-11 System Release RT-11/RSTS/E PDP-11 Manual the FORTRAN FORTRAN (DEC=-11-ORMEB-A-D) Manual Notes (DEC-11-ORGMB-A-D) (DEC-11-ORNRB-A-D) following IV User's Language (DEC-11-OKAPA-A-D) (DEC-11-ORDDB-A-D) manuals: Guide Reference sets of laboratory (DEC-11-LRRUB-A-D) Manual DEC~11-LFLRA-C-DNI) FORTRAN IV Installation Guide RT~11 three in Guide Directory RT-11l documented technique. (DEC-11~-ORITA-A-D) RT-11 is FORTRAN-callable debugging manuals: RT-11 RT-11 FORTRAN The Extensions routines, (DEC-11-LFLRA-C-D and (DEC-11-LRSIA-A-D) peripherals supported by the FORTRAN extensions are described in the following sets of manuals. You should be familiar with the function of the peripherals hardware on your system, 1., and with ADl1-K the terms Analog to used in Digital these manuals. Converter User Manual Multiplexer User's Manual and Control (EK-AD11K-0P-001) AM11-K Multiple Gain (EK-AMI1IK-TM-002) AAll-K 4-channel D/A Display User's Manual (EK-AAL1K-TM-001) DR11-K Interface User's Guide and Real Time Maintenance Manual (EK-DRIIRK-MM-001) KWll-K Dual Programmable (EK-KW11K-OP-001) ' 2. AR1l User's 3. LPS-11 Laboratory (EK-LPS1I-0P-0023) LPS11-S Guide Laboratory (EK-LPS11-MM-002) Clock User Manual (DEC-11-HARUG-B-D) Peripheral Peripheral vii System System User's Guide Maintenance Manual CHAPTER RT-11 1.1 WHAT ARE THE FORTRAN FORTRAN 1 EXTENSIONS EXTENSIONS? The RT-11 FORTRAN Extensions are a library of routines data acquisition and processing. The extensions subprograms written in MACRO assembler language and FORTRAN. counter The and extensions Specifically, the following sets of e allow you laboratory peripherals control converter, a programmable clock FORTRAN program. FORTRAN real-time extensions peripherals hardware: the K-series hardware AM11-K multiple gain clock to from a for real-time themselves are callable from support any of the (ADll-K analog-to-digital converter, multiplexer, AAll-K digital-to-analog DR11-K digital interface, and KWll-K programmable counter) e the ARIll real-time e the LPS1l analog system laboratory peripheral See Section 1.5 for a The FORTRAN extensions discussion can be of system system combined configuration. to provide five kinds of operations: time interval control and sampling, digital input and output, analog-to-digital conversion and sampling, digital-to-analog conversion, and graph plotting. The following section describes the functions available and lists the routines you use to perform those functions. Detailed instructions for wusing each routine appear in Sections 1.4.1 Time-Interval Timed through Control 1.4.20. and Sampling program delay. Use SETR in single-interval the delay interval. Schedule an event interval, at the and mode to LWAIT completion of specify to a time mode to counter the 1length end of of the interval. Use SETR to request a timed program delay, a completion routine to execute at the end Repeated time intervals. Use SETR in repeated-interval of the intervals. The clock at the end of each interval. the detect and to of the specify the generates an designate delay. duration interrupt FORTRAN EXTENSIONS RT-11 Schedule periodic events. Use SETR to request repeated time 1intervals, and designate a completion routine that executes at completion of each interval. Time to the stamping. Use IDIR or IDOR to read the current value of the software the software describes which 1.2.2, Section (see clock clock). during binary Measuring clock software the read You can also use DRS to Use FLT16 to convert the unsigned digital sampling. integer the time time value intervals to a real number. between events. in SETR to run the clock external event an Whenever last 1intervening since the Use HIST to read the time and mode. timing external-event occurs, HIST reads the time <cannot do this with an ARl1l because (You event. external its clock does not have the external event timing mode.) Measuring the latencies of a series initial of events relative to an event. Use HIST to read the clock value at the time of the event, and SETR to run the clock in external-event timing from zero AR1ll mode. (You cannot do this with an AR1ll because the clock does not have the required timing mode.) Digital Input Read and Output digital input. Use IDIR to read the value of the IDIR accepts data it binary format. in Generate digital in either digital binary or BCD input format register. and stores output. the Use IDOR to 1load a digital output register. Use conversion routine KB2BCD to generate BCD format data for output. Digital sampling at regular time intervals. Use DRS to sample from a digital input register, and SETR in at repeated-interval mode to generate clock interrupts regular intervals (thus triggering the DRS sampling). Continuous digital sampling at regqular time intervals. Request digital sampling at regular time intervals using DRS and SETR, and designate a completion routine to process the data Digital in call the sampling Use DRS to on to SETR. external sample events. from a digital input register. Continuous digital sampling on external events. Request digital sampling on external events designate call to Analog-to-Digital Read one a completion using DRS, routine to process the data and in the DRS. (A/D) value from Conversion and Sampling an Use IADC to take a CVSWG to convert analog integer data format switched was gain input. and single sample from an A/D channel, the digitized value from a nonstandard to used). a real number (if autogain or RT-11 Read FORTRAN EXTENSIONS a series of values from one or more analog input channels. Use SETR to set the sampling rate with the clock in repeated-interval mode, and RTS to collect a single sweep of A/D samples. Use LWAIT to detect the completion of sampling, nonstandard and CVSWG integer to data convert format to the digitized values real from numbers. Read values continuously from one or more analog and store the values on a mass storage device. Use SETR to set the sampling rate with input channels the clock in repeated-interval mode, and RTS to sample A/D data continuously. Designate a completion routine to handle the data throughput to disk in the call to RTS, and use CVSWG to convert the digitized values from nonstandard 1integer data format to real Digital-to-Analog (D/A) Generate analog Use an numbers. Conversion voltage. IDOR to generate a digital output value for a D/A converter. Generate a series of analog voltages. Use SETR in repeated-interval mode to control and to designate a completion routine. 1In routine, you use IDOR to generate the digital for a D/A converter. ‘ Graph the time base, the completion output value Plotting Data scaling. Use CLRD to multiply the data in an array values are in the required range. Single display of Y-axis data. Use FSH to display a data Continuous display of Y-axis array data so that the data once. (refresh scopes). (a) Use SETR in repeated-interval mode to control the refresh interval, and to designate a completion routine. 1In the completion routine, you call FSH to display a data array. (b) Use DIS to display designate you a data array a completion routine. use SDIS to stop the constantly, display. and SETR to 1In the completion routine, Continuous display of Y-axis data (storage scopes). Use FSH to display a data array once, and 1IDOR to control the intensify bit and erase bit of the scope controller. Continuous (a) display of X-Y data pairs (refresh scopes). Use SETR in repeated—-interval mode to control the refresh interval and to designate a completion routine. 1In the completion routine, you call FXY to display the X and Y data arrays. (b) Use DXY to display the X and Y data arrays SETR to designate a completion routine. routine, you use SDIS to stop the display. constantly, and 1In the completion RT-11 FORTRAN EXTENSIONS Continuous display of X-Y data pairs (storage scopes). Use FXY to display the X and Y data arrays once, and control the intensify bit and erase bit IDOR to the scope of controller. 1.2 THINGS TO KNOW ABOUT RT-11 AND THE FORTRAN EXTENSIONS There are three variants of the RT-11 monitor: RT-11 Single Job (S8J), RT-11 Foreground/Background (FB), and RT-1ll Extended Memory (XM). Consult the RT-11 documentation for descriptions of the features of the monitor variants. FB. and RT-11 The FORTRAN extensions run under both RT-11 SJ CAUTION Do not use RT=-11 XM. The FORTRAN extensions the FORTRAN run with extensions FORTRAN under IV version 2 which includes virtual-array support. (See the FORTRAN Language Reference Manual for description of the VIRTUAL array declarator.) However, the FORTRAN extensions 1impose <certain restrictions on the use of FORTRAN virtual arrays. The extensions routines cannot refer to virtual arrays. That is, the array arguments passed to the extensions routines cannot be virtual-array names. If your FORTRAN program passes a virtual array to an extensions routine, the results are invalid and unpredictable. There is no error message. Your FORTRAN main program can contain virtual arrays and you can copy the conventional arrays used by the extensions routines into virtual arrays. NOTE Virtual or 1.2.1 arrays EQUIVALENCE cannot appear in COMMON statements. Completion Routines In the FORTRAN extensions package, completion routines are subroutines called from within an interrupt service routine. The FORTRAN extensions library provides standard interrupt service routines to handle all interrupts from the <clock and laboratory peripherals. Essentially, you write your own completion power of interrupt service routines. routines to extend the Several of the FORTRAN extensions routines allow you to designate a completion routine name, and the conditions under which you want it to execute. The idea behind completion routines is that you will want them to execute wupon completion of some operation that generates interrupts--for example, at the end of data sampling. The condition that you specify is always in terms of some number of interrupts. For example, you can specify that a completion routine is to execute after a certain number of clock interrupts. Depending on the mode of clock operation, defined event the number routine of interrupts. data executes samples, after or a after defined a defined 1interval, number of after a external RT-11 The RT-11 monitor into a subroutine whenever the satisfied, If no the interrupt completion EXTENSIONS conditions <call appropriate the other puts FORTRAN 1in the interrupt service routine and has completion routine name service routine. Then occurred routine is the interrupt calls executing, and the the the conditions are completion routine. state the of job being executed determines what happens when a completion routine is called. Under the RT-1l SJ monitor, the completion routine executes immediately. Under the RT-1l1 FB monitor, foreground completion routine requests have priority over background jobs. 1If a foreground job requests a completion routine while a background job is executing, RT-11 FB suspends the background 3job, completion routine. At the end of the returns control foreground to the and executes the completion routine, interrupted background 3job job has requested service in the job requests a completion routine while background executing, RT-1l1 foreground FB queues the job gives up control completion routine. background completion of the (unless meantime). a foreground routine system, foreground the monitor and request then the If job until executes a is the the If another completion routine is already executing, the action taken depends on the RT-1l1l monitor. Under the KT-11 SJ monitor, the second completion routine interrupts the first, executes, and returns to the first completion routine. This procedure works only for two different completion routines because completion routines are not reentrant. That 1is, a FORTRAN completion itself as the results are Under RT-11l FB, routine undefined completion must (and routines do there not not is attempt no to interrupt error interrupt each message). other. The completion routine executing continues to completion regardless of whether it was requested from the foreground or the background. Then the second completion routine executes. Considerations in Using Completion Routines Completion routines do not "lock out" interrupts or interrupt service routines. You do not lose interrupts or data while completion routines are running. Completion routines increase the system overhead time in interrupt handling, and therefore decrease the rate at which interrupts can be serviced. The maximum data-acquisition speed 1is lower in programs that use completion routines. Completion routines should copy terminal. Terminal completion routines. If you anticipate simultaneously, that use not several the request T1/0 input results completion SYSLIB IQSET or 1in output delays routines call to in from could extend a hard returning the be RT-11l from active queue length. You If must you declare fail to a do completion-routine so, your program name does not in an EXTERNAL link properly. statement. A completion routine cannot in the FORTRAN program. call a subprogram that is called elsewhere Because completion-routine execution is asynchronous, the monitor could interrupt the subprogram to begin executing the completion routine. The completion routine would then attempt to because the call the FORTRAN interrupted subprogram subprogram, code is not with undefined reentrant. results, RT-11 FORTRAN EXTENSIONS 1.2.2 Software Clock "the as The FORTRAN extensions library provides a time service known software clock." The software clock is a memory location that SETR The interrupt. increments by 1 on each hardware clock counter clock software hardware clock and when, operates when, SETR is running the only in repeated-interval mode. The rate of the software clock is controlled by the rate of <clock The rate counter overflow 1interrupts specified in the call to SETR. frequency of overflow interrupts is a function of the clock counter and the 1initial count (rcount), where the interrupt rate is (irate) (The time interval between interrupts is equal equal to irate/rcount. to irate*rcount.) you Before integers. The software-clock values are unsigned binary can do FORTRAN arithmetic with software-clock values, you must convert The software clock counts the values to real number form using FLTle. 177777), which is the largest possible unsigned (octal up to 65535 After the next clock-overflow interrupt, the value of binary integer. the software clock The IDIR, is zero. IDOR, and DRS routines read the software routine can change the software-clock value. 1.2.3 clock. 1IDOR The SYSLIB Library SYSLIB by The services provided SYSLIB is the RT-11 system library. For example, are described in the RT-11 Advanced Programmer's Guide. double word SYSLIB provides character string manipulation routines, integers, facility requests, programmed (INTSET). and a FORTRAN interrupt service the appropriate device The real-time extensions software protects interrupt vectors during execution using the RT-11l .PROTECT programmed Multiple .PROTECT requests on the same vector cause a fatal request. you should not use the INTSET call or the Therefore, system error. FORTRAN the uses that any program .PROTECT programmed request in you can use INTSET or .PROTECT is one exception: There extensions. T1IDIR, call for the DR11-K or LPSDR-A vectors if the program does not IDOR, or 1.2.4 DRS. The RT-1l1l User Service Routine The User Service Routine (USKR) portion of the RT-1l1 monitor 1is not The USR is normally swapped into 1in memory. resident permanently the supports USR (The memory when any of its services is required. RT-11 file structure, and, for example, handles opening files.) Swapping the USR can slow program execution. if The you following SET Programs can run faster 1lock the USR into memory before the program starts executing. USR instruction locks USR into memory: NOSWAP Locking the USR into memory possibility the is recommended because that eliminates the of the USR swapping over the extensions or the completion routines. 1If space limitations prevent you locking the USR into memory, consult the FORTRAN documentation to find out the address where the USR swaps and consult your program link map to see if there are any conflicts. 1-6 RT-11 1.2.5 The Action action RT-11 of of Under EXTENSIONS CTRL/C CTRL/C monitor FORTRAN 1s in on a running FORTRAN RT-11 initializes SJ, the the CTRL/C causes devices. a all Under FB, the CTRL/C the RT-11 program depends on which use. causes UNIBUS 1INIT, real-time which <clears extensions and software clear all of the device registers in the device list maintained by extensions. Tf your program is using support libraries other than real-time extensions library (for example, VTLIB or LVLIB), use monitor INIT command. 1.2.6 The Programming FORTRAN place extensions data collected array as Requirements in High-Volume data-acquisition FORTRAN exceeds the a circular for arrays. length array. Data routines If the Acquisition DRS, number of to the the the HIST, data and points of the array, these routines That is, when the routine has RTS to treat filled be the the array, it continues to put data in the array, starting again from the beginning (see Figure 1l-1). Unless your program removes data from the array, the routine eventually attempts to overwrite data. When it attempts to overwrite data, the routine sets a flag for this error condition, which is called "data overrun." JIBENENNN Partition 1 _ HEE Partition 2 Linear FORTRAN Array tiz[{ Partition 1 Partition 2 Circular Array Figure The linear circular elements 1l-1 Linear FORTRAN array and Circular wraps around array. DRS and RTS treat as array partitions. Arrays to groups form of a array RT-11 FORTRAN EXTENSIONS There are four related variables 1involved 1in a <circular array structure: the pointer for adding the next data point, the space remaining before data overrun, the pointer to the next data point to remove, and the space containing valid data (see Figure 1l-2). 1In the FORTRAN extensions routines, space can be expressed in units of array elements subset of or the in units total array of array partitions, 1length. where a partition is a Space remaining before data overrun ~— Space containing ___,/ valid data Pointer for the next Pointer for adding data point to remove the next data point Figure 1-2 circular array A pointers and Circular Array Pointers structure involves two available space array variables. The extensions routines handle adding data to the array but not removing data; your FORTRAN program must handle removing data. The extension routine maintains the pointer for adding the next data point; this pointer 1is inaccessible to your program. Your program must define and maintain the pointer to the next data point to be removed. Both your program and the extension routine maintain the wvariable containing the space remaining before data overrun (the available space variable). HIST defines the available space variable as the number of array elements before data overrun. HIST decrements the available space variable each time it adds a data point to the array. DRS and RTS define the available space variable as the number of complete array partitions available before data overrun. DRS and RTS decrement the available space variable each time an array partition is filled. Each time your program removes an array element (with HIST) or the contents of an array partition (with DRS or RTS) thereby making space available, it must increment the available space variable. Your program pointer does is also responsible for ensuring that the data-removal not pass the data-addition pointer. Your program ensures proper data removal by starting to remove data only after the extension routine informs your program that data have been received. (In practice, you can either and remove data when LWAIT completion routine execute monitor the available space pointer with it changes in value, or arrange to have a after a defined number of interrupts.) 1.3 RT-11 FORTRAN define the EXTENSIONS CONVENTIONS The following conventions 1.3.1 The sections used Syntax in this syntax conventions chapter. and notation Conventions syntax conventions described below apply to all of the subroutine function calls appearing in the chapter. The discussion of syntax conventions refers to the following sample sequence: and CALL Any SUBR([nvaluesi#],rvaluel [, [rvalue2],cal ,[iflag*]] l]) capitalized them 1in would be the Punctuation Any words syntax. words exactly required is or letters You can satisfy other tokens are For example, portion of the in except lower that variable (Unless for when must example, specify CALL SUBR above. enclosed in square variable items names with brackets. parts of of your the choosing of the syntax. As far as practical, the function of the argument required. with constant otherwise You For indicate "number begins or calls. sequence token constraints means obligatory. all case these mnemonic word integer sequence. in "ncounts" lowercase an are way replace that of letters same obligatory the Any or the of an is counts." i1 or an required specified, n means in that 1integer that the position means a name in the one-word integer, the default INTEGER*2 data format.) The initial letter i is mnemonic for any integer; the 1initial 1letter n is nmnemonic for “number of ...." For example, iflag in the sample sequence refers to an integer variable or constant; nvalues refers to an integer variable or constant containing the number of values. Any lowercase word that begins with an r means that the name of than i, n, a real variable or constant 1is required in that position in the sequence. (Unless otherwise specified, real refers to the default REAL*4 data format.) For example, rvalue in the sample sequence refers to a real variable. Any lowercase means that word the sequence. For subprogram name. Any item in that name example, square begins of a call The syntax sequence be defaulted. can CALL items the sequence, Any letter is the other required sample For be defaulted specifies exactly example, that sequence can always at or point in refers to (left out of what portions of ",[iflag]" indicates regardless of whether iflag appears. the argument iflag defaulted: in for square the sample use this form: this form: nested square The brackets trailing not syntax. a The that r the a the the the following SUBR(NCOUNT,SUM, ,SUM2,MEANS) When However, 1in brackets sequence) . comma 1is required call is valid with with subprogram sequence CALL CALL of defaulted are from sometimes the rightmost required by the end of syntax. above, SUBR (NCOUNT,SUM) SUBR(NCOUNT,SUM,,,) brackets nesting are commas indicate rvalue2 and 1-9 more call complex in the cases sample of the default sequence above RT-11 FORTRAN EXTENSIONS means that rvalue2 and call cannot be defaulted independently. Either both rvalue2 and call can be defaulted (indicated by the outerd specifie brackets), or rvalue2 can be defaulted while call is d, specifie is rvalue2 if However, ). (indicated by the inner brackets call must also be specified. For example, the following calls are valid: CALL SUBR (NCOUNT,SUM,,SUMZ,MEANS) , ,MEANS) CALL SUBR (NCOUNT,SUM, IFLAG) CALL SUBR (NCOUNT,SUM, These calls are not valid: CALL SUBR (NCOUNT,SUM,,SUM2,) CALL SUBR (NCOUNT,SUM,,SUMZ2) argument 1is not part of the on marks those arguments that conventi asterisk The . sequence calling can be modified when the routine is called with the first argument omitted. This capability is referred to as parameter-adjustment mode. In the following example, the call to SUBR results in a change to the parameter iflag. According to the syntax, the second argument cannot Therefore, the wvariable be modified in parameter-adjustment mode. call, but according adjustment parametera in variable RATE is a dummy An asterisk following the name of an to the syntax, it cannot be defaulted. CALL SUBR(,RATE,IFLAG) The character # following the name of an argument is not part of the The # convention indicates those arguments whose calling segquence. Arguments marked values can change during execution of the routine. . Under some constants than rather names variable be with # must circumstances, if you use a constant instead of a variable name, FORTRAN changes the value of the constant. For example, suppose you use the following call: CALL SUBR(10,SUM,ITOT) Suppose that SUBR returns 25 (nvalues). some In as the value of the first argument cases, SUBR would return 25 as the value of the constant 10. The constant 25 is then substituted for each subsequent appearance of the constant 10 in the program, with peculiar results for the program. 1.3.2 Notation Conventions Any constant can be specified either as a decimal number or as an The system assumes that all FORTRAN constants are octal wvalue. decimal unless they are marked as octal. by prefixing You mark a constant as octal the number with a double quote. octal address 167772, use the constant "167772. For example, to select The manual refers to a bit with a value of 1 as being "on" or "set." A bit with value 0 is referred to as being "off" or "cleared." The words "defaulted" and "omitted" differ in meaning when applied to subprogram arguments in this chapter. When the manual states that an it means that the extensions routines argument can be defaulted, for the argument when it is left out value numeric assume a particular of the argument list. When the manual states that an argument can be 1-10 RT-11 omitted, for the Tnstead, it means argument the that when it extensions the FORTRAN extensions does not routines argument is a flag requesting performed by the routine. EXTENSIONS some routines appear 1in do not the assume argument assume that the absence function other than that a value 1list. of the wusually RT-11 FORTRAN EXTENSIONS 1.4 DESCRIPTION OF THE FORTRAN EXTENSIONS ROUTINES The FORTRAN extensions routines are described 1in the following section. The routines are arranged alphabetically for convenient reference use. Section 1.1 contains functional groupings and descriptions of the routines so you can use those sections to determine which routines you need to solve your problem. Appendix A contains a reference summary of all the routines and their arguments. The description of Name of Meaning each routine contains the routine of the name Functional operation of Calling syntax the routine Explanation of the arguments Error conditions Interactions with other routines Special Examples cases or restrictions the following information: RT-11 FORTRAN EXTENSIONS CLRD l.4.1 CLRD CLRD performs element one of (Clear of the factor, two the which to fill CLRD is called The Routine functions array arguments. data CALL Display) on a a array. It scale factor it by Tt calculates a horizontal display width of the as data multiplying the the single by routines DIS a and FSH to each supplied (X-axis) use screen. scales as spacing position the subroutine. CLRD(iarrayname#,npoints,ispace#,rscale) arguments are: larrayname Name of the integer be array containing the data to scaled. Each array element is multiplied by rscale. Scaled values greater than 4095 (1023 for npoints the AR11l) The number are scaled. nondisplayable. of elements CLRD in scales ispace The X-axis and FSH spacing wuse the the elements. factor 1ispace ' array returned to that are npoints first by to CLRD. ‘"stretch" the be array DIS display horizontally so that the display fills the screen with evenly spaced points. CLRD calculates ispace as 4096/npoints (1lU24/npoints for the ARll). If npoints is greater than 4096 (or 1024 for the AR11l), then ispace is set to 1. NOTE The internal ispace is The not standard cannot format. Therefore you own value ispace use ispace scale a for used stretching screen as zero, each then than Thus, to multiply scale spacing by fill the (rather value. displayed. factor of the wusing four arguments 1-13 are not present. if element the 1If is the of Y-axis values rscale set to to is -1 a nondisplayable make the whole CLRD, the EKROR required as each array to indicate 1initially with cannot affects conditions: The you or compressing you require. element =zero) you can array nondisplayable selectively fill it SYNTAX calculate and other calculations normal integer value. The of 1integer in factor ilarrayname. Error representation in your it were rscale machine and points then to later be RT-11 FORTRAN EXTENSIONS ERROR ARGUMENT The argument npoints is less than one. The argument rscale is negative. Interactions: Both DIS and FSH require the spacing factor ispace calculated by CLRD. for You can call CLRD to scale either or both of the data arrays DXY -and FXY. Restrictions: None Examples: 1. be Set up an array ISCREEN that you will later fill with the data displayed. CLRD returned in TISPACE makes is 1. the array nondisplayable. The to value DIMENSION ISCREEN (4096) CALL CLRD (ISCKEEN,4096,ISPACE,0.0) 2. Suppose you have a data array IDATA of 25V points that you want to prepare for display. The maximum value in the array is 150U, but you would like the display to £ill the screen vertically as well as Calculate your scale factor by dividing the maximum horizontally. value you want by the maximum value you have. 1In this case, the scale factor might be 4095/1500 or approximately 2.67. For an ARll, the scale factor might be 1VU23/1500, or roughly U.67. CALL CLRD(IDATA,250,ISP,2.67) I1f you want the data values scaled more exactly, use the following call: CALL CLRD(IDATA,250,15SP,4095./1500.) The value returned in ISP is equivalent to 16 (or 4 for the ARll). RT-11 FORTRAN EXTENSIONS CVSWG 1.4.2 CVSWG CVSWG converts format to (Convert Switched switched gain number format. real Gain Value) analog input CVSWG Routine values requires from as packed input a 1integer value in the format returned by the RTS and TADC routines. The value contains the digitized wvalue in the rightmost 12 bits for the ADl1-K and LPS11 (10 bits for the ARll) and the gain code in bits 12 and 13. CVSWG separates this packed information into two values, the digitized value as a real number, and the gain code as an integer. CVSWG is called as a function. rvalue=CVSWG(ivalue[,igain#]) The arguments are: ivalue The igain integer value acquired form of the CVSWG (the value The the is name of returned. variable The value to 4. The meanings the descriptions of Sections 1.4.10 and Error using real-number returned as in RTS or TIADC. The digitized wvalue of the function). which returned the is gain in the 1is setting range 1 of the gain codes appear 1in the routines IADC and RTS (see 1.4.18, respectively). conditions: SYNTAX ERROR No arguments, or more than two arguments, are present. Interaction: The CVSWG routine normally converts data acquired by RTS or TADC. Restrictions: None Examples: 1. You want to convert a value acquired from channel 0 with a gain code of (using TADC as a function) by channel 2. VAL=CVSWG (IADC (0,2)) 2. You want to convert a value autogain. IGAIN contains the the conversion. Tt is necessary TGAIN represents to restore VAL acquired TADC gain selected to divide VAL to its original from and used by by the gain 2 with IADC during value that scale. VAL=CVSWG (IADC (2,0), IGAIN) VAL=VAL/ (2%* (2% (IGAIN=-1))) The expression and 64 for (2** (2% (IGAIN-1l))) results in scale factors IGAIN values 1, 2, 3, and 4 (respectively). 1, 4, 16, RT-11 FORTRAN EXTENSIONS DIS 1.4.3 DIS DIS (Display Data) Routine initiates the continuous display of Y-axis data on a example, (for scope the Tektronix 6U4). refresh-type DIS displays Y-axis data on the scope. The routine assumes that if X-axis values were provided, they would be equally spaced, increasing Logically, there are two X values for each ¥ value plotted. values. One specifies the X coordinate on the screen where the Y value appears, and the other specifies the array subscript where the Y value The X coordinate and array subscript for a single point can be found. X You do not have to provide explicit usually have different values. value is controlled by an X-axis spacing The X-coordinate values. factor, whereas the array subscript value is controlled by an indexing factor (see the ispace and increment argument descriptions). DIS displays one data point on every interrupt from the scope control DIS constantly plots points, of so that it displays points as gquickly as the scope can receive them. array as soon as it DIS a is called as reaches starting again at the the end. beginning the subroutine. CALL DIS(iydata,ispace,npoints,istart,increment) The arguments iydata are: The name of the 1integer array containing the scaled Y-axis data to be displayed. The Y values should be in the range 0 to 4095 (or 0 to 1023 for (See the restriction on Y values later the AR1l). in ispace this section.) The X-—-axis spacing factor. controls the horizontal The 1space argument spacing (X coordinates) for the points plotted. You must call CLRD to calculate 1ispace before you call DIS. If ispace is 1 and increment 1is 1, then the X-axis for the display assumes values 0, 1, 2 coordinate ye+., (npoints - 1). 1If ispace is greater than 1, then the X—axis coordinate for the display assumes 2*ispace*increment, ispace*increment, 0, values ..., (npoints—1)*ispace*increment. npoints The number of istart The array subscript increment The indexing factor for the array subscripts. DIS adds increment to the preceding subscript to obtain the subscript of the next point to display. The starting subscript is istart. TIf increment 1is argument must points to be greater of display. than zero. the first displayed from 1iydata. The be a legal subscript within array liydata. 1, then istart the points through 1-16 displayed (istart + The npoints point to be istart argument must the bounds of the have subscript npoints - values 1). Tf RT-11 FORTRAN increment have 1is greater values 1istart (npoints array Error EXTENSIONS - 1). No subscript than error goes 1, then through message out of the istart subscripts + increment* appears when bounds. the conditions: SYNTAX ERROR The ARGUMENT The required five arguments are not present. ERROR number greater of points than requested (npoints) is less than 1 or 4096. The subscript of was less 1. The increment than the first specified point was less to be than displayed 1 4095, or (istart) greater than Interactions: DIS requires the horizontal the next spacing factor (ispace) CLRD. DIS displays scope control. A displayed by DIS, receive the next of a point to the 22 microseconds. not sufficient only other to data point hardware on every 1interrupt calculated interrupt occurs from after each by the point telling DIS that the scope control is ready to data point. The time interval from the display occurrence of an interrupt may be as brief as Therefore, the remaining machine resources are allow routines much that data are processing guaranteed to or computation. be running The are other scopes 1is narrower the D/A converters. than For interrupt handling routines (for example, the <clock~interrupt service routine) and completion routines. Therefore, the most practical way to stop DIS displays 1is to call SDIS in a completion routine. Restrictions: The range the of range example, voltages accepted by some of voltages produced by full scale (U to 40Y5) for the converter may represent 5.12 volts. However, the scope control may accept display voltages in the range -5 to +5 volts. Therefore, digital values 0 through 47 and 4048 through 4095 are not displayed on those scopes, and displays including those values hang off the -5.12 to edges of the screen. arrange the arguments and To avoid losing data so that data the with these first 47 scopes, screen positions correspond to nondisplayable Fill the data array with displayable displayable values have X coordinates data in the data array. values so that the in the range 48 through 4047. the The scaled Y values should be 4047. in range 48 Negative data values, or values greater than 4095 (1023 ARll) are nondisplayable. A point with a value greater (1023) is treated as if its value were -1. through for than the 4095 Each point is intensified every npoints interrupts. The amount of flicker in the display depends on the number of points and the persistence of the phosphor in the scope. Nondisplayable points are not ignored but are processed as if they were appearing on the screen. number of 1Tf flicker nondisplayable is a problem, points being first try "displayed." to reduce the RT-11 FORTRAN EXTENSIONS Examples: The horizontal There is a data array l0u0 points long. 1. factor ISPACE was calculated in a prior call to CLRD. (a) spacing You want to display the last 8UU points in the array. CALL DIS(IDATA,ISPACE,800,201,1) (b) You want to display a data window of the middle 75U points, displaying every fifth point. CALL DIS (IDATA,T1SPACE,150,120,5) 2. The following example is a complete short program designed for a The example calls the routine SETR to control the refresh-type scope. duration of the display and to set up the call to the completion routine containing the command to stop the display. DIMENSTION ISCREEN (4096) EXTERNAL STOPS CALL CLRD(ISCREEN,4096,ISPACE,0.0) : : DO 10 TI=48,4047,20 ;Array to be dispiayed. ;Completion routine name ;declared EXTERNAL. ;Make array ;jnondisplayable and ;ispace=l. ;DO limits chosen to ;£il1l1 screen. ;for diagonal sPut values 10 ISCREEN (T) =1 20 NPTS=200 IFLG=0 CALL SETR(5,0,1u00.,IFLG,,STOPS) CALL DIS(ISCREEN,ISPACE,NPTS,48,20) in ISCREEN line. ;Specify 200 points. ;Set up SETR flag. :Time for 10 sec, then ;call the completion ;routine STOPS. ;Display every 20th ;point in ISCREEN ;starting with ;48th the point. PAUSE :Wait for keyboard GO TO 20 ;Display line again. ; input. END SUBROUTINE CALL SDIS RETURN END STOPS : ;Stop the display. RT-~11 FORTRAN EXTENSIONS DRS 1.4.4 DRS DRS (Digital mediates Read-in repeated Sampling) sampling from Routine a digital or LPSDR~A) or from a memory location. digital sampling capabilities beyond the you can acquire using TIDIK. DRS collects multiple samples from a single location. Use multiple memory locations. calls DRS capabilities. provides three basic to DRS to Single-sweep sampling. Using DRS, sequence of digital input register parameters that direct DRS to stop with data. 2. Continuous input data sampling: the total and specify You register input sample l. DRS, input (DR11-K The DRS routine extends single register reading wunit or from multiple you can readings after it your that memory units or acquire a short by specifying the £fills an array sampling. Using DRS, you <can acquire digital continuously. There are two classes of continuous finite continuous sampling, in which vyou define number of samples to be acquired in the call to infinite the specify total the continuously, continuous number of parameters and either sampling, samples in directing designate a in which the call DRS to you to do acquire completion not DRS. data routine or arrange your program code to empty the arrays periodically. You designate the completion routine in the SETR call if you are acquiring data on clock interrupts; you designate the completion routine directly from DRS if you are acquiring data on interrupts from the digital input interface. TIf you request infinite continuous sampling, you must call DRS again to stop sampling. You provide the completion dispose of the data as you can write the data means or Because 3. routine to empty the arrays and required by the problem. For example, to secondary storage or reduce it to counts. the completion routine requires time to execute, the maximum continuous sampling rate (involving routine) is lower than the maximum single-sweep (not involving a completion routine). a completion sampling rate End mode sampling. Call infinite continuous DRS DRS is called as a subroutine. depends on the capabilities you Single—-sweep CALL in parameter—adjustment to stop sampling. The number of are requesting. arguments necessary sampling: DRS (iarrayname,iarraysize,, [nsamples], [isource],iunit, imask, [imode],iendflag#,nleft) RT-11 FORTRAN EXTENSIONS Continuous (a) Clock-interrupt—driven continuous sampling ( iarrayname,iarraysize, [nsubarrays], [nsamples], [isource],iunit,imask, [imode],iendflag#,nleft#) DRS CALL (b) sampling: Event-driven continuous sampling ( iarrayname,iarraysize, [nsubarrays], [nsamples], [isource],iunit, imask, [imodel], 1endflag#,nleft#[, DRS CALL [intervall,completel) End sampling: Specify parameter-adjustment mode by omtttlng imode can be the register or altered. iarrayname. Only The values of isource and iunit specify The rest location for which sampling is to stop. be the same of the variable names are dummy arguments that should in the original DRS call. as the names DRS CALL (, iarraysize,,, [isource],iunit, imask, imode?*, iendflag,nleft) The arguments are: iarrayname The name of the integer array in which DRS places If you omit iarrayname, 1.2.6). Section imode for call expects a negative value the DRS end to sampling, DRS continuous For data. input the (see array circular a treats the data array as . sampling. iarraysize The length of iarrayname (in words) . The iarraysize argument specifies the amount of memory reserved by your program for input data. nsubarrays The number of array partitions in iarrayname. The The length of number of partitions is 1. default 1in each partition is equal to the largest integer with exanmple, For (iarraysize/nsubarrays). iarraysize = 512, and nsubarrays = 5, there are and 12 1long, words 100 each partitions, five unused words at the end of iarrayname. The value to of nsubarrays must be iarraysize. With less continuous than or sampling, there must be at least partitions (see the interval description). Single—sweep sampling require array partitions. nsamples equal double-word two array argument does not The number of samples required. A single sample is either a single data word or a pair of words, depending on the mode specified. The default value of nsamples is iarraysize. With single—-sweep sampling, set nsamples equal iarraysize for single—word sampling modes; nsamples equal double-~word to half sampling assign the value you want to stop to the the value modes. With continuous sampling, you nsamples depending on how 1-20 iarraysize to set for of RT-11 FORTRAN sampling process. set nsamples want. TIn For this then < isource DKS with a The flag Lnput value continuous number of sampling, samples you iarraysize negative reads calling the continuous any nsamples DRS finite to case, > infinite to For equal nsamples equal EXTENSIONS sampling, nsamples U data until again 1in negative set number. value indicating you stop sampling parameter—adjustment for imode. whether register or a memory of isource is zero. Value by mode to read location. a digital The default Meaning Zero Read the digital specified by input 1iunit. 1In register the reading the register, DRS bits (and only those bits) process clears that it of those finds set. rionzero Read the appears iunit The location of memory 1in the location data to be Value U address read. Meaning through 7 or 0 whose iunit. through 8 Logical unit digital 1input U—-through-7 up to numbers values eight interfaces. LPSDR~A, LPSDR-A, values DR11-K (The select DR11-K the then and 0 The one of digital 1/0 1f the includes configuration with for registers. an system LPS11 selects the the 1l-through-8 select one of digital 1TI/0 up to eight interfaces. value of 1isource must be Zero.) U,2,...,"177776 Memory address address must (The value selected. be of an even 1isource The number. must be nonzero.) imask The value performs value, used a and For the 1input AND using imask of the Request (decimal) single-word format the mask stores iarrayname. either as -1 imode to logical the interrupts result a or sampling, value driving 1-21 to in the mask with as "177777 imode be the read value. and data sampling. input array, all bits (octal). specifies and DRS the the the on data source of RT-11 FORTRAN EXTENSIONS For double-word sampling, imode specifies the data format of the value to be read, the source of the interrupts driving the sampling, and the contents of the For second word. parameter adjustment, imode specifies the stop code. The default value of imode 1is zero. Single-word sampling. In single-word sampling contents of the digital location into sampling codes the are: modes, DKS reads the register or the memory array. The single-word data Value Meaning 0 Read unsigned BCD data from or memory location on clock 1 Read binary data from the register memory location on clock interrupt. 4 Read or unsigned memory BCD data 1location from the register interrupt. the or register on a digital event interrupt. 5 Read binary data from memory location on the register or a digital event interrupt. Double-word sampling. There are two kinds of double-word sampling: double-word sampling with bit location, and double word sampling with time stamping. In both, the first word of the pair contains the register or memory value. In double—-word sampling second word of the pair of the rightmost with bit location, the contains the bit position nonzero bit 1in the nonmasked portion of the input value. That is, DRS performs a logical AND between the input value and the complement of the mask, and then scans right to left for a nonzero Dbit. Tt assigns the bit position (U to 15) as the value of the second word. TIf no bits are on, the second word of the pair 1is sampling set to -1l. You request double-word with bit location by adding 2 to any of single-word sampling codes to obtain codes 2, the 3, 6, and 7. In double-word second word clock reading sampling of at with time stamping, the the pair contains the software the time of the digital event interrupt. The clock value does not change. The time—-stamping option 1is available only with digital event interrupts. You use double-word sampling with concerning register) time what and when 1-22 stamping to happened it happened obtain (the (the information digital input software-clock RT-11 FORTRAN EXTENSIONS reading). You request double-word time stamping by adding 8 to modes obtain codes 12 and 13. The double-word sampling Value codes sampling with 4 and 5 to are: Meaning 2 Double-—word 3 6 sampling Read and convert clock interrupt. Double-word sampling Read data binary Double-word Read and digital 7 on event bit with location. BCD bit clock sampling convert Double-word Read with unsigned data on location. interrupt. with bit unsigned location. BCD data on interrupt. sampling binary with data bit on location. digital event interrupt. 12 Double-word Read and digital 13 sampling convert event Double-word Read with time unsigned stamping. BCD data on interrupt. sampling binary with data time on stamping. digital event interrupt. End sampling. Each parameter—-adjustment sampling If you from are location, each one sampling use input from one unit The stop more to be mode than by code values Finish or call for (Request omitting the are: sampling any Finish for Stop more the reading not Stop for queue reading queued the array current Do not honor routine requests. completion do current queued completion run, but do not requests. sampling partition. completion -1 unit Meaning gueue -2 stops location. one stopped. partition. Allow routine requests to -3 DRS memory argument.) Value -4 to or parameter—-adjustment parameter—-adjustment iarrayname call unit data. routine any data. completion Allow requests more any to array queued queued run, but requests. Do routine not honor requests. any RT-11 The iendflag FORTRAN EXTENSIONS completion iendflag to and/or =zero error flag. before you You call must DRS. set DRS increments 1iendflag either when all samples requested have been acquired or when sampling has ‘been stopped by a stop code (negative value for imode). DRS sets If a data overrun or other error 1endflag to a negative value. occurs, The array partition flag. DRS 1initializes nleft with the number of array partitions specified by nsubarrays. DRS decrements nleft by 1 each time an array partition becomes full. Thus nleft contains the number of partitions currently available to DRS. The nleft argument is meaningful only with continuous sampling. Remember to 1increment nleft when you remove data from a full array partition so that the partition nleft can be reused. If nleft becomes zero before the number of samples requested 1in nsamples has been acquired, a data overrun has occurred. DRS then sets 1iendflag to indicate interval an error. The number of interrupts between <c¢alls to the completion routine. DKS initializes an internal variable to interval and decrements it after each interrupt. When the value is zero, DRS reinitializes the internal variable and causes the completion routine to be called. Therefore, the completion routine is executed whenever interval interrupts have occurred. The default value for interval is the length of the array partition, iarraysize/nsubarrays. With single-word sampling, the default value for interval causes the completion routine to be executed as each array partition is filled. With double-word sampling, the default wvalue for interval causes the completion routine to be executed after two array partitions have been filled. Completion~routine name. The completion routine that you provide 1is executed after interval interrupts have occurred. There 1is no default completion routine name. If you omit the completion routine name in digital event driven modes, DRS does not call a completion routine. 1In clock—-driven modes, you must omit the completion routine argument and instead specify any necessary completion routine 1in the <call to. the clock routine, SETR. complete Error conditions: SYNTAX ERROR There ARGUMENT are fewer than 1U, or more than The ERROKR digital input register The memory address (iunit) specified requested (imode) is The in mode parameter-adjustment (iunit) mode. 1-24 12, arguments specified is negative does present. not exist. an odd number. but the call 1is not RT-11 DEVICE FORTRAN EXTENSIONS CONFLICT The digital input register is in use. Interactions: In clock~driven sampling completion-routine name modes, in the you SETK must designate any call. Restrictions: DR5 allows registers once name you to (and the as LPSDR-A, many if as eight present) DR11-K each of mode. the You units can designate running in digital simultaneously. for each unit you want to read, specifying a for each unit. Each unit can run in either event—driven for sample a unique event-driven 1input Call DRS different array clock-=driven or completion routine mode. kxamples: l. You want minute. clock to DKS read reads overflow UDIMENSION digital one word input of register binary data 5 once into each second for one on each the array MIN data array. interrupt. iSet up TEND=U MIN (oU) ;End TENDC=0 ;End flag flag CALL DRS (MIN,00,,,,5,-1,1,TEND,TFULL) CALL SETR(5,1,100.,TENDC) ;Request sampling. ;Start clock at 1 Hz. CALL LWATT(TEND, Q) ;Wait for 60U CALL s&8TR(-1,,.,) ;Stop the clock. for for DRS. clock. samples. 2. You want to read 60 samples of BCD data from digital input register 3 on digital event interrupts. You are interested only in the high-order byte, so you mask off the low-order byte. DIMENSTON MIN(6U) iSet ;End TEND=0 3. a CALL DRS (MIN,60,,,,3,"177400,4,1END,TIFULL) CALL LWATIT(IEND,OQ) You want to completion double—-word read sampling status on with appears twice, once completion routines. (a) sRequest sampling. iWait for 60 samples. the routine up data array. flag for DKS. register every time with digital stamping completion for DR11-K event using unit 0 and interrupt. You execute reguest mode 13. The example routines, and once without This example uses a completion routine. The example assumes the interrupts occur at a rate slow enough to allow completion routine to execute fully between interrupts. DIMENSTON EXTERNAL TREG(4) COMPL iSet up ;Label ;End the array. completion s EXTERNAL., TEND=0 that flag for DRS. routine RT=11 CALL FORTRAN EXTENSIONS DRS(IREG,4,2,-1,1,"167770,-1,13,TEND,TFUL,1,COMPL) ;Request sampling. SUBROUTINE COMPL for ;jCompletion routine. example, issue control instructions acquire or process data compute examine conditions to decide IF (TDONE.EQ.1l) GO TO 1lu TFUL=2 10 if done :Go to 1lU 1if finished. ;Reset available space ;jpointer. RETURN ;Return 1f more to do. CALL DRS(,4,,,1,"167770,-1,-~1,1END,TFUL) ;Call DRS with stop ;code=~1. RETURN You can achieve DIMENSTON the same function without IREG(4) completion ;Define TEND=0 ;End DRS(IREG,4,2,-1,1,"167770,-1,13,TERD,TFUL) CALL LWATT(IFUL,2) ;Start 10 do ;Wait whatever 1is required, for issue control instructions acquire or process data data destination. flag CALL routines. for DRS. sampling. for an interrupt. example compute examine go to 2U conditions if to decide if finished finished TFUL=2 20 GO TO 1vU CALL DRS(,4,,,1,"16777v,-1,-1,1TEND,TFUL) . ;Reset available space ipointer. ;Go wait for next event. ;Stop DRS with imode=-1l. RT-11 FORTRAN EXTENSIONS DXY 1.4.5 DXY The DXY (Display continuously continuous Tektronix 6U4). X-Y Data Pairs) displays X-Y data pairs contained in two data arrays. display is used for refresh-type scopes (for example, DXY plots are not associated displays one data that displays the Y values DXY so DXY constantly the arrays The data it plots after to be Routine it correlational point on points data has with each as displayed displayed must be or any spaced, interrupt from quickly points, data, equally as the data 1in ordered X the scope scope can starting again at the the point in the in last two arrays. The which values. control, receive them. beginning of arrays. X—axis data array contains the horizontal displacement of each point to be plotted. The Y-axis data array contains the vertical displacement of each point to be plotted. The displacements are relative to (0,0) in the lower left corner of the two value fifth The is the fifth element of element of the Y array. data that CLRD to elsewhere is 0 the ke 40953 range of scale in must to the called CALL The values 1is, compress DXY the screen. The X-Y arrays. That 1is, as the X array, the range that (U to 1U23 for and Y You X can program with a are in corresponding positions in the fifth pair to be plotted, the X for in the them. pairs data also and can be Y arrays value plotted the AR1ll). transform FORTRAN the on You the can independently or scale the 1is the scope, expand or by using data arrays manipulations. subroutine. DXY(ixdata,iydata,npoints,istart,increment) arguments are: ixdata The name X-axis iydata The name Y-axis of values of values npoints The number istart The array of the for 1integer the the for X~Y array pairs 1integer the points subscript X-Y the first increment and 1iydata. The indexing factor for the array be to be pair the displayed. containing to be plotted. The istart argument subscript within the bounds of the - be array pairs (X-Y pairs) of containing to the displayed. plotted. of points must be arrays a to legal ixdata subscripts. DXY adds 1increment to the preceding subscript to obtain the subscript of the next pair of values to be displayed. Tf increment is 1, then the pairs displayed have subscript wvalues 1istart through (istart + npoints - 1). Tf increment is greater than 1, then the subscripts have values 1istart through (istart + increment* (npoints - 1)). The increment argument must be greater than or equal to 1. No error message appears when the array subscript goes out of bounds. RT-11 FORTRAN EXTENSIONS conditions: Error ERROR SYNTAX The ARGUMENT required five arguments are not present. ERROR greater than 1 or than The array subscript of 40UY6. the first (istart) is less than 1. The increment requested is greater pair than 1is (npoints) The number of pairs of points to display to less displayed be 4096. Interaction: DXY displays the next data point on each interrupt from the scope interrupt occurs after each point A scope-control control. displayed, telling DXY that the scope control is ready to receive The time interval from the display command the next data point. 22 as interrupt may be as brief to the occurrence of an Therefore, the remaining machine resources are not microseconds. The computation. or sufficient to allow much data processing are other running be to guaranteed are that routines only keyboard or interrupt handling routines (for example, the clock Therefore, service routines) and completion routines. interrupt the most practical way to stop a DXY display is to call SDIS from a completion routine. Restrictions: than narrower is The range of voltages accepted by some scopes For D/A converters. the by produced voltages of range the represent may example, full scale (U to 4095) for the converter to -5.12 +5.12 wvolts. the scope control may accept However, values Therefore, digital voltages in the range -5 to +5 volts. U through 47 and 4U48 through 4095 are not displayed on those scopes, and displays including those values hang off the edges of To avoid losing data with these scopes, arrange the screen. the screen positions 47 first the that so data and arguments Scale both to nondisplayable data in the data array. correspond 48 range the 1in the X and Y arrays to have displayable values through Data 4047, values greater nondisplayable. than 4095 (1023 for the AR11) A point with a value greater than 4095 treated as if its value were -1l. Each point is intensified every npoints interrupts. (1lU23) The are is amount of flicker in the display depends on the number of points and the Nondisplayable points persistence of the phosphor in the scope. but are processed as if they were appearing on ignored not are the reduce to try 1If flicker is a problem, first the screen. number of nondisplayable points being "displayed." Example: 1. The example draws a horizontal line and a vertical line to divide the screen. into quadrants. The display 1is stopped by SDIS in a completion routine that is designated in the call to SETR and executed after approximately one minute. RT-11 EXTERNAL FORTRAN EXTENSIONS STOPS TNTEGER CALL XDATA (4U96) ,YDATA (40Y6) CLRD (XDATA, 4096 ,TDUM, 0.0) ;Clear X array. CALL CLRD (YDATA,4096,TDUM,0.0) ;Clear Y array. DO 10 T=44,4047,5U ;Make horizontal ;Make vertical line. XDATA (T) =1 1lu YDATA (T)=2044 DO 2U T=73,4047,50 line. XDATA (1) =2048 20 YDATA (T) =1 NPTS=160 30 ;Number of ;jdisplay. points to TFLAG=0 ;End CALL SETR(5,0,6000.,IFLAG,,STOPS) ;Time 1 minute; then ;execute completion ;routine STOPS. ;Display the arrays. ;Wait for keyboard input. CALL DXY (XDATA,YDATA,NPTS,48,25) PAUSE GO TO 30 ;Go flag start for SETR. display again. END SUBROUTTNE CALL SDIS RETURN END STOPS ;Completion ;Stop the routine. display. RT-11 FORTRAN EXTENSIONS FLT16 l.4.0 FLT16 (l6-bit Floating-Point Conversion) FLTlo converts a lo-bit unsigned binary integer Routine to real-number format. A le-pbit wunsigned binary integer (with octal values U to 177777) has decimal values of 0 to 65535, (These values are in contrast to most integers which are stored in two's complement binary and can assume decimal values -32768 through 32767.) You must use FLT1lé for unsigned binary values 1instead of the FORTRAN function FLOAT because FLOAT converts two's complement binary, not unsigned binary. FLT16 is called as a function. rvalue = FLT1lo (ivalue) The arguments are: rvalue The real-number ivalue The unsigned real value. Error form of binary the integer integer to be argument. converted conditions: SYNTAX ERROR There is not exactly one argument present. Interaction: Unsigned binary values are acquired binary value by IDIR, Restrictions: None Example: l. Consider 1111 the 111 unsigned 111 111 IBINRY: 111 If VALUE=FLT16 (IBINRY) then VALUE contains the real-number form of 65535, form of -1. If VALUE=FLCAT (IBINARY) then VALUE 2. contains Consider 1 0uU the VU0 the real-number unsigned OVUO OULU 00U binary value IBIN: DRS, and IDOR. to a RT-11 FORTRAN EXTENSIONS If VAL=FLT16 (IBIN) then VAL contains the real-number form of 32768. 1f VAL=FLOAT (IBIN) then VAL contains the real-number 3. You want to DIMENSTON TFLG=0 determine the time form of -32768. interval IEVENT (4) ' ISFLG=U CALL between two events. ;Set ;End up data array. flag for DRS. ;End flag DRS(IEVENT,4,,2,,1,-1,13,1IFLG,NLEFT) ;Read ;word for SETR. register 1, double sampling with time ;jstamping in event-driven ;mode. CALL SETR(4,1,1.,ISFLG) CALL LWAIT(IFLG,O0) TIME=FLTlo (TEVENT (4) )~FLT16 (IEVENT (2)) ;SETR runs the software ;iclock in msec. iWait for end of ;sampling. ;Interval in msec. 1Go on to examine ;digital the registers. RT-11 FORTRAN EXTENSIONS FSH 1.4.7 FSH (Flash) Routine FSH displays all points in a data array once, that is, "flashes" them on the screen. However, you can use FSH for continuous displays if you have a storage scope (for example, Tektronix 603), or if you use a completion routine to refresh the display for refresh—-type scopes (for example, Tektronix 604). FSH displays Y—-axis data on the scope. The routine assumes that if X-axis values were provided, they would be equally spaced increasing values. Logically, there are two X values for each ¥ value plotted. One specifies the X <coordinate on the screen where the Y value appears, and the other specifies the array subscript where the Y value can be found. The X coordinate and array subscript for a single point usually have different values. You do not have to provide explicit X values. The X-coordinate value 1s controlled by an X-axis spacing factor, whereas the array subscript value is controlled by an indexing factor (see the ispace and increment argument descriptions). FSH is called as a subroutine. CALL FSH(iydata,ispace,npoints,istart,increment) The arguments are: iydata ispace ‘ The name scaled Y~axisldata of to 1integer array The factor. You must X-axis calculate is 1 and the spacing 1, the X-axis 0, (npoints = containing call CLRD the to 1ispace before you call FSH. TIf ispace 1increment 1is 1, then the X~axis coordinate for 0,1,2,..., (npoints values be displayed. the -1). display If ispace coordinate for the assumes values is greater than display assumes ispace*increment,?2*ispace*increment,..., 1l)*ispace*increment. npoints The number of argument must points to display. be greater than zero. The npoints istart The array subscript of the first point to be displayed from iydata. The istart value must be a legal subscript within the bounds of the array iydata. increment The indexing factor for the array subscripts. FSH adds 1increment to the preceding subscript to obtain the subscript of the next point to be displayed. The starting subscript is istart. 1If increment is 1, then the points displayed have subscript values istart through (istart + npoints - 1). TIf increment is greater subscripts have values increment* (npoints - 1). if the array subscript than 1, then the 1istart through istart + No error message appears goes out of bounds. RT-11 Error FORTRAN EXTENSIONS conditions: SYNTAX ERROR There ARGUMENT are not exactly of points five arguments present. displayed (npoints) ERROR The number zero or The greater increment greater The than for than be is of the the less than 40Y6. array subscript 1is less than 4uYe. subscript less to than first point to be 1. displayed 1 or (ifirst) is Interactions: A CLRD have You call calculating preceded can the FSH obtain a FSH from calling the display continuous a display completion whenever your completion routine completion-routine execution (the parameters you the routine SYSLIB spacing factor (ispace) call. specify when you on a refresh-type routine. FSH refresh initialize scope then executes. must by executes The rate depends on rate) the clock (in ITIMER). of the SETR or Unlike continuous displays with DIS and DXY, the completion routine method of obtaining continuous displays may not use all the machine resources. The amount of time remaining depends on the number of points 1in the display and on how often the completion routine executes. Your FORTRAN program might be able to process the screen. data or perform computations while the display is on Restrictions: The range the of range example, voltages accepted by some voltages produced by of full scale (0 -5.12 to 5.12 voltages in the range 0 and through scopes, the To arguments and correspond to array X with data Data be in values in the so as if that the range range 48 A its narrower than converters. For converter may represent value were with these 47 data that the the off screen Fill values scaled not the ignored screen. number of 1If but are flicker is (1023 value Y values for greater the than AR11) are 4095 (1023) -1. nondisplayable processed a the have 4047, kach point is intensified every npoints interrupts. The of flicker in the display depends on the number of points persistence of the phosphor in the scope. Nondisplayable are problem, points of the positions array. The those edges arrange displayable 4047. accept values on the scopes, in through a displayed hang first 4095 with not the so 48 are values data through than point 4095 those data values greater nondisplayable. treated through losing displayable the 1is D/A the scope control may volts. Therefore, digital +5 nondisplayable coordinates should to including avoid for the However, -5 4048 displays screen. 4u95) volts. 47 and to scopes being as if they first were try is amount and the points appearing on to reduce the "displayed." Examples: 1. The storage following scope. example The is a example complete erases 1-33 short the program screen and designed plots a for a diagonal RT-11 FORTRAN EXTENSIONS at line of points that remain on the screen until you press aonlykey, way to which time it erases the screen and replots the line. The the a CTRL/C, After you enter 1f you want to clear the screen, type for system the reboot or INTT after the monitor dot for RT-11 SJ, stop the program is to enter a CT scope RT-11 in storage mode. remains FB. INTEGER SCREEN (4096) CALL ERASE CALL CLRD (SCREEN,4096,TIDELT,0.U) DO 10 T=45,4047,3 ;Set space. array up :Be sure screen is blank. sMake SCREEN nondisplayable. ;DO limits chosen to fill ;jscreen. 10 =1 (T) N SCREE ;Create points for diagonal ;Print 20 NPT=1333 TYPE 20,NPT NO. FORMAT (/" 3u ;line. ;No. of points to display. message. OF POINTS DISPLAYED =',15) ;Display CALL FSH (SCREEN,IDELT,NPT,4t,3) array. for keyboard entry. PAUSE ;Wait CALL ERASE GO TO 30 ;Go display line again. ;Erase screen. END SUBROUTINE ERASE ;You write this routine. IFLAG=0 ;Initialize flag for SETR. CALL IDOR(1,"170446,2,0) :Clear erase bit thus starting CALL IDOR(1,"1704406,"0,"0) CALL SETR(4,0,250.,IFLAG) CALL LWAIT(IFLAG,O0) ;Turn on storage mode and ;non—-erase flag. ;jerase cycle. ;Start 250 msec interval to ;swait for settling time. ;Wait for end of interval. RETURN END 2. on The following example shows the use of FSH for continuous displays refresh-type scope (for example, Tektronix 604). FSH is from within a completion routine which is executed on interrupts called from the programmable clock. EXTERNAL COMMON SHOW TYDATA (4V96),N,ISP CALL CLRD(IYDATA,4096,18pP,0.) DO 1u I=48,4047,20 ;Define the completion ;routine. ;Make array available to ;completion routine. ;Make TYDATA nondisplayable. ;DO limits chosen to fill ;jscreen. 10 TIME=100. ;Fill array with points. ;No. of points to display. ;Time interval between calls IFLAG=U ;msec). ;Flag for =1 LYDATA(I) N=200 CALL SETR(4,1,TIME,IFLAG,,SHOW) PAUSE CALL SETR(-1,,,) ;to the completion routine SETR. ;Get clock going and prepare ;for ;Wait :Stop completion routine. for the keyboard clock. entry. END SUBROUTINE SHOW COMMON TYDATA (4096),N, ISP CALL FSH(IYDATA,ISP,N,48,20) RETURN END (in ;Completion routine. ;Display the array. RT-11 FORTRAN EXTENSIONS FXY 1.4.8 FXY FXY (Flash X-Y Data Pairs) displays screen). a storage X-~Y data completion routine example, Tektronix You can pairs However, you scope (for use FXY associated plot any equally scatter—-plot data). FXY X-Y displays once data (that 1is, "flashes" can use FXY for continuous example, Tektronix ©603), to refresh 6U04). to with Routine the display data 1in spaced, pairs for which the in two Y the scopes wvalues X values data on if you have vyou use a refresh-type increasing contained them displays or 1if are (for arrays. (for not example, The X-axis data array contains the horizontal displacement of each point to be plotted. The Y-axis data array contains the vertical displacement of each point to be plotted. The displacements are relative to (0,U) 1in the 1lower 1left corner of the screen. The X~-Y pairs are in corresponding positions 1in the two arrays. That is, for the fifth pair to be plotted, the X value is the fifth element of the X array, and the Y value is The data must that values 1is, 0 compress the CLRD to elsewhere FXY is fifth element of be to 4095 range of scale in the in the range that (0 to 1023 for and Y the them. the Y X You can data also can array. be plotted the AKll). arrays transform on You the independently or scale scope, can expand the or by using data arrays the program with FORTRAN manipulations. called as a subroutine. CALL FXY(ixdata,iydata,npoints,istart,increment) The arguments ixdata are: The name X-axis iydata The of name Y-axis the values for of 1integer the the values for array pairs 1integer the npoints The number of points istart The array X-Y subscript X~Y the be array pairs first be increment the displayed. to be plotted. pair be plotted. The istart argument subscript within the bounds of the and the displayed. containing to (X-Y pairs) of containing to of points must be arrays a to legal ixdata iydata. The indexing factor for the array subscripts. FXY adds 1increment to the preceding subscript to obtain the subscript of the next pair of values to display. Tf 1increment 1is 1, then the pairs displayed have subscript wvalues 1istart through (istart + npoints - 1). If increment 1is greater than 1, then the through Increment must error message out: bounds. of subscripts (istart be + greater appears 1f have values istart increment* (npoints than or equal the array to - 1). 1. No subscript goes RT-11 FORTRAN EXTENSIONS Error conditions: SYNTAX ERROR There are not exactly five arguments present. ARGUMENT ERROR 1is The number of pairs of points to display (npoints) than 1 or greater than 40Y6. The array subscript (istart) of is less than 1. the £first pair to be less displayed The increment requested is greater than 4U96. Interactions: You can obtain a continuous display on a rerresh-type scope by FXY then executes calling FXY from a completion routine. of rate The whenever your completion routine executes. completion-routine execution (the refresh rate) depends on the parameters you specify when you initialize the clock (in SETR or the SYSLIB routine ITIMEK). the DXY, and DIS with displays continuous Unlike completion-routine method of obtaining continuous displays may not use all the machine resources. The amount of time remaining depends on the number of points in the display and on how often the completion routine executes. Your FORTRAN program may be able to process data or perform computations while the display is on screen. the Restrictions: than 1is narrower The range of voltages accepted by some scopes For the range of voltages produced by the D/A converters. represent may converter the for 4095) to (0 scale example, full to -5.12 +5.12 volts. However, voltages in the range -5 to +5 volts. U through the scope control may accept Therefore, digital wvalues 47 and 4048 through 4095 cannot be displayed on those scopes, and displays including those values hang off the edges of the screen. To avoid losing data with these scopes, arrange the arguments and data so that the first 47 screen positions Scale both correspond to nondisplayable data in the data array. range 48 the in values e displayabl have to the X and Y arrays through Data 4047. values greater nondisplayable. than 4095 (1023 for the AR11) A point with a value greater than 4095 (1023) treated as if its value were -1. Each point is intensified every npoints interrupts. The are is amount of flicker in the display depends on the number of points and the persistence of the phosphor in the scope. Nondisplayable points are not 1ignored but are processed as if they were appearing on 1If flicker is a problem, first try to reduce the the screen. number of nondisplayable points being "displayed." Examples: The following example shows the use of FXY for continuous displays 1. FXY is called from within a completion with a refresh-type scope. The routine which executes on interrupts from the clock counter. example program draws a horizontal line and a vertical line to divide the screen into quadrants. RT-11 COMMON FORTRAN EXTENSIONS TXDATA (40906),IYDATA (4096),N sMake arrays jcompletion EXTERNAL SHOW ;Define available to routine. completion routine sexternal. CALL CLRD (TXDATA,4096,TISP,U.) CALL CLRD(IYDATA,40%6,1I5P,U.) DO 10 T1=48,4047,5u ;Empty X array. ;Empty Y array. ;Create horizontal line. IXDATA (T)=1 10 TYDATA(TI)=2u4s DO 20 T1=73,4047,50 ;Create vertical TYDATA(I)=I N=loU iNo. of points IFLAG=0 ;End flag line. IXDATA (T)=204Y 20 TIME=100. ;Refresh for to display. SETK. rate is luu clock iticks. CALL SETR(4,1,TIME,TIFLAG,,SHOW) iStart clock in msec, ;designate completion ;routine PAUSE CALL SETR(-1,,,) SHOW. ;Wait for keyboard ;Stop the clock. entry. END SUBROUTINE COMMON SHOW ;Completion IXDATA (40906),IYDATA (4096),N ;Data routine. arrays from main ;orogram. CALL FXY(IXDATA,TY¥DATA,N,48,25) ;Display arrays. RETURN END 2. The on a following storage example scope. with sampling started by pulse). You can compare the scatter the data use are of FXY to collected an external event the two sweeps of (for data display from data analog 2, example, a stimulus visually by looking at IDATAL(.100G),IDATA2(100) ;Define the data arrays. ICLCK=0 ;End flag for SETR. flag for RTS. TEND=0 ;End NPT=100 ;Length CALL iRequest CALL arrays channel plot. DIMENSTON 10 shows The SETR(5,5,1.,LCLCK) ;with of data clock RTS (IDATALl,NPT,,,2,,1,2,TEND,IDUMMY) sweep. external at start 10UHZz. ;Request single sweep ;100 points on clock of ;interrupts. CALL LWAIT(IEND,O) ;Wait for samples. CALL SETR(-1,,,) ;Stop the clock. TCLCK=0 iReset clock flag. CALL SETR(5,5,1.,TCLCK) iRequest clock TEND=0 iReset RTS end CALL RTS (IDATA2,NPT,,,2,,1,2.TEND,IDUMMY) ;Request CALL LWAIT(IEND,O) ;Wait for CALL SETK(-1,,,) ;Stop the CALL ERASE ;Erase CALL FXY(IDATAl,IDATA2,NPT,1,1) ;Display again. flag. 2nd sweep. 2nd sample. clock. the screen. scatter character plot. PAUSE :Type to CALL ERASE GO TO 10 ;Clear screen. sKepeat whole program. finish. END SUBROUTINE TFLAG=0 ERASE ;Routine sEnd flag to clear for screen. SETR. RT-11 CALL FORTRAN IDOR(1,"170446,6,6) EXTENSIONS ;Turn on snonerase CALL CALL CALL storage IDOR(1,"170446,2,0) ;jClear erase SETR(4,0,250.,IFLAG) jerase ;Start cycle. 250 msec sto wait LWAIT(IFLAG,O0) ;Wait RETURN END 1-38 for mode and flag. for end bit to start interval settling time. of interval. RT-11 FORTRAN EXTENSIONS HIST 1.4.9 HIST (Time Interval Sampling Technique) Routine HIST reads the current value of the programmable clock counter on each and stores the time readings 1in a data array. clock interrupt Depending on the clock mode, you <can time the intervals between (modes 3 and 7) or you can determine the latencies successive events of a series of events relative to a single event (modes 2 and 6). HIST is called CALL The as a subroutine. HIST (iarrayname,iarraysize,nsamples,iendflag#,nleft#) arguments are: iarrayname iarraysize The name of he time data. The length must be samples of integer array iarrayname. greater The number Normally, nsamples the than or of time HIST requested in The equal to interval continues have which been HIST places 1arraysize value 1. values to collect. sampling until all read. However, you can stop sampling before all samples have been collected by calling HIST again with nsamples equal to zero. (In this case, the arguments other than nsamples should be the same as 1in the previous call to HIST.) The nsamples value may be greater than iarraysize, in which case HIST treats the data array as a circular array (see Section 1.2.6). You must write your program to empty the array periodically or the data will be overwritten. HIST itself does not provide any completion-routine option, but you can designate a completion routine in the call to S5ETR. iendflag The completion nleft The flag and error flag. You must set HIST HIST. <call you before 2zero to iendflag increments iendflag when all samples requested have been collected. 1If a data overrun or other error occurs, then HIST sets iendflag to -1. containing available for initializes nleft HIST decrements collected. the data Data number before of array elements HIST to the wvalue 1in 1iarraysize. nleft after each data point is overrun data occurs when overrun. nleft becomes zero before all the samples have been collected. Lf you are removing data from 1iarrayname while HIST is running, you must increment nleft once for Error each point not exactly you remove. conditions: SYNTAX ERROR There are five 1-39 arguments present. RT-11 ARGUMENT FORTRAN EXTENSIONS ERROR The The array size requested is less than 1. number of samples requested is less than zero. Interactions: HIST runs in close conjunction with SETR. You must call SETR to set the clock in an external-event timing mode (mode 2 or 3) and to set the clock rate. You connect the sensor for your external events to Schmitt trigger #2 of the <clock counter. The occurrence of an external event fires Schmitt trigger #2, causing the time of occurrence to be recorded. TIf you want to start the clock with an external—event pulse, connect that event to Schmitt trigger #1 and specify one of the external-start clock modes for external—-event timing HIST by is driven (mode 6 interrupts or from 7). the _ clock counter. Therefore, a completion routine designated in SETR to service clock Schmitt trigger #2 interrupts can process the data acquired by HIST. For example, vyou can tally the data for time interval histograms. You should specify iarraysize so that is half full. an interrupt interval in SETR that is half of the completion routine executes when the array Restrictions: HIST does not work for the ARI1l. The maximum possible time interval that can be recorded depends on the clock counter rate. The maximum count at any clock counter rate is 65535. The faster the rate, the shorter the actual 1interval; the slower the rate, the longer the actual interval. You cannot detect clock overflow. When the increments from 65535 to 0 and continues counter does not give you any signal. to clock count, counter the clock The clock mode (mode Examples: 1. The following counter 3). 1is When example running an event in collects external occurs on Schmitt current clock counter value in automatically resets to zero. DIMENSTION 40 event the time-interval timing from trigger array ITIMES (40) values. zero #2, ITIMES HIST and ;Define base the data places clock array. TFLAG1=0 ;HIST completion TFLAG2=U ;SETR completion CALL HIST(ITIMES,40,4U,TIFLAGLl,IFULL) ;Request CALL SETR(5,3,0.,IFLAG2) ;Start 40U the counter flag. flag. values 1in ; ITIMES. clock ;external ;0 mode. CALL CALL . at event Hz base the samples ;Wait until SETR(-1,,,) thave ;Stop been collected. clock when done. iprocess the or in from LWAIT(IFLAGLl,0) ;Continue all 1U0 program store the to data. RT-11 FORTRAN EXTENSIONS IADC 1.4.10 IADC (Single Analog-to-Digital Conversion) Routine IADC acquires a single digitized value from an A/D converter. (You can acquire multiple digitized values using the RTS routine.) The program requests conversion, pauses within the IADC routine until the conversion is complete, and returns the digitized value as an unsigned integer (0 to 1023 from the ARll, or 0 to 4095 from the ADll-K or LPS1ll). If the A/D converter is operating in unipolar mode, a value of =zero represents 0 volts, and a value of 4095 (or 1023 for the AR1ll) represents the full scale voltage. 1If the A/D converter is operating in bipolar mode, a value of =zero represents the maximum negative voltage, and a value of 4095 (or 1023) represents the maximum positive voltage. Zero voltage corresponds to a value of 2048 (or 512). IADC is As subroutine: a called CALL As a as a subroutine or as a function. IADC (ichannel, [igain],ivalue#) function: ivalue The either = arguments ichannel IADC(ichannel[,igain]) are: The logical channel number The channel numbers are: of the Value 0 through A/D converter. Meaning 63 Channel LPS11-E numbers or for ADl11-K the LPS11l with with AM11-K used in single—ended pseudodifferential mode. 0 through 15 Channel numbers AD11-K with gain for AM11-K the with or LPS1l1l or switched operation. Channel numbers for the ARll and AD11-K,. 0,2,4,,,62 Even-numbered AD11-K differential 0,2,4,,,14 channels with AM11-K for 1in the true mode. Even—-numbered AD11-K wused with channels AM11-K differential mode gain operation. with for the used in switched RT-11 FORTRAN EXTENSIONS |is The default value for igain The gain setting. converting the value is for used gain The 1. The 1ivalue. of 12 and 13 bits in returned values of bits 13 and 12 are 00, 01, 10, possible These decimal). 3 and and 11 binary (0, 1, 2, igain and 4 3, 2, 1, of to gain codes correspond 16, respectively, or to the actual gains of 1, 4, When you request a gain of 1, bits 13 and and 64. 12 always use must return as O. For all other gains, you separate the converted value to CVSWG from the gain bits. The gain codes are: Meaning Value software The autogain. Request optimal gain to use for the determines is Autogain conversion. A/D the available only with switchable gain LPSI11 or AM11-K, systems (AD11-K with 0 with 1 Request gain of 1. This value bipolar mode for the ARlL. 2 Request gain of 4 to multiply the input specifies value This 4. by signal bipolar mode for the ARI1l. 3 Request gain of 16 to multiply the input specifies value This 1l6. by signal unipolar mode for the ARIl. 4 Request gain of 64 to multiply value This 64. by signal unipolar mode for the ARILI. specifies , the input specifies The name of a variable containing the digitized value in bits 0 through 11 (or 0 through 9 for the AR1l) and the gain code in bits 13 and 12. TIf you subroutine, you must include the a as IADC use use you T1f argument ivalue to recover the data. Iis 1ivalue argument the function, a as IADC redundant (because ivalue is returned as the value of the function) and can be omitted. ivalue Error LPSSG). conditions: SYNTAX ERROR There are no arguments, there or are more than three arguments. ARGUMENT ERROR The channel number is greater than 15 for The 1is greater than without AMI1-K. channel number or the LPS11. gain setting is negative 63 for the AR1l or AD1l1-K the AM11-K, The or greater than 4. ADl11-K with RT-11 DEVICE FORTRAN EXTENSIONS CONFLICT Autogain was requested for the AR1ll by specifying 1igain as Zero. ADC CONFLICT A/D conversion is already being done under control of RTS. Interactions: You RTS cannot at write the hardware, a program same and only time. one that would IADC of the and attempt to call RTS the same routines use can execute at TIADC and conversion one time. When the value of igain is not 1, TADC returns a value that is a combination of the digitized value and the gain setting. You can unpack the digitized value in real-number form and the gain used by calling the function CVSWG (see Section 1.4.2). With gains other than 1, input signal by 4, 16, from CVSWG, you 64) if you need the A/D conversion system multiplies the or 64. When you get the digitized value must divide by to restore the the appropriate gain value to the original (4, 16, scale. or Restrictions: Autogain mode does not work with unipolar mode. the Autogain is AR1l. When specify you not requested must available any be in for gain the the other range 0 AD1l-K than to 1, or the the LPS11 channel in number 15. The AD1l-K with AM11-K hardware can be set up with gains of 1, 5, and 50 instead of 1, 4, 16, and 64. Autogain does not work in this case. The meaning of gain codes 2, 3, and 4 depends on the actual gain selected for each group of channels in the AM11-K. Examples: l. Collect a digitized reading from channel 2 with a gain of 1. VALUE=CVSWG (IADC (2)) 2. the Collect value to a digitized value from the original scale. VAL=CVSWG (IADC(1,0) ,IGAIN) VAL=VAL/ (2** (2* (IGAIN-1))) channel 1 with autogain and convert RT-11 FORTRAN EXTENSIONS IDIR 1.4.11 1IDIR (Digital TDIR provides The of four description Input distinct of IDTR Reading) capabilities, is presented the classes of capabilities. IDIK to read a digital using IDIKR to 1input second describes using IOTIR for describes Reading a Digital Routine read the Input Register The two in of three first which section register or are sections, or for describes a memory location. bit and byte manipulation. software related. one The clock. each using The third a Memory Location IDIRK reads one data word from a digital 1input register (DR11-K or LPSDK~A) or from a memory location. 1t performs a logical AND using the data value and a mask specified in the argument list. IDTR is ivalue The called = as a function. IDIR([isource],iunit,imask, [itype][,iwhere#]) arguments ivalue isource are: The masked register or memory value returned IDIR. 1IDIR performs a logical AND using imask the register or memory value, and returns result as the value of the function. The code specifying whether to a memory value. The default by and the read a register or value of isource is zero. The location codes are: Value zZero Meaning Read the logical process clears that it nonzero iunit The be register specified Read the memory location appears in iunit. register number or values for the address possible iunit whose of the address value to are: Value through Meaning 7 or 0 the read. The U by wunit number 1in iunit. 1In the of reading the register, 1IDIR those bits (and only those bits) finds set. ' through 8 Logical unit digital input 0-through-7 numbers values up to eight interfaces. for the registers. The select one of DR11-K digital 1/0 1t the system RT-11 FORTRAN EXTENSIONS Value Meaning configuration with LPSDR-A one and then 1 up to eight interfaces. argument Memory must be 1isource nonzero.) other with a can read the 8 select DR11-K digital (The isource argument can register For the or for (CSR) or example, vyou devices supported be the associated AAll-K bits, registers must read register device. status not LPS1l1 zero.) You control/status some an selects address selected. The must be an even number. address (The 0 through of 1/0 U,2,...,"177776 includes LPSDR-A, by vyou or LPSVC can read that the are FORTRAN extensions. imask The itype wvalue register or wused to mask the memory location. A is one all on either with as The data location. The data bits -1 on. format of The default types Value You (decimal) the Read unsigned memory Read position in the location BCD data location. (U to 15) portion that was IDIR performs value and the Error iwhere or itype data is a of of masked bits memory =zero. of contains the the register convert word is masked binary.) the the with 1logical complement from and from the result from right to If no bits were set in the then of location binary memory Bit bit all "177777. are: binary. (The data it is converted to iwhere request the mask Meaning or nonzero can as register value ' zZero or contents of commonly used AND the to register or rightmost nonzero register or memory =zeros. That 1is, using the the mask, left for part masked value it before a register and scans nonzero -1. with bit. zeros, conditions: SYNTAX ERROR There are specified. fewer than four or more than five arguments RT-11 FORTRAN EXTENSIONS ARGUMENT ERROR The memory address specified in iunit is an odd number. The register requested in iunit does not exist. Interaction: None Restrictions: None Examples: 1. input Reading a digital IDIR(0,0,"1777,1,ISPOT) = IREG register. If the register contains the octal value 51324 0 and 101 the U 001 mask 000 011 is 001 vlo 1777 111 10U (octal) 111 111 1is then the logical AND using the register and the mask Because 1324 as its 0V0 0 conversion binary IDIR also was specified by imode = 1, 1324. octal IDIR returns value. Olu ull 001 examines complement of 10U the the mask: 1 111 0 1ul 0 101 .not. mask register result 1logical AND using the register in the word rightmost bit 2. Reading a memory the 110 000 00Qu WOUL 001 011 Olu 1lov 00U V00 000 000 Scanning the result from right to left, IDIR finds the 12 and returns 12 as the value of ISPOT. bit in bit the and is bit 0.) nonzerc first (Remember that location. You want to obtain the contents of the status register for DR11-K unit Zero. MEMLOC=IDIR(-1,"167770,"177777,1) Bit and Byte Manipulation of a Single Word IDIR provides limited bit manipulation capability the swap in FORTRAN. You can bytes of a single word or shift bits left or right within a word. IDIR is called ivalue The = arguments ivalue as a function. IDIR(,iflag,ibefore,iop[,iresult#]) are: The byte-swapped value or the logical value of the last bit shifted, depending on the value of iop. 1-46 RT-11 iflag FORTRAN EXTENSIONS The flag specifying the bit-manipulation and clock functions of IDIR. The value of ifl ag must be negative. ibefore The value on which bit or byte manipulation performed. iop The manipulation operation The manipulation operations Value 0 is selected. are: Meaning Swaps the upper and lower ibefore, bytes of and returns the new value as the value of 1IDIR. The byte-swapped value 1is also returned as the value of iresult if that argument was specified. The value of ibefore does not change. Shifts ibefore m places to the right and returns the shifted value in iresult. IDIR fills 1iresult from the left with m zeros. The bits shifted out are lost. The value in ibefore does not change. The 1logical shifted out value of the returned 1is =1 or "false" on, and Shifts to ~16 The The or ibefore The value in 1logical shifted out value of returned the 1is on, Error U function if if and 0 or The value bit-shifting resulting ibefore. fewer four value 1is off. to the left and 1in iresult. left out does of not -m 1lost. change. the last in bit ivalue (the function IDIR). or "true" if from with are The value the bit was -1 if was was returned "false" bit bit shifted ibefore the the m places bits 1last bit ivalue (the The value IDIR). "true" returns the shifted value IDIR fills iresult from the Zzeros. iresult value of the 1is returned in the bit was off. byte-swapping or conditions: SYNTAX ERROR There are present. Interaction: None Restrictions: None than or more than five arguments RT-11 FORTRAN EXTENSIONS Example: 1input 1. You want to find out whether or not bit 13 of digitalregister whole the read ly previous have You set. register 2 has been value in binary with the following call: IREG=IDIR(,2,-1,1) You test bit 13 by shifting the register value three places to the left so that bit 13 is the last bit shifted out. You are not interested in the shifted register value itself, so you omit the last argument, iresult: IBIT=IDIR(,~1,IKEG,-3) Reading the Software Clock IDIR reads the current value of the software <clock and performs a logical AND using the clock value and a mask provided in the argument (See Section 1.2.2 on the software clock.) list. IDIR is called as a function. iclock = IDIR(,iflag,imask,) or ivalue = IDIR(,iflag,imask,,iclock#) The arguments are: The masked clock value returned as ivalue the value of 1is returned in iclock if The same value IDIR. IDIR included in the «call. that argument 1is performs a logical AND using the software-clock The value of the software clock value and imask. does not change. iflag The flag specifying the clock and bit functions of imask The value used to mask the IDIR. The value of iflag must be negative. value. software-clock the using AND logical a performs IDIR Request a mask software-clock value and imask. with all bits on either as -1 (decimal) or as "177777. iclock Error The masked clock value. than four or also (This wvalue 1is than five arguments returned as the value of the function.) conditions: SYNTAX ERROR There are fewer more present. Interaction: SETR is responsible for the software clock. The software clock is running only if you have called SETR to turn on the programmable clock counter in repeated interval mode. RT-11 FORTRAN EXTENSIONS Restrictions: IDIR and IDOR can both read the software clock. capability is necessary because there is a subroutines called and a call the same you to read from within from IDIR to maybe reset redundant restriction on FORTRAN program completion routines. A routine designated in the program subroutine. The redundancy of IDIR and completion a This the software completion read the the clock clock clock both routine. within within a from For the within example, program, completion and cannot IDOR both allows the program and you could use IDOR to read routine. Examples: l. Reading the software clock IFL=0 CALL SETR(4,1,1.,IFL) ICLOCK=IDIR(,-1,-1,) End flag for SETR. iRun the clock in smode at 1 sRead lo bits msec of repeated interval rate. software clock. and RT-11 FORTRAN EXTENSIONS IDOR 1.4.12 IDOR (Digital Output Register) Routine two of which are IDOR provides three separate output capabilities, Each of these output capabilities is analogous to an input related. The description of IDOR is presented capability of the function IDIR. The first section describes using IDOR to load a in two sections. The second section digital output register or memory location. describes using IDOR to read and reset the software clock. Loading a Digital Output Register or Memory Location the IDOR changes value of digital a output register or memory The new value of the register or location is determined by location. as by the as well iset, iselect and the value of the arguments algorithm following The location. or register the of value original describes the function of the IDOR routine. location The bits set in iselect specify the bits in the register or If the bit in iselect is 0, the corresponding bit to be altered. if the bit in iselect is 1, position in the register is not changed; the corresponding bit position in the register is altered according to the value at that bit position in iset. the bits The values of the bits in iset specify the action taken for 0, the 1is 1iset in selected bit the If 1iselect. in specified 1if the selected bit in iset is corresponding register bit is cleared; 1, the corresponding register bit is set. are register the in bits then all If all bits in iselect are 1, If altered according to the values of the corresponding bits in iset. all bits in iset are 0, then all bits in the register corresponding to For example, if iselect is -1 (all set in iselect are cleared. those then the entire bits are on) and iset is zero (all bits are off), register is cleared. The logical relationship among the arguments is shown in the following equation: ivalue = (iset.AND.iselect).OR. (.NOT.iselect.AND. (old register)) IDOK is called as a function or a As as a subroutine. function: ivalue = IDOR([idest],iunit,iselect,iset[,ioutput#]) As a subroutine: CALL IDOR([idest],iunit,iselect,iset[,ioutput#]) The arguments ivalue are: The IDOR. function the by The value returned value of the function is the new value loaded into location. memory or the digital output register The and new value is a combination of iselect, iset, or register the of contents original the memory location. 1-50 RT-11 idest The FORTRAN destination location) of EXTENSIONS idest of is (digital the output output Load the logical nonzero Write logical location to unit to be register unit aadress specified number the in value number in by the location whose iunit. or the address of the loaded. Meaning through 7 or U memory iunit. memory appears Value 0 or default Meaning zero The The zero. Value iunit register value. through 8 Logical unit digital output O-through-7 up to numbers interfaces. If 0,2,...,"177776 of I/0 the LPSDR-A, and 1 of to eight I/0 interfaces. system through 8 DR11-K (The select digital idest wvalue zero.) Memory address address must (The one digital includes an LPS11 then 0 selects the one be select DR11-K configuration with LPSDR-A, must the The values eight up for registers. selected. be idest an even value The number. must be nonzero.) iselect The bits memory to be altered location. The in the bits output that register are on select or the corresponding bits 1in the register or memory location to be altered. To select all bits, you can use either -1 (decimal) or "1777717. iset The action for selected ioutput taken for alteration. bit the selected The value is bit is returned following bit the cleared; ioutput argument the digital output The each If selected bit if the by iselect in iset is bit in iset 0, is the 1, set. by the contains register function the or relationship IDOR. The value loaded into memory location. defines the value of ioutput: ioutput = (iset.AND.iselect).OR. (.NOT.iselect .AND, (0ld Error register)) conditions: SYNTAX EKROR There are present. fewer than four or more than five arguments RT=-11 FORTRAN EXTENSIONS ARGUMENT ERROR The DR unit addressed does not exist. The memory address specified was not an even number. Interaction: None Restrictions: None Examples: Clearing a register or memory location. 1. The call Clearing a register. (a) CALL IDOR(,1,-1,0) is argument 1ioutput the that Notice 1. clears logical register argument when you have no need for the ioutput the Omit omitted. (b) the into that was loaded value Clearing a memory register. location. The call IMEM=IDOR (15,"177xxx,-1,U) clears memory location 177xxx. zero 2. as a result Loading a of the digital The variable IMEM contains the value call. output register. the of byte You want to set the even-numbered bits in the low-order clear the even-numbered bits in the high-order byte of and register, The odd-numbered bits in the register remain unchanged. the register. Suppose the current value of the register is 177400. CALL IDOR(,U,"52525,"377,INEWR) and function) register Notice that idest is defaulted (indicating a The value of iselect zero (indicating logical register 0). 1is iunit is 52525 and iset is 377 (both octal). "The following shows the binary values of the arguments and the of the call on the register Name Binary Value 0 0 1 1 iselect iset 0ld register new register The new value loaded into returned as Reading and the value Resetting of the 101 010 000 000 111 111 010 101 the 1ul 111 vuo 1vul 1uvl 010 011 111 10vu 000 001 010 register is 125125 (octal) clock value and is INEWR. Software Clock IDOR reads the current value of the software <clock and logical AND using the clock value and a mask provided in list (see Section 1.2.2 on the software clock). IDOR can software action value: to a value provided in the argument performs a the argument change the list. RT-11 IDOR is As function: a called ivalue As = as a function FORTRAN EXTENSIONS or subroutine, as a IDOR(,iunit,imask, [iset] [,iclock#]) subroutine: a CALL IDOR(,iunit,imask, [iset],iclock#) The arguments are: ivalue The value returned performs a current reading value of the <clock clock with the is specified. iunit imask The flag The value The value mask iset iunit used to imask in iset, the clock must be and the clock on, loaded into the the clock with iset change the clock between of wvalue a value. you IDOR. of the logical AND To ¢an software the argument use reguest a either -1 clock value list, by iset. IDOR IDOR. If does you not value. The masked clock value. AND argument "177777. from the the After software iset funection current bits The sets the performs or value if IDOR and negative, the IDOR all IDOR, imask the software clock. value, IDOR loads the mask clock. Ffuncotion between (decimal) omit Error of with IDOR iclock the AND value selecting software between by logical imask and four or IDOR performs the current a logical clock value. conditions: SYNTAX ERROR There | are fewer than more than five arguments This redundant present. Interaction: None Restrictions: IDOR and IDIR can both read the software clock. function is necessary because there 1is a resgtriction on subroutines called from completion routines. A FORTRAN program and a completion routine designated in the program cannot both call the same subroutine. The redundancy of IDOR and IDIR allows you from to read within a the software clock both from within completion routine. For example, IDOR to read and reset the IDIR to read the clock within clock the 1-53 within a program. the you completlon program and ¢ould use routine, and RT-11 FORTRAN EXTENSIONS Examples: 1. You want to read the lo-bit software clock without changing its value. ICLOCK=IDOR(,-1,-1,) 2. and You want to read the rightmost reset the clock to zero. ICLOCK=IDOR(,-1,"377,0) eight bits of the software <clock, RT-11 FORTRAN EXTENSIONS KB2BCD 1.4.13 KB2BCD KBZ2BCO converts (Convert a (decimal) to KB2BCD called is Binary lo-bit 4-digit as BCD) binary unsigned a to Routine integer BCD in the range 0 to 9999 form. function. 1digits=KBZBCD (ibinary) The arguments are: idigits The 4-digit unsigned BCD representation of iboinary. ibinary The standard The wvalue of binary ibinary integer exactly one argument value must be to in be the converted. range 0 to Y999, Error conditions: SYNTAX ERROR There 1s not ARGUMENT ERROR The value than to be converted to output present. (ibinary) is negative BCD values or greater 9999, Interaction: You can use IDOR unsigned returned by KB2BCD. Restrictions: None Example: 1. The U You decimal UUl want Ju0 to value 0ul Ul convert of IBIN is 4175 (or 10117 octal): 111 IBIN to BCD form for value for 4175 (shown output to a BCD instrument. IBCD=KB28CD (IBIN) IBCDL contains the BCD bits): 0luu vuul U111l vlul with BCD grouping of the RT-11 FORTRAN EXTENSIONS KBCD2B 1.4.14 KBCD2B (Convert BCD to Binary) KBCD2B converts a form. The KBCD2B is 4-digit unsigned B8CD result called Routine is as always a input positive. to lb-bit binary integer function. ibinary=KBCD2B (idigits) The arguments are: ibinary The l6-bit binary idigits The 4-digit Error integer (le-bit) form of unsigned BCD idigits. input value. conditions: S5YNTAX ERROR There is not exactly one argument present. Interaction: None Restrictions: None Example: 1. Suppose IBCD contains the following bit pattern, which is BCD: 0000 As a 1001 result of 0110 the 1001 tollowing call, IBIN=KBCD2B (IBCD) IBIN contains 0 0UU 001 the 111 following 001 VUl bit pattern, which is 969 decimal. 0969% in RT-11 FORTRAN EXTENSIONS LED 1.4.15 LED LED LED displays without display LED (LED is Dis play) numbers on the LED panel of the LPS11. an LPS 11 in the system configuration. positions called CALL Routine as an d a movable decimal You There cannot are six use LED point. s ubroutine,. a LED(ivalue , 'format') or CALL The LED(rvalue , 'format'") arguments are: ivalue The integer specified. rvalue The real value value to to be be displayed 1in the format displayed in the format specified. format The FORTRAN format specification for the value to be displayed. The maximum field width for integer (I) formats 1is six; the maximum field width for real (F) formats is seven. The maximum F format field width is wider to allow for a decimal point. The decimal point does not use an LED display position as the decimal point appears between display positions. The minus sign does use an LED display position so that the largest negative numbers that can be displayed have five significant digits. The largest positive numbers that can be displayed have six significant digits. If the value exceeds the width of the field specified, the display contains all minus signs. Error conditions: S5YNTAX ERROR There ARGUMENT The DEVICE are not exactly two arguments present. ERROR format specified is not legal. CONFLICT The system configuration does not include an LPS11. Interaction: LED (for can be used example, to display IADC, calibrate your instruments a data collecti on run. Restrictions: LED requires an LPS11. data 1IDIR). or values You acquired might want Schmitt-trigger by other to routines do this to thresholds prior to RT-11 FORTRAN EXTENSIONS Examples: 1. Display a negative integer. NEG=-123 CALL LED(NEG,'I4') HEEEE CALL 2. LED(NEG,'I3"'") Display a real number. REALV=25,94 CALL LED(REALV,'F5.2") 3. Display a single analog value that you want the display value ADC accepts bipolar input with a from to be range channel U of the expressed in volts of -5 volts to +5 following example shows the transformation acquired to the corresponding input voltage. from CALL LED((FLOAT(IADC(U)-2048)/2048.)*5.,'F7.4') the ADC. Assume and that wvolts. 1l2-bit the The value RT-11 FORTRAN EXTENSIONS LWAIT 1.4.16 LWAIT LWAIT initiates by the (Wait) a program Routine pause in (fcr example, the program. Any repeated activity execution of the program does not continue past until the arguments differ. For example, numeric value interrupt to LWAIT is 28 subroutine: a called CALL Me a a service completion or flag completion either as a already sampling) (that the LWAIT wuse LWAIT to will started continues, be but statement compare a changed by an routine). subroutine or as a function. LWAIT (ivaluel,ivalue?2) function: ivar=LWAIT (ivaluel,ivalue?2) The arguments are: ivaluel The name of If you wuse ivar ivalue2 to a variable to LWAIT a as be compared function to call, ivalue?2. LWAIT sets ivaluel. A variable or constant to be compared to ivaluel. NOTE Neither of the arguments changed within LWAIT, but of the arguments specified variable that changes as activity 1in an interrupt completion routine. Error to LWAIT 1is at least one must be a a result of service or conditions: None Interaction: At least one of the arguments for LWAIT must be interrupt service or completion routine. argument for LWAIT can be a completion flag routines SETR, RTS, HIST, or DRS. changed For for by an example, one of the an Restrictions: One is of to the CALL would arguments continue. The must eventually change if call LWAIT(1l,1) suspend program execution indefinitely. program execution RT-11 FORTRAN EXTENSIONS Example: 1. You want a timed program delay of 50U msec. IFLAG=0 ;Initialize CALL ;Start CALL SETR(4,0,500.,IFLAG) LWAIT(IFLAG,U) flag. clock ;mode for ;jWait until ;honzero. in 5UU single interval msec. clock endflag is RT-11 FORTRAN EXTENSIONS REL 1.4.17 REL REL operates LPS11l the relays.) KEL is called CALL Control) two hardware the The (Relay a for open relays 1in considerations the on LPS1l. connecting (See the equipment to subroutine. REL(irelay,isetting) arguments are: irelay isetting Error normally manual as Routine The relay 2. If number. irelay 1; if irelay The relay The is is an an relays are numbered 1 and odd number, REL selects relay even number, REL selects relay setting. Value Meaning Zero Open nonzero Close relay. relay. conditions: SYNTAX ERROR There are ARGUMENT ERROR The relay DEVICE not exactly number is two arguments present. negative. CONFLICT The system configuration does not include an LPS1l1. Interaction: None Restrictions: REL is meaningful only if the system includes an LPS11l. Examples: 1. 2. The following call CALL REL(2,-5) Read digital register value input 1is closes register zero; REL(1,IDIR(,1,-1,1)) number unit close nonzero. CALL relay 1. relay 2: Leave 1 if relay the 1 open register if the value is RT-11 FORTRAN EXTENSIONS RTS RTS 1.4.18 (Repeated Sampling) Routine routine The RIS RTS mediates repeated sampling from A/D converters. sampling capabilities beyond the single reading analog your extends that KTS can 1is a 1' be acquired using - flexible routine providing three basic capabilities. for capability the provides RTS sampling. Single-sweep You so specify the 1limited bursts of analog data. acquiring array an £fills parameters that RTS stops sampling after it For the AD11-K and the ARll, RTS provides a fast, with data. called single-sweep sampling mode capability, restricted (described later). fast-sweep mode 2. IADC. Continuous acquiring sampling. continuous RTS provides the for capability streams of analog data. There are two sampling, finite continuous classes of continuous sampling: of samples to be number total the specify you which in do you acquired, and infinite continuous sampling, in which If specify the total number of samples in the RTS call. not you request infinite continuous sampling, you must call RTS a second time to stop the sampling process. fills RTS In both cases, you specify the parameters so that You either designate a completion data arrays continuously. routine that executes periodically or arrange your program structure the completion You arrays. the to empty code routine or program to dispose of the data as you require (for example, by writing it to secondary storage, or by reducing require Because completion routines it to means or counts). to execute, the maximum continuous sampling rate (which time the maximum than lower is involves a completion routine) rate (which does not involve single-sweep sampling End sampling. You can call RTS in parameter-adjustment a completion routine). 3. to stop infinite continuous mode sampling. RTS is called with a subroutine call. The number necessary depends on the capability you are requesting. of arguments Single-sweep sampling: [nchannels], aysize,, [nsamples], [ifirst], CALL RTS (iarrayname,iarr [igain], [imode] ,iendflag#,nleft) Continuous sampling: CALL RTS (iarrayname,iarraysize, [nsubarrays], [nsamples], [ifirst], ,nleft# [imode],iendflag#], nnels [igain], [ncha [, [interval],complete]) End sampling: CALL RTS(,iarraysize,,,,,,imode*,iendflag,nleft) RT-11 The arguments FORTRAN EXTENSIONS are: iarrayname iarraysize The name of the integer array in which the analog data sampled. With sampling, RTS treats the data array as array. If requests parameter-adjustment The you 1length parameter omit of iarrayname, the places continuous a circular the RTS call mode. iarrayname gpecifies RTS (in amount of words) . This memory reserved for RTS to store data. For single-sweep sampling, the wvalue of iarraysize should be calculated according to the following relationships: iarraysize = nsamples*nchannels or iarraysize = nsamples*hchannels*z dual For continuous greater nsubarrays The than (for LPS11 sample-and-hold) sampling, iarraysize should be interval*nchannels*nsubarrays. number of logical partitions in iarrayname. length of each partition is equal to the largest integer in (iarraysize/nsubarrays). For The example, with 10, there are and 24 unused default iarraysize 10 = 1024 and nsubarrays partitions, each 100 words words number of at the The number of partitions equal to iarraysize. The must be an channels nsamples integer to be end partitions of is iarrayname. of 1less each +the than or partition number sampled. The number of samples per channel, The specifies the total number of times analog channel is sampled. The default nsamples only 1is with iarraysize. single-channel with the LPS11l In sampling, depends on data from each channel of channels with normal sampling, nsamples With LPS1l = dual nsamples continuous can = the you used a be used value you assign vyou are collecting independently, LPS11 be for dual or to from sample-and-hold. specify iarraysize/nchannels sample-and-hold, you specify iarraysize/(nchannels*2) The maximum value with the LPS11l is In that each wvalue of sampling whether pairs For default of parameter sample. The default cannot dual sample-and-hold. single-sweep nsamples The single-sweep The one. must be length of multiple = 1long, of nsamples 409e6. sampling, nsamples depends sampling process. on the how for value you DMA you want sampling assign to stop to the RT-11 EXTENSIONS FORTRAN set you sampling, continuous finite For (a) equal to the number of samples you want. nsamples greater 1is nsamples of In this case, the value are you (because iarraysize/nchannels than requesting continuous sampling). For (b) RTS call then to negative set U < nsamples number: any negative to you sampling, continuous infinite nsamples equal samples data until the program executes a 1in parameter—-adjustment mode with a RTS value for imode. must you For either type of continuous sampling, write the program code and specify the parameters array full from data remove to necessary Continuous sampling is not valid for partitions. LPS11l ifirst DMA sampling. The first channel to be sampled. The valid channel numbers you request for the AM11-K, are: Value Meaning 0 through 63 Range of channel numbers LPS11 or AD11-K with without switchable gain. 0 through 15 Range of channel numbers for the LPS11 or ADll-K with AM1l1l-K, with switchable gain. Range of channel AR1ll or numbers for the AD1l1-K. 0,2,...,62 Range of channel numbers for AD1l1l-K with AM11-K with differential input, without switchable gain. 0,2,...,14 Range of channel numbers for AD11-K with AM11-K wused in differential mode with switchable gain. 0,2,...,7 Range of with nchannels If more than one channel, the channels are sampled consecutively in ascending order so that ifirst is The channel to be sampled. numbered lowest the default value for ifirst is zero. dual channel numbers for LPS11 sample-and-hold. The number of consecutive channels to be sampled in either single-ended or differential mode. The value of nchannels must be the total number of channels between the lowest numbered channel to be sampled and the highest numbered channel to be sampled (inclusive). That 1is, nchannels = 1-64 (highest numbered numbered) + 1 - lowest RT-11 FORTRAN EXTENSIONS This is the case, regardless of from any of the intervening interest. whether the data channels are of For the LPS1l dual sample-and-hold, igain the number sampled. of consecutive The default value The gain 1. The 12 always for pairs nchannels nchannels of is channels be for igaih each value is gains, you 1. setting. The default value used for converting is teturned in bits 13 and 12 of ivalue. The possible wvalues of bits 13 and 12 are 00, 01, 10, and 11 binary (0, 1, 2, or 3 decimal). These correspond to gain codes of 1, 2, 3, and 4 respectively, or to the actual gains of 1, 4, 16, and 64. When you request a gain of 1, bits 13 and mast gain 1is to return use from the as CVSWG gain 0. to For all separate other the converted value bits. Value Meaning 0 Request autogain. determines the optimal The gain software to use for each A/D conversion. Autogain is available only with switchable gain systems (ADll1-K with AM11-K, or LPS11 with 1 Request bipolar gain mode of 1. This value for the ARI1l. 2 Request signal gain by of 4. bipolar mode for 3 " 4 imode LPSS5G). The mode to multiply This wvalue the ARI1l. the input specifies Request gain of 16 to multiply signal by 1le. This wvalue unipolar mode for the ARI1l. the Request gain of 64 to multiply signal by 64. This wvalue unipolar mode for the ARI11. the input specifies of default input specifies sampling. The stop codes that determine what happens sampling stops. The 4 specifies for imode terminate sampling to completion routines is zero. and when RT-11 FORTRAN EXTENSIONS The mode values and their meanings are: Meaning Value 0 For the ADl11-K and the LPS1l, on A/D sample For the ARll, interrupt. each external take one sample on each Schmitt trigger take event. one A/D on #1 2 Take one A/D sample clock-overflow pulse. each 4 For the ADl1l1l-K and the ARll, enable first the (see mode fast-sweep one Take restriction in this section). each Schmitt trigger #1 on sample A/D each on or interrupt (for the AD11-K) external event (for the AR1ll). For the LPS11, enable dual sample-and-hold. Take one simultaneous pair of trigger 6 A/D #1 samples interrupt. on each Schmitt For the ADl1ll-K and the ARll, enable fast-sweep mode (see the first one Take restriction in this section). A/D sample on each clock overflow pulse. For the LPS11, sample-~and-hold. Take enable dual one pair of A/D samples on each clock overflow pulse. 8 Enable DMA. LPS11l with sampling. DMA is valid only for the single-channel single-sweep 9 Enable DMA in burst mode. In burst mode, data are acquired as fast as they one is, That converted. be can conversion starts as soon as the previous one is completed. Burst mode is valid only for the LPS1l with single-channel single-sweep sampling. For the LPS11l, dual sample-and-hold, DMA, and clock-overflow sampling can be requested singly (by using the code in the table) or in combination by adding the codes for the desired options to form the value of imode. For example, to initiate clock-overflow (mode 2), dual sample-and-hold (mode 4) sampling for the LPS1ll, specify imode = 2 + 4 = 6. RT-11 The stop FORTRAN codes EXTENSIONS and their meanings Value are: Meaning -4 Continue sampling current any more completion-routine but allow those to -3 sampling current any array queued Stop requests, already initiated any requests, already only to partition. queued more but Stop sampling honor any to the not honor by requests. RTS. Do not completion-routine allow queued fill Do completion-routine sampling queue -1 requests the queue run. Continue -2 only to fill partition., Do not array those requests run. initiated by RTS. Do not completion-routine queued regquests. iendflag The completion and/or error flag. You must set iendflag to zero before you call RTS. RTS increments iendflag either when all samples requested have been acquired or when sampling has been stopped by a stop code (negative value for imode). If a data overrun or other error occurs, RTS sets iendflag to a negative value. nlett The array with partition the decrements becomes nleft full. partitions using a full array each time by RTS array of 1 each Thus initializes time nleft an array contains to RTS. completion routine to remove a partition overrun has indicate an you should becomes before the nsamples has occurred and RTS partition the available partitions, nleft partitions. currently reaches zero requested in Note: flag. number number If you data increment available. of are from nleft If nleft number of samples been acquired, a data RTS then sets iendflag to error. nleft is meaningful only with continuous sampling. interval The number of interrupts completion routine. interrupts, external pulses that should You between specify events, occur calls to the number or clock before the the of overflow completion routine is executed. RTS initializes an internal variable to interval and decrements it after each interrupt. When the wvalue reaches zero, RTS reinitializes the internal variable, and the completion routine executes. Therefore, the completion routine executes every interval interrupts or events. RT-11 FORTRAN EXTENSIONS The default value for interval is iarraysize/nsubarrays. If only one data point is collected on each interrupt, the default ensures that the completion routine executes when each array partition becomes full. With dual sample-and-hold or more than one channel, you must calculate interval if you want the completion routine called as each array partition becomes full. interval = iarraysize/(nsubarrays*nchannels) or interval = iarraysize/(nsubarrays*nchannels*2) for complete LPS11 dual sample-and-hold. Completion-routine name. You write a completion routine that executes whenever interval interrupts have occurred. There is no default completion-routine name. When you omit the last two arguments, RTS does not designate a completion routine. Error conditions: SYNTAX ERROR There are fewer ARGUMENT than 10 or more than 12 arguments present. ERROR The starting channel the hardware). number (ifirst) is too large. The number of channels requested (nchannels) is negative, or too large (greater than 16 or greater than 64, depending on Autogain was requested for the ARIl. The gain code (igain) is greater than 4. The mode (imode) requested is out of range greater than 15). The sum of ifirst and nchannels requests (less than -4 or sampling from a channel with channel number greater than 63 (or nonexistent 15). The size of the array partition is not an even multiple the number of channels to be sampled (nchannels). Autogain was of requested with DMA. Continuous sampling with stop code termination was specified for DMA. Data acquired with DMA exceeds the available space (iarraysize). DEVICE CONFLICT An RTS call attempted to initiate sampling while from a previous call to RTS was still in progress. sampling Interactions: RTS can request an A/D conversion on each clock-overflow pulse. It does not require clock interrupts. You can run the without interrupts by requesting noninterrupt mode in SETR. runs faster normally used without clock to process the interrupts because you clock interrupts. save RTS the runs faster when SETR noninterrupt mode 1is combined with fast-sweep mode described in the first restriction in section. clock RTS time even the this RT-11 FORTRAN EXTENSIONS You cannot write a program that would RTS at the same time. Both IADC and hardware and only one of the routines attempt to RTS use the can execute call same at a IADC and conversion time. When the value of igain is not 1, RTS returns a packed value containing the digitized wvalue and the gain setting. You can unpack the digitized value in real-number form, and the gain in integer form by using CVSWG (see Section 1.4.2). With gains other than 1, the A/D conversion system multiplies the input signal by 4, 16, or 64. When you get the digitized value in real-number form from CVSWG, vyou must divide it by the appropriate gain (4, 16, or 64) if you need to restore the value to the original scale. Restrictions: Fast-sweep mode is a mode available only with the AD11-K or ARIll. With fast-sweep mode, you <can acquire analog data at a rate several times faster than normally possible with RTS. There are several restrictions on using fast-sweep mode. You can request fast-sweep mode only for single-sweep sampling for a single-channel sample with the <c¢lock running in noninterrupt mode. There can be no array partitions, no completion routines, and no autogain. Data overrun occurs when RTS fills the array partitions faster than the completion routine can empty them. This situation occurs when the clock rate is too fast for the size of the array partitions. When the mode, numbered DMA AD1l1-K, the in channels, sampling or odd and is single—-channel DMA with data without AM11-K, numbered channels can be sampling. Call RTS only in in differential those single-sweep Continuous once used duplicate in even ignored. available sampling. is for each sampling DMA is sweep mode not for wvalid required. maximum number operation is 4K is 4096. of data points that can be words. The maximum value for accepted in one iarraysize with The AM11-K with AD11-K with hardware can be set up gains of for The 1, DMA DMA 5, and 50 instead of 1, 4, 16, and 64. Autogain does not work in this case. The meaning of gain codes 2, 3, and 4 depends on the actual gain selected for each group of channels in the AM11-K. Autogain does Autogain is not not work with available an at AD11-K all for or LPS1ll the AR11. in unipolar mode. Examples: l. You want to collect a single sweep of 200 channels, starting with channel 0. Because sampling, you omit nsubarrays, interval, and a name. (0). but samples from four it 1is single-sweep completion routine You wuse the default values for ifirst (0), igain The nleft argument (IDUM) is not used by single-sweep must be included to satisfy the syntax. (1), imode sampling, RT-11 FORTRAN EXTENSIONS :Set up the data array. ;Initialize RTS flag. :Call RTS. sWait until all samples DIMENSION IDATA (4,50) IFLG=0 CALL RTS (IDATA,200,,50,,4,,,IFLG,IDUM) CALL LWAIT(IFLG,0) ;read. (Notice that the data array could have been dimensioned as IDATA (200). FORTRAN stores the data the same way regardless of how you specify the data later Using IDATA (4,50) can be more convenient for dimensions. access, because the value of the first subscript specifies the channel sequence the specifies number and the value of the second subscript number of the sample.) 2. You want to request continuous sampling of 1300 samples using a You sample channel 400-word data array with four lU0-word partitions. This 3. gain of a 1 100 times per second on clock overflow, with array partitions without using a completion example processes the As soon as a partition is full, the program sums the data in routine. that partition, and frees the partition by incrementing the partition count (NLEFT). DIMENSION IDATA(100,4),SUM(13) DO 5 10 5 DO 20 40 41 ;No. of partitions (mod 4). ;Increment index for SUM array. I=1,100 SUM (N) =SUM (N) +CVSWG (IDATA (I,IPART))/16. IF (IPART.LT.4) IPART=0 30 up arrays. SUM(I) = 0 :Initialize SUM array. N=0 ;Index for SUM array. IPART=0 :Index for IDATA array. IRFLG=0 ;RTS endflag. ISFLG=0 ;SETR endflag. CALL RTS (IDATA,400,4,1300,1,1,3,2,IRFLG,NLEFT) ;Request continuous sampling. CALL SETR(5,1,1.,ISFLG) ;Start clock at 100Hz. IF (NLEFT.EQ.4) GO TO 10 ;Wait for first partition to ;Eill. IPART=IPART+1 N=N+1 20 ;Set I=1,13 GO TO 30 NLEFT=NLEFT+1 IF (IRFLG.GE.(0) GO TO STOP 'RTS ERROR' IF (IRFLG.EQ.0) GO TO CALL SETR(-1,,.,) TYPE 41,SUM FORMAT (F12.2) STOP :Sum the data in the ;just-filled partition. :Check to see if end of IDATA. ;Start indexing from start ;of array next time. ;Increment the available ;partition 40 10 count. ;Skip if not an error. :Error if IRFLGKO. ;If still sampling, jump. ;Finished, stop clock. ;Output the data. 'DONE' END (Notice that you could specify the data array as IDATA (400). However, your subscript calculation would then be more complicated. FORTRAN stores its arrays "by columns," so that it puts the first 100 samples into IDATA(1,1) through IDATA(100,1), the second 100 samples into IDATA(1,2) through IDATA(100,2), and so on. Therefore, the value of the first subscript specifies the sequence number within the partition, and the value of the second subscript specifies the partition number.) RT-11 FORTRAN EXTENSIONS SDIS 1.4.19 SDIS or SDIS stops a (Stop Display) continuous Routine display that is being controlled by either DIS DXY, SDIS is called CALL as a subroutine. SDIS There are no arguments. Error conditions: None Interaction: While the continuous-display routines (DIS, DXY) are running, the only other activities for which resources are guaranteed are interrupt service routines and completion routines. Therefore, the most practical way to stop a continuous display is by calling SDIS use from SETR after a within to a completion designate specific time a routine. completion interval, or For routine on example, that would receipt of you be an might executed external event. Restrictions: None Examples: l. The following example is part of the example given in full in description of DIS. The completion routine HOLDIT contains the to SDIS. The EXTERNAL completion routine is specified HOLDIT in the call ;Specify the to SETR. completion ;routine. IFLG=0 CALL SETR(5,0,1000.,IFLG, ,HOLDIT) ;End flag for SETR. ;Start the clock. CALL ;Start DIS (ISCREEN,ISPACE,NPTS,48,20) the display. PAUSE SUBROUTINE CALL SDIS RETURN END HOLDIT ;Completion ;Stop the the call routine. display. RT-11 FORTRAN EXTENSIONS SETR 1.4.20 SETR (Set Rate of the Programmable Clock) Routine SETR provides several options for controlling time intervals and counting events. The hardware clock counter can be used to generate interrupts to the processor at specified intervals or in response to external events, to measure time intervals, or to count events. The KWll-K and LPS clock counter run at any of five crystal-controlled frequencies (100 Hz to 1 MHz), at 1line frequency, or at an external frequency supplied through a Schmitt trigger. The AR1ll clock counter runs at any of five crystal-controlled frequencies, or at a frequency supplied through an external input line. The KW1ll-K and LPS clock counter operate in any of four programmable modes: single interval, repeated interval, external event timing, or external event timing from zero base. The AR1ll clock counter has two programmable clock modes modes: are SETR allows you to synchronization), completion routine called. Call SETR SETR is called CALL The as interval, later in this and repeated interval. The section. specify the clock mode, the clock rate (or type the length of the interval or number of counts, to be called, and the conditions under which it to start or to stop the clock. : a of the is subroutine. SETR(irate,imode,rcount,iendflag#([, [intervall,complete]) arguments irate single described are: The rate clock for the counter oscillator The stop codes that determine what happens the clock is disabled. Table of rate disable the to completion controls the clock routines and when codes: Value 0 that frequency. Meaning Stop No the rate clock (without disabling selected. 1 Set clock frequency to 1 2 Set clock frequency to 100 3 Set clock frequency to 10 4 Set clock frequency to 1 5 Set clock frequency to 100 MHz. KHz. KHz. KHz. Hz. it). RT-11 FORTRAN EXTENSIONS Value 6 Meaning Use Schmitt input for an 7 The stop Set clock (50 Hz codes trigger freguency or 60U (the external to Hz). line (Not input frequency valid for the are: Value -2 #1 line for the ARll) as the external frequency source. Meaning Disable more allow the clock., Do not gqueue any completion~routine requests, those requests already queued but to run. -1 imode Disable the clock. Do not honor queued completion-routine requests. any The imode argument selects the mode of clock operation. The external event and external start modes (modes 2 through 7, 12, and 13) are not valid for the ARL1l. The codes for clock modes Value are: Meaning 0 Single-interval mode. The clock counter counts rcount times, generates an interrupt, and then stops. You need not issue a stop code hecause the clock turns off automatically. For the ARll, mode 0 can be used only with rates 1 through 5. 1 Repeated—-interval counter 2 counts mode. rcount The times, clock overflows (generating an interrupt), begins again to count rcount and DRS require overflow synchronize sampling. and times. events External—-event The timing mode. of the <c¢lock counter is (which you must set zero). The counter runs at the irate, A pulse from causes the current to be transferred to (You <can data array counter read rate the register HIST.) to rcount clock specified by Schmitt trigger #2 clock counter value a clock register. using continues to initial value to then RTS count, value The into a clock RT-11 FORTRAN EXTENSIONS Meaning Value 2zero from mode timing External-event The initial to mode 2). (similar base rcount is counter <c¢lock value of the The clock (which you must set to zero). by specified rate counter runs at the A pulse from Schmitt trigger #2 irate. value counter causes the current clock transferred to a clock register. be to (You can read the clock register value The HIST.) using array data a into clock counter is cleared to zero and the 3 to count. clock continues External start modes. you above, 3 through When you add 4 to modes 0 that specifies an external value a mode obtain 7, 1In modes 4 through start pulse for the clock. clock counter starts counting on receipt of a the than rather #1, trigger Schmitt from pulse as soon as the routine SETR is executed. starting the with available Extirnal start modes are not AR1ll. The codes for external start clock modes are: Value Meaning mode Single-interval 4 with external with external start. 5 Repeated-interval mode start. 6 External-event timing mode with external start. 7 External-event base with Noninterrupt modes. When you 8 obtain a add mode timing external to modes value 0, mode from =zero 5 above, you start. 1, 4, and that specifies running the clock counter so that clock overflow generates a clock overflow pulse but does not generate an interrupt. The RTS routine does not require the the only but interrupt, clock-overflow clock-overflow pulse. RTS runs faster with the turned off because you save the interrupts clock interrupts. time normally required to process the The the clock-overflow clock mode is 8, HIST and DRS, which interrupts are disabled when 9, 12, or 13. require clock interrupts, do not work with noninterrupt mode. 1In noninterrupt mode, SETR does not run the software clock. RT-11 The FORTRAN codes for EXTENSIONS noninterrupt Value mode Meaning 8 Single-interval 9 Repeated—-interval 12 noninterrupt Single-interval external 13 noninterrupt mode. mode with start. external Limited mode. noninterrupt Repeated—-interval When are: noninterrupt mode with start. mode. you add 8 to modes 9 and 13 above, a limited service clock mode. the only function SETR performs the software only timing clock. TIf function the you In is you obtain limited mode, to increment software clock require, wuse is the limited mode. None of the interrupts other services (HISsT, DRS, SETR routines) is available in limited The for limited mode are: codes Value SETR completion mode. Meaning 17 Repeated-interval 21 limited mode. Repeated-interval 1limited mode with external (External start modes are rcount requiring and not start. available Initial count value. rcount times at the The for the c¢lock frequency AR1l1l.) counter specified counts by irate, and then overflows and generates Therefore, the clock generates an an interrupt. interrupt every rcount counts, interrupt equal to resulting irate/rcount. 1in an The value of rate rcount must vte a real number. For the KWll-K or the LPS11, the maximum value for rcount is 65535 (decimal); for the ARll, the maximum value for rcount is 255 (decimal). rcount iendflag The The completion flag 1increments number number before external for iendflag overflows 1n to zero before completion specify the the the zero. counter iendflag interval With be SETR must the of of modes, interval mode. when the mode O. you call You SETR. nust between calls clock to set the With this argument, vyou clock overflow interrupts or Schmitt completion single timing only interrupts routine. number of event trigger routine pulses executes. elapsing SETR has an 1internal variable initialized to interval that it decrements after each c¢lock interrupt or Schmitt trigger #2 pulse. When the value reaches 1-75 RT-11 FORTRAN EXTENSIONS zero, SETR calls the completion routine. The completion routine thus executes after every interval interrupts. The default value of interval is 1. complete Completion-routine name. The completion routine that you provide 1is executed whenever interval interrupts have occurred. There 1s no default completion-routine name. When you omit the last two arguments, SETR does not <call a completion routine. Since the completion routine is called £from the clock interrupt service routine, you cannot request a completion routine when the clock is running in noninterrupt mode. Error conditions: SYNTAX ERROR There are fewer than requested requested is is four or more than six arguments present. ARGUMENT ERROR The The rate mode above. The count DEVICE value less than -4 or greater than not one of the valid modes requested for the ARll is greater than 255. CONFLICT Consecutive This error calls does to SETR with not occur rate for parameter 1 consecutive through 7. calls with and 8). The a call to SETR variants of single-interval mode (modes 0, 4, remedy is to insert (between the other calls) using a negative rate. CLOCK 7. described ERROR--RATE TOO FAST Clock overrun occurred, meaning that a clock interrupt has been 1lost and program execution stops. The remedy is to request a lower clock rate, or, 1if practical, ¢to run in noninterrupt mode. Interactions: Use SETR to get the desired rate. You analog, digital, or SETR controls Section the clock can time going in the then wuse RTS, interval operation of data the desired DRS, or mode HIST to at the acquire (respectively). 16-bit software clock (see 1.2.2). DRS and HIST require clock-overflow interrupts. Therefore those routines do not operate properly if the clock is running in noninterrupt mode. Restrictions: You can 0 and not use the following call to stop the clock (except in modes 4 in which it stops automatically). In this case, you do need fourth to specify names arguments. CALL SETR(-1,,,) or values for the second through the RT-11 FORTRAN EXTENSIONS Examples: 1. CALL SETR(6,0,2.0,IFLAG, ,NAME) $ Requests tNAME completion after Schmitt ;#1 has fired twice. routine trigger RT-11 FORTRAN EXTENSIONS 1.5 BUILDING A REAL-TIME SUPPORT LIBRARY When your system is delivered, you receive the FORTRAN extensions real-time support routines in object module form, and a configuration and the names lists (Appendix B form. routine in MACRO source Before you can use the real-time support contents of these files.) into a routines, you must combine the object modules you received Before you create the library, you must be sure either that library. your system configuration matches that specified in the configuration routine, or that you have changed the configuration routine so that it describes your 1.5.1 system. 8System Configuration system The real-time support library assumes that you have a standard the necessary source changing by otherwise it inform you unless MACRO a is The source program CONFIG.MAC statements in CONFIG.MAC. "standard" a of description hardware complete a containing program system. 1.5.1.1 A Standard System - To find out what a standard system The first few pages of the contains, list the source file CONFIG.MAC. Section A with block, set-up confiquration the contain listing Section B containing the and definition, hardware the containing statement Each addresses. register status and vector interrupt defines some aspect of the system. For example, SAD11K=0 is the statement defining the absence of an ADl11-K A/D KWll-K programmable clock counter in the converter and system. 1.5.1.2 Changing Configuration Specifications Each statement in CONFIG.MAC is accompanied by comments that explain the statement, and the changes to make 1if your system differs from the standard system. Read through the explanation, and, using the text editor on your system, make whatever changes are required to CONFIG.MAC so that it For example, if you have the AD1l-K and KWll-K describes your system. on your system, change the definition statement to SAD11K=1 Any changes you make will probably be to the hardware definition Sstatements. The interrupt vector and status register addresses are factory-set standard addresses. Do not change any of these address statements in CONFIG.MAC unless vyou have made the corresponding hardware changes. RT-11 1.5.1.3 Assembling to CONFIG.MAC are FORTRAN EXTENSIONS the Revised Configuration The changes you make «changes to a source file. To incorporate the changes into the system, you must assemble the revised source file using the MACRO assembler. Your dialogue with the computer has the following sequence (where your input has been underlined): .MACRO/LIST CONFIG DETECTED: U ERRORS 1.5.2 The Real-Time Support Library Before you can use the real-time support subroutines, you must create the real-time subroutine library. Create the library file using the librarian system utility LIBR. (Refer to the RT-11 System User's Guide for more information on the librarian.) 1.5.2.1 the Generating library of the Library real-time - Use the LIBR program to generate subroutines. .LIBR/CREATE Library? 1libnam Files LDPOBJ ? . If you have library the that standard you system created configuration, you <can use the : If you have a nonstandard system configuration and necessary changes in CONFIG.MAC, you must perform one generate library, now (libnam). the library. Still wusing the libnam, to include the changes in have made the further step to LIBR program, CONFIG. revise the .LIBR Library? Files ? 1.5.2.2 1libnam CONFIG/REPLACE Accessing the Library - Write your FORTRAN the real-time subroutine and function calls described Compile the programs in the normal manner. (Refer to User's Guide for information on the FORTRAN compiler programs using in this chapter. the RT-11 System and its optional switches.) When you link the programs, in the list of commands for .LINK (1f you (1f FORLIB name of progrm,libnam have .LINK include the the linker: one system library SYSLIB), or progrm,libnam/F and SYSLIB are separate libraries). your real-time library RT-11 1.6 FORTRAN EXTENSIONS ERROR MESSAGES The FORTRAN extensions routines produce five error messages. These messages are SYNTAX ERROR, ARGUMENT ERROR, DEVICE CONFLICT, ADC CONFLICT, and CLOCK ERROR. Each error message appears with a line number, 1indicating the line where the error occurred. You must refer to your listing to determine which routine caused the error, and then refer to the error summary table (Appendix C) to determine the possible causes of the error. The error summary conditions: table uses the following Abbreviation SYN Error SYNTAX abbreviations DEVICE subroutine or function number of arguments. ERROR least one the routine message does in error. DEV error ERROR ARGUMENT At the Condition The call to the contains an invalid ARG for of the has not arguments in the call to an illegal value. The error indicate which argument 1is CONFLICT This error arises when one of the routines tries to use a device that is busy. This can happen under the foreground/background monitor if another job is using the device. It can also occur when you call a routine for which completion-routine requests are still queued as a result of a previous call to the routine. ADC ADC CONFLICT Device conflict error for the A/D the A/D converter is busy. CLK CLOCK ERROR--RATE TOO FAST The clock interrupts are to be processed. occurring Error-causing conditions are described in the reference each routine. A summary table of error conditions for appears as Appendix C. converter: too fast section for all routines CHAPTER FORTRAN 2.1 The FORTRAN Debugging Technique tool control of and change execution. the execution the contents runs on for any use FDT FORTRAN PDP-11 operating system. during a debugging To TECHNIQUE (FDT) 1INTRODUCTION debugging FDT DEBUGGING 2 (FDT) is a sophisticated IV programs. FDT gives If an USING with FORTRAN FDT requlres session. successfully, you IV under approximately need to know the the RT-1l1 2K words of FORTRAN IV debugging l. Compile have a program that session: your compiler work with does FORTRAN option inline not work, follow program. that code. or RSTS/E memory space programming data You You Link to root do not need your be program 1linked. segment program your of generated units. If you your has subroutines Run the FORTRAN formats, must you FDT V02-01 PAUSE AT use might program. xx because to the begin FORTRAN FDT does not option that FDT storage needs them. map listing. listing. Generate common ISN steps 1Include FDT among the input are using overlays, place FDT automatic FDT pause before the program. The following FDT code program. named that these produces threaded code; Do not use the compiler suppresses internal statement numbers Obtain a source program listing and a 3. examine program FDT you FDT 2. step-by-step of your program and the ability to of any variable in your program during language. You do not need to know details of internal machine operation, or the FORTRAN compilation process. 2.2 interactive you IN blocks need to FDT takes a linker or map assembly files in the if vyour language examine. control and executes mainprog 1 The variable XX The components internal executable of the message statement statement 2-1 an the first executable statement of message appears on the terminal: in are: number the of FORTRAN the program. first FORTRAN DEBUGGING TECHNIQUE (FDT) to refers FDT mainprog The main program being debugged. program with the name assigned to it in main the If you do not the FORTRAN PROGRAM statement. name the program, to statement PROGRAM the uses the default main program name, .MAIN. use FDT ready to The prompt FDT issues to accept indicate it is a command. NOTE instructions, the If you do not follow FDT may not be able to get control, and run then will program FORTRAN the without FDT. Sometimes FDT gets only the when happens (as partial control without compiled is program main internal statement numbers) and cannot In this case, FDT issues the continue. message FDT START FAIL, and exits to the monitor. 4. Begin debugging your program. Type in the FDT commands that you have decided to use to start solving your problem. At this point, you must type in at least one command that causes an FDT pause, or else the program runs to completion without allowing you to enter any FDT commands. If your program without FDT intervention, execute or 2.3 FDT There you want to type CONTINUE START. COMMAND TYPES are three classes of FDT commands: ® Program control e Information transfer e FDT commands control Program Control commands commands Commands Program control commands allow you to control the execution of your FORTRAN program. You <can use the program control commands to halt program execution, to continue with the next executable statement or restart from the beginning, to step through the program one or more statements at a time, or to end a debugging session and exit to the operating system monitor. The program control commands are START, STOP, CONTINUE, STEP, Information Transfer PAUSE, RESET, and WATCH. Commands Information transfer commands allow you to examine the contents of any variable or array element in your program and to modify its value. As part of the command, you can define the data type of the variable, so FORTRAN DEBUGGING TECHNIQUE (FDT) that the contents of the variable appear 1in familiar notation (see Section 2.4.3 on mode codes and Section 2.4.2 on location specification). The information transfer commands are NAME, DIMENSION, TYPE, ACCEPT, FDT Control Commands FDT control commands of FDT commands. macros composed of and allow unconditionally, to another and WHAT. 2.4 FDT MACRO, you to Using these FDT commands, GOTO, IF, ERASE. CONVENTIONS AND FDT control the commands, and can command. operation of sequences you can define and execute branch, conditionally or The FDT control commands are TERMINOLOGY Syntax Conventions The general parameters. STEP form of an FDT command A simple example is is the command name followed by 3 where a STEP is the command name and 3 is the parameter. You can command whenever FDT has issued its exclamation-point prompt. The syntax following ® its conventions for entering FDT commands appear enter 1in the paragraphs: Spaces between the prompt and the command are optional. You can place the command directly after the prompt, or you can separate the command from the prompt by any number of spaces. The following forms are correct: tcommand ! @ command FDT recognizes only the first three letters of any command. You can abbreviate any FDT command name to its first three letters. There cannot be any blanks between the 1letters in the command name. The following !START ISTA ISTAT The following I1ST A 1CO ® examples FDT are correct: interprets examples are this command as STA. incorrect: There is an embedded space in the The abbreviation is too short. command. Spaces are regquired between a command name and its parameter (s). Some FDT commands can accept parameters. You must leave at least one space between the command name and the parameter. FORTRAN DEBUGGING TECHNIQUE The following !MACRO are correct: 1 |PAUSE The examples (FDT) .MAIN.,20 MACRO 2 AFTER 10 following example is incorrect: IMACRO1 @ There are two formats for a series of FDT commands. You can enter the commands as a list with one command on each line, or you can enter several commands on a line, separating the e commands with semicolons. The following example !MACRO TYPE 1; The maximum continuation shows two commands on a line: I,J command length is one line. There is no character to permit a command longer than one line. MACRO definitions (but not the MACRO command) continue onto more than one line (see Section 2.5.7). can If you type a command that is incorrectly spelled or incorrectly spaced, FDT prints the error message ?UNDEFINED and prompts for a new command. 2.4.1 Current Procedure An important concept in using FDT is the "current procedure." As its name implies, the current procedure is the procedure (main program, subroutine, or function) beingsexecuted at a given time. FDT defines the current procedure as the procedure being executed when an FDT pause occurs (see Section 2.4.4). You need to know what the current procedure 1is when vyou are defining locations for FDT (see Sections 2.4.2, 2,4.3, 2.4.2 The and 2.7.2). Leccation Specification The FDT information transfer commands require you to specify location of a variable or array element in the FORTRAN program. location specification consists of two parts, the location itself, the data type for the location. the The and There can are several ways to specify a location. For a variable, use an offset location, a named location, or a relative an array element, you use a subscripted name location. Offset you location. For Location The most direct way of specifying a variable's location is to give its offset. The offset 1is the difference between the address of the variable and the base location of the current procedure's data block. The offset FORTRAN for any variable appears compiler. in the storage map produced by the FORTRAN You specify the offset DEBUGGING of a TECHNIQUE location by (FDT) typing an octal number: nnn where nnn is storage map. bytes.) You The the need following FORTRAN offset (The is 1V of the offsets in not a enter Local Variables, from Map for .PSECT $DATA, a as storage leading fragment Storage variable the shown map are on the expressed FORTRAN in zeros. FORTRAN Program IV Unit Size = 000322 storage octal map: .MAIN. ( 105. words) Name Type Offset Name Type DAY Offset I*2 000306 Name Type I I*2 000314 J I*2 I4 000316 I*2 000312 MONTH 1I%*2 000304 YEAR I*2 000310 The offset YEAR is You can of the specify variables in specification variables two DAY is 306; the in variables techniques the of a of only for location the variable unsubscripted current procedure. You cannot use a location offset subscripted array elements, variables in common, or FORTRAN routine that is not the current procedure. The a to in for this rule the main specifying Variable To offset offset the for exceptions 1. variable 310. Offset Offsets specify an are for variables program. (Section the of offsets in Blank offset in blank common and 2.7.1 describes special variables in named common.) Common location for a type: variable in blank common, .BCOM. +nnn where nnn FORTRAN 2. Variable Any is by offset in of the wvariable (as shown in the referenced at any map). Offsets variable time the storage in the the main Main Program program typing: can be mainprog+nnn where mainprog is the name offset of the variable. Named You of the main program and nnn is the Location can specify the location of a variable have associated with the location. define a name and associate it with Once you have defined a name, specification. Relative The name is valid You by using a name that vyou use the NAME command in FDT to a location (see Section 2.5.8). you can use it in any location in any procedure. Locations You can specify the location of a variable relative to a previously named variable. To specify a location relative to a previously defined name, you enter the name and the displacement of the variable from the named location. This referencing sequences of variables practice in 2-5 1is consecutive useful primarily locations. for FORTRAN DEBUGGING TECHNIQUE (FDT) The format of the specification is: name-+nnn The components of the specification are: name The named location previously defined in a NAME command. nnn The displacement in octal between the location to be (The specified and the location associated with the name. displacement is the difference between the address of the variable and the address of the named location.) Subscripted Name Locations You can specify the location of an array element by using a The FDT DIMENSION command allows you to define a subscripted name. subscripted name and associate it with the location of a FORTRAN Once you have defined a subscripted name and associated it array. with an array, you can specify the location of any element within the array with the subscripted name and the appropriate subscripts in For parentheses. example: ARRAY (3,7) There are two ways to specify the subscript of an array element: an integer constant. e Use e Use a name defined in a previous NAME command. If you use a as a subscript, FDT assumes that the variable associated name with the name has an integer value. There are certain conventions you must follow for using a name subscripted location: e Each subscript value must be within the range defined for that If the subscript value is outside this range, FDT dimension. prints the following warning message: $SUBSCR OUT OF Since the message BOUNDS is only a warning, location using the subscripts specified. e FDT references the The number of subscripts you specify 1in a subscripted name must be less than or equal to the number of dimensions in the If the number of DIMENSION command that defined the name. , FDT uses the dimensions of number the to equal is subscripts the array FORTRAN subscript reference algorithm to locate number the than less is subscripts of number the If element. of dimensions, FDT assumes that the missing subscripts have a 1is defined as a if ARRAY For example, 1. of value to equivalent is ARRAY (3) array, three-dimensional ARRAY (3,1,1). e A subscripted name retains its regardless of whether that association 1location is with 1in a the location current procedure. The name loses its association with the location only when you redefine the name with another NAME or DIMENSION command or when you cancel the name with an ERASE command. FORTRAN 2.4.3 The second type To Mode or TECHNIQUE (FDT) Codes major mode specify DEBUGGING a for component the mode of a location. for a the location location location, specification is data the type: loc [/mode] The components of loc The location mode The FDT mode similar to location is FORTRAN. (see Section 2.4.2). code for the location. data types. FORTRAN I, corresponding Table corresponding specification 2-1 FORTRAN 1lists data to the type. are: the FDT The The FDT modes default INTEGER*2 modes and mode data the are for type a in nearest FORTRAN DEBUGGING TECHNIQUE (FDT) Table 2-1 FDT Mode Codes Mode FORTRAN Type I INTEGER*2 J INTEGER*4 L Description 16-bit value displayed in decimal 32 bits, first 16 bits displayed in LOGICAL*4 32 bits, displayed as T or M LOGICAL*1 8 bits, displayed as T or F E REAL*4 32 bits, scientific notation D REAL*8 64 bits, scientific notation C COMPLEX 64 bits, real and B BYTE 8 bits, displayed R ——— decimal 16 bits, F imaginary parts in decimal displayed as three RAD50 characters 0 ——— 16 bits, displayed An —-—— A string of n ASCII characters n is in the range 1 to 255) Z —-———— ASCIZ P - Dummy variable mode string in octal (as used string handling (where in the FORTRAN package) When you need to indicate that the associated variable is a parameter (dummy variable), you can use the letter P preceding any of the FDT modes. In fact, you must specify this form for any variable listed as a parameter in the attributes section of the FORTRAN storage map. FORTRAN DEBUGGING TECHNIQUE (FDT) Examples: Specification . 204 /E A l6/PI An POWER/C A : REAL*4 location variable INTEGER*2 COMPLEX tthe Any Meaning name specification at offset parameter variable 204. variable at at a location offset lé6. associated with POWERK. can include a mode specification. For example: TYPE The 202 202/E offset of the is REAL*4, location is If a location specification possible actions. 1. If the assumes the the data without does mode the not I. For a type of mode, involve a location there name, offset are two then FDT example, 202 same TYPE 2. default and occurs specification TYPE is 202 as 202/I If the specification includes a name (a named location or a subscripted name) then FDT assumes the mode associated with that name. (The mode becomes associated with the name when you define the name in an FDT NAME or DIMENSION command.) For has example, NAME PI,202/E TYPE PI the same TYPE result as 202/E Similarly, has NAME ANGLE, 202 TYPE ANGLE the same TYPE result as 202 The original mode definition can be overridden in subsequent commands. For example, NAME if the PI,202/E name definition 1is FORTRAN DEBUGGING TECHNIQUE (FDT) the following commands have the effects shown: TYPE PI/D Uses mode D for output. TYPE 202 Uses the default mode I for output. Uses originally defined mode E for output. TYPE PI The mode code is important for subscripted names 1in a DIMENSION command because the mode code determines how FDT locates the required array element. You can use the default mode in a DIMENSION command. However, it is better practice to specify the intended mode explicitly in the DIMENSION command. specification. You can specify a mode only in a location other and Subscripts command parameters are not location specifications, so you cannot associate modes with them. 2.4.4 FDT Pause Definition FDT contains a pause feature similar in operation to a FORTRAN PAUSE the FDT pause halts execution of the program and allows statement: When the pause the program to be continued by further commands. you occurs, enter can with the FORTRAN pause. FDT FDT commands. (Do not confuse the FDT pause The FORTRAN PAUSE statement cannot cause an pause.) There are five ways to cause an FDT pause. the situation causing the pause: e automatic pause ® entry e statement e step e watch pause The pause name indicates pause pause pause The automatic pause occurs before the first executable statement in (There is no FDT command for invoking the automatic the main program. The automatic pause occurs only during the first run of the pause.) That program in a debugging session and not during subsequent runs. commands REENTER or START monitor or commands START FDT is, subsequent do not invoke the automatic pause. function. An entry pause occurs at the entry point of a subroutine or and FDT name, procedure the specify to command PAUSE the use You pauses before the procedure begins executing. FORTRAN a particular A statement pause occurs before execution of you where statement the specify you command, PAUSE a Using statement. want the pause to occur, and FDT pauses when next one that statement is the to be executed. A step pause occurs after a defined number of FORTRAN statements have the STEP You specify the number of statements using executed. command. 2-10 FORTRAN A watch pause changes. You When an FDT when specify the pause terminal: FDT occurs DEBUGGING the wvalue variable occurs, FDT ISN IN TECHNIQUE of to watch prints the a (FDT) variable using the following being WATCH watched command. message on the : PAUSE AT nnn proc ! The variable nnn components The internal FORTRAN proc of the message statement are: number of the next executable statement. The name of the procedure 1in which the FDT pause occurred. A procedure 1is a main program, subprogram, or function. FDT defines procedure proc as the current procedure. This procedure remains the current procedure until the next FDT pause occurs. FORTRAN 2.5 DESCRIPTION OF THE DEBUGGING TECHNIQUE (FDT) FDT COMMANDS The FDT commands are described in the following are arranged alphabetically for convenient contains a reference summary of the commands. Useful commands for e PAUSE, STEP, e NAME to ® TYPE and a refer new FDT user and CONTINUE to variables ACCEPT to display section. The commands reference. Appendix D are: to control and change execution values FORTRAN DEBUGGING TECHNIQUE (FDT) ACCEPT 2.5.1 The ACCEPT ACCEPT three three command forms forms assigns new values of arguments for freely within macro a the to FORTRAN ACCEPT definition. valid outside a macro.) You can specify single command line. The arguments must The first form ACCEPT The The components The location value The be new value to a constant form 'text' argument is: 'text' The form text you can whose value be in string ACCEPT of the is assigned the same be a to be command TYPE apply. literal use form ACCEPT The the form literals The third literal of analogous The form is as be many arguments as fit separated by commas. to be are all not on a changed. to loc. The new value may data format as the mode of previously defined name or is: ACCEPT text mix are: loc This third There can loc=value argument second (The You is: loc, or it may subscripted name. The variables. command. the form text printed. is identical command. The in function FORTRAN to the conventions for : of as ACCEPT a prompt is to useful for FDT enter new values. macros, where is: loc argument loc is: The location specification for a value entered from the terminal. This form of the ACCEPT command is valid only in FDT macros. It requires an input value from your terminal, and prompts for the value with a question mark. The value you enter must follow the same conventions required for other forms of the ACCEPT command. The following mode conventions apply to the wvalues in the ACCEPT command: e The FDT the value may be a previously defined name. copies its contents into loc. When you value, its mode should match the mode need not. If the modes of loc and name the mode of loc determines the number of from name into loc (see Table 2-1). 2-13 If it 1is, use a name as of 1loc, but are different, bytes copied (FDT) FORTRAN DEBUGGING TECHNIQUE For example: Mode of loc Data Type Number of I J E D Z INTEGER*2 INTEGER*4 REAL*4 REAL*8 ASCIZ 2 4 4 8 1 Bytes Copied of mode When you use a name as a value, FDT ignores the and uses name only to find the address of the value name mode one FDT never does conversions from to be copied. to e another. String-mode constants (/Z or /An) must appear enclosed in The FORTRAN conventions for text literals single quotes. apply. e /M) and /L, RAD50 constants and logical constants (/R, must be preceded by the character # to indicate that they do not represent For names. logical the example, constants T and F are represented by #T and #F. separated e Complex constants appear as two real constants e characters. 40 most Nonstring constants may include at The number of characters represented by a string constant is limited by the length of the input line. by a comma, in the order real, imaginary. Examples: Command Meaning ACCEPT 202=1 Sets the INTEGER*2 value at offset 202 ACC DELTA=EPSILON Replaces the contents ACC ACC 'DELTA=',DELTA I=0,J=1,244/E=3,14159 to the the 1. value of contents Prints DELTA=? of on the input value. waits for an within an FDT DELTA with terminal and EPSILON. (Valid only macro.) Sets the values of locations named 1 and J to 0 and 1 respectively; sets the REAL*4 variable at offset 244 to 3.14159. ACCEPT 1I=12,'J=',d Sets the 1location named I to 12; prints J=? on the terminal and waits for input to set the location named J. (Valid only within an FDT macro.) FORTRAN DEBUGGING TECHNIQUE (FDT) NOTE Both ACCEPT and TYPE use that are loaded by FORTRAN FORMAT statements. If you subroutines to are process debugging a program without D, E, F, or G FORTRAN format specifications, then some of the format conversion routines are not loaded and FDT cannot accept or type variables with modes C, D, or E. If you attempt format use modes conversion present, FDT ?NO to prints CONVERSION Section 2.7.3 this problem. and C, D, or E routines the are error continues describes when a way the not message execution. to avoid FORTRAN DEBUGGING TECHNIQUE (FDT) CONTINUE 2.5.2 CONTINUE The CONTINUE command resumes program execution after any FDT pause. The next statement executed is the statement whose internal statement number and procedure name appeared in the last pause message. When it executes a CONTINUE command, FDT ignores any commands remaining on the line. If the current FDT pause occurred as the result of a PAUSE command, the CONTINUE command can have one optional parameter called the execution count. FDT ignores the execution-count parameter if the current pause is an automatic pause or if it occurred as a result of a STEP The or WATCH form of the command and parameter CONTINUE The parameter ntimes command. is: [ntimes] is: The execution count. The execution count is an integer specifying the number of times the FORTRAN program must reach this point before another FDT pause can occur here. If you omit the ntimes parameter or if ntimes = 1, an FDT pause this point cancelled by occurs the next time control (unless the PAUSE command subsequent commands). is reaches replaced or FORTRAN DEBUGGING TECHNIQUE (FDT) DIMENSION 2.5.3 DIMENSION The DIMENSION the FORTRAN a command array subscripted DIMENSION associates you name. want FDT command 1is to name and a list of dimensions with allowing the access FORTRAN virtual arrays. The equivalent of NAME cannot the a define, subscripted-name name to be used the as command. The form of the DIMENSION The parameters DIMENSION command is: name(i,j,...)[,loc] are: name (L,F500¢s) The FDT The list of dimensions associated with name to There may be dimension value loc the range The location (base) 1 of be at in through associated most seven the list must the array. the array. dimensions. be an Each integer in 32767. specification the with array. for The the first offset for element the base of storage map. the array appears in the FORTRAN Offsets for FORTRAN virtual arrays are not valid loc parameters. If you omit the loc argument, FDT erases Section The mode code subscripted is an it in DIMENSION the subscript ASCII if you You better (/An) when is used specify ASCII attempt message to wuse of the location the mode the to specify the FDT wuses the the array. referring valid in subscript mode in (see default practice not in specified part can command. calculations mode meaning is name 2.5.4). important names. However, the to a DIMENSION a DIMENSION command mode FDT explicitly it message However, responds for command. mode because error command. name, DIMENSION specified No command, specification a intended calculation. subscripted in ERASE in all has no appears when you with the error DATA with 10 offset 46. ?UNDEFINED. Examples: Command DIMENSION DIM DATA (10,10),46/E COLUMN (10),DATA(1,3)/E Meaning A REAL*4 array named by 10 A one-dimensional COLUMN column dimensions at equivalenced of the array REAL*4 to the DATA. array third FORTRAN DEBUGGING TECHNIQUE (FDT) The following example shows a useful trick for naming one an element array. NAME W,DATA (5,5)/E A REAL*4 variable W array to NAME (see 2.5.8). element command equivalenced (5,5) 1in of DATA Section of FORTRAN DEBUGGING TECHNIQUE (FDT) ERASE 2.5.4 ERASE The ERASE command and frees the The ERASE command cancels space in has the FDT's the association internal following of a name and a location, tables. form: ERASE namel[,name2,...] You can specify as many names or subscripted names in an ERASE command as can fit on a single line. The names must be separated by commas. Subscripted names must appear without subscripts; subscripts are invalid in for of part the an ERASE command. It array. is not possible the variables to erase the name Examples: ERASE TIME ERASE SPEED,DIST,DATA,ICOUNT ERASE does names are not change the values of erased. 2-19 whose associated FORTRAN DEBUGGING TECHNIQUE (FDT) GOTO GOTO 2.5.5 The GOTO command changes the order of execution of commands within an FDT macro. It causes an unconditional transfer of control, analogous (Do not confuse the to that caused by the FORTRAN GO TO statement. change the order cannot GOTO FDT the TO; GO FORTRAN the and FDT GOTO of execution of FORTRAN statments.) Like the FORTRAN GO TO, the FDT GOTO requires numeric statement labels. The form of the GOTO command is: GOTO label (Remember that FDT command names must not contain spaces; GO TO is an invalid FDT command.) The parameter label is: The numeric label of the command to which control is The label must be an transferred by the GOTO command. not Embedded spaces are integer in the range 1 to 32767. valid. H FDT uses the first labels have the same value, If the label you reference does not exist the label. If two or more occurrence of within the current macro, FDT prints the error message ?LABEL. You can use the IF command and the GOTO command to create loops of FDT commands analogous to simple FORTRAN loops or to FORTRAN DO loops (see sections 2.5.6 and 2.5.7). For example, if the first command in the the 1last command in a loop might be IF loop has the 1label 100, The only loops you can do are on conditions or NEXT<>0;GOTO 100. values:; there is no way to increment an index in FDT. If FDT is executing an infinite loop, you can terminate execution only The monitor's START by typing CTRL/C twice to return to the monitor. or REENTER commands can then operate in the same way as the START However, in some cases, you will have to use the RUN command in FDT. command to reload the FORTRAN program and start the debugging session from the beginning. Defining a Label You label a command by preceding it with an integer. The label must the 1left parenthesis that marks the beginning of the follow either macro definition or the semicolon that delimits the preceding command. The label may be set off by spaces in its defining occurrence. The following macro definition contains a label: MACRO 1 (TYPE MAX; GOTO 10; S 3) 10 ACCEPT 'INIT=',INIT ;IF INIT>MAX; FORTRAN DEBUGGING TECHNIQUE (FDT) IF 2.5.6 The IF You if command wuse a The 1IF given form IF The IF to requests specify condition of the conditional that is command The <rel> value mode The logical is one of <> (not equal), or or equal). The value mode as six to compared be loc, or assumes ignores the FDT modes The in the single command must fit than), than), or to 1loc. valid. not) only loc >= ACCEPT one in the same mode of name. It in the also the command, that discussion Section is the loc. as loc, defined one mode of mixed 2.5.1.) executed specified of of compares mode from same namne. mode has name wvalue FDT mode conversions than the mode and command (greater The The be <rel> (less the does to J. (equal), match name actual = <= defined are or parameter previously need I, relations: a (See on The wvalue constant of FDT (less the 1logical relation value is true. IF command. executed E, a never another. be either that the contents loc. to The FDT be be names should the (greater < may for must tested. logical > (but ky loc equal), name and of relation the Subscripted FDT command specification The parameter IF to command location than entire another is is: compared. The of command are: loc FDT FDT met. loc<rel>value;FDT parameters execution another between only if loc and line. command compares the value in loc to the value specified. relation is true, FDT executes the FDT command specified. If relation is not true, FDT does not execute the command but skips the next command. the If the to Example: IF If PARM/I>5;WATCH PARM COUNT, is greater than and executes the executes the next COUNT;STEP 5, FDT next FORTRAN sets FORTRAN statement. a watch on statement; the 1location otherwise, FDT named simply FORTRAN DEBUGGING TECHNIQUE (FDT) MACRO 2.5.7 MACRO The MACRO command allows you to define, execute, or delete an FDT An FDT macro is a sequence of FDT commands that is executed as macro. or subroutine Thus, an FDT macro is analogous to a FORTRAN a unit. subprogram. function 1. Defining a macro You can create a new macro, command typing: by MACRO m(FDT The parameters m FDT commands or change an existing macro, with a MACRO commands) are: The number of range 7. 0 to the macro where m Any valid FDT command There is no or space between 1is series of the a value in the and the commands. macro number (m) left parenthesis. The FDT commands appear within the parentheses, separated by semicolons. There 1is no limit to the number of commands defining a macro. The definition may continue on as many lines as necessary. FDT prompts is defined by for the each new line. The end of closing right parenthesis. the macro Examples: The following example prints the values of the variables associated with the names TIME, SPEED, and DIST, and the first two elements of the named array MACRO DATA: 3 (TYPE TIME,SPEED,DIST,DATA(l) ,DATA (2)) The following example shows a multiple-line macro definition. The macro accepts a floating-point value VAR from the terminal, and tests whether VAR is within the limits required by the program. If VAR is outside the limits, FDT goes to the command labeled "100" and prompts for another Previous definitions: NAME NAME Macro value. VAR, 234/E TOP, 240 /E definition: MACRO IF 5(100 ACCEPT VAR>TOP; GOTO 'VAR=',6VAR; 1luU; CON) 1IF VAR<K1l2.; GOTO 100; FORTRAN DEBUGGING TECHNIQUE 2. Executing You can FDT executes a macro execute a a macro macro by You macro execute MACRO The automatically a PAUSE whenever command manually by or it manually: executes containing typing the a an MACRO FDT pause parameter following (see command: m parameter is: m The a either automatically that was set up Section 2.5.9). can (FDT) The number of m is a number specified macro the macro to in the range executes until FDT be executed. 0 to 7. reaches the end The value of the of macro, at which time FDT prompts you for more commands by printing !, or until a START, STEP, or CONTINUE command within the MACRO is executed, at which time FDT resumes execution of the FORTRAN program. 3. Deleting You can The form delete of MACRO The a macro a the macro by command redefining it with is: a null command string. m() parameter is: m The () Null number not of command enclose the macro string. any in The the left characters or range and 0 to right 7. parentheses must spaces. Implicit Macro MACRO 0 is a special macro number that you cannot associate with a PAUSE. Any current PAUSE command that you have not associated with another MACRO is implicitly associated with MACRO 0 command MACRO 0 is usually without not a defined. MACRO 1If parameter you do define executes manually. 2-23 MACRO MACRO 0, 0. You explicitly explicitly MACRO 0. every can PAUSE execute FORTRAN DEBUGGING TECHNIQUE (FDT) NAME 2.5.8 NAME The NAME command associates a name with a location and a mode. The name must be unique in the first six characters. Any characters after the sixth are ignored. The first character of the name must be a letter. The other characters can be either letters or digits. The form of NAME The the NAME command is: name[,loc] parameters name loc are: The name to be associated with the wvariable. If the name you specify has already been defined, this NAME command redefines the name. The o0ld definition is lost. The location specification 2.4.2 and 2.4.3). If specification, FDT cancels ERASE command, Section (as described in Sections you omit the location the name association (see 2.5.4). Examples: Command NAME Meaning I,202 INTEGER*2 variable I NAM PARM,16/PI INTEGER*2 parameter NAM DELTA,I+2/E REAL*4 variable DELTA at offset 204. (Relative location I+2 is location 202+2.) NAM EPSILON,DELTA+4/E REAL*4 variable EPSILON at offset 210. NAM Erases PARM the at offset 202. PARM at offset definition of PARM. 16. FORTRAN DEBUGGING TECHNIQUE (FDT) PAUSE 2.5.9 PAUSE The PAUSE command Section 2.4.4). defines The PAUSE marks want an command FDT statement the next pause to number. one to the statement occur. The be statement You pause mark occurs pauses and in program your the only entry statement when the pauses before which you statement is using marked (see its internal executed. You can define a statement pause for any executable FORTRAN statement in your program, even if that statement is located in a procedure that is nonresident or in a shared library. The location of the pause is stored itself. internally You place can an by entry FDT. It pause on is not the stored entry in the point FORTRAN of program any FORTRAN subroutine or function. Whenever the procedure is called, FDT issues the message FDT PAUSE AT ISN 0 IN proc. You can use this feature to detect calls to a procedure without having to determine the first executable statement of the procedure. The PAUSE There are parameters PAUSE command two MACRO command requires you to specify optional parameters. and in AFTER either the location You can order. The of specify complete the the form pause. optional of the is: PAUSE {[proc],isn} [MACRO m][AFTER ntimes] proc The parameters are: proc,isn The location proc The name of occurs. name is printed you the the The current program, If of statement procedure default the name of procedure the specify procedure last a and 1in be marked. which value for the the pause procedure the current procedure. is defined as the subroutine, in to or name or function as 1isn parameter, the FDT function FDT pause subroutine omit the The main was whose message. establishes an entry pause at the entry point of the FORTRAN procedure you named. You cannot place an entry pause on the entry point of an assembly language routine. (Note that "proc,0" is not equivalent to "proc" because internal statement isn The number internal source listing. is undefined.) statement statement occur. The the left 0 where internal of each number you want of the the FDT FORTRAN pause to statement number appears to statement in the source FORTRAN DEBUGGING TECHNIQUE (FDT) NOTE FDT does not give an error if message or nonexistent a specifies proc,isn FORTRAN the nonexecutable statement in an containing command The program. is number statement internal invalid the nonexistent or effectively ignored; by executed nonexecutable point is not the program and thus cannot cause an FDT pause MACRO m to occur. FDT the when executed 1is The FDT macro that An FDT macro is a sequence of FDT pause occurs. 1is It unit. a as commands that is executed in function or subroutine a to analogous PFor more FORTRAN. see Section 2.5.7. FDT on information macros, FDT the The m argument specifies the number of want to associate with the FDT pause you macro an be The macro number must you are creating. integer in the range 1 to 7. The MACRO m parameter is valid whether or not macro can be defined or The exists. m macro PAUSE changed at any time without affecting the the macro does not exist when the If command. operates FDT pause occurs, parameter were not specified. If as the macro does exist when the if the pause macro occurs, macro without issuing an FDT the executes FDT If the macro contains a CONTINUE pause message. program FORTRAN the of execution command, a contain not does macro the If resumes. command, FDT prompts for more commands CONTINUE when it has finished executing the macro. You can abbreviate the word MACRO to MAC. Only for checked are characters three first the (Remember that there must be spelling accuracy. a space between the word MACRO and the macro number, AFTER ntimes m.) The execution the specifies count. number parameter the program must reach (but not execute) the marked statement before an FDT pause occurs at that point. The ntimes value must be an integer in the range 1 to 32767. The default value for the of The ntimes times that AFTER ntimes parameter is 1, which causes an pause the first time program control reaches statement. FDT the FORTRAN FDT DEBUGGING decrements control TECHNIQUE the reaches specified. is zZero. An automatically default value (see by value of value.) You the abbreviate first three spelling a space count, can be at most eight active one time. If you attempt to program, FDT prints out the error You cannot pause place If you definition Statement pauses command, Section two pause try to are not definitions the current the initial the (Remember word that AFTER and there the Only for must be execution PAUSE commands in a program at define more than eight pauses message ?NO ROOM. definitions place two the first. cancels the required ntimes command pause contain count, the the ntimes.) There program. count FDT the word AFTER to AFT. characters are checked accuracy. between specify CONTINUE (The command execution can the time number occurs when the pause occurs, count, 1in a WHAT each statement the execution count to If you want to override 2.5.2). the count internal FDT pause When the resets of 1. Section output execution the default execution execution count (FDT) disabled when pauses FDT at the at is same point in the same point, the in step mode (see any in a vyour second STEP 2.5.12). Example: The following PAUSE places an statement command SUBR;PAUSE entry pause 10 the of line ,10 on procedure current SUBR, procedure. and a statement pause on FORTRAN DEBUGGING TECHNIQUE (FDT) RESET 2.5.10 RESET The RESET command removes pauses created by fhe PAUSE command. The form of the RESET command is; | RESET proc,isn The parameters are: The 1ocation in the FORTRAN proc,isn in proc RESET the internal statement source command ,10;RES in which the pause was statement where number the of the pause was the FORTRAN to occur. line SUBR removes the statement pause on statement 10 of the and which occur. The isn example, for the pause definition. The name of the procedure to For program The location specified was defined. pause the appeared must be exactly the same as that which entry pause on procedure SUBR. current procedure FORTRAN DEBUGGING TECHNIQUE (FDT) START 2.5.,11 START You can issue the START command whenever FDT prints its command prompt. The FDT START command begins executing your FORTRAN program at the first executable statement in the main program. However, START might not work when the system is not in an initial or ready condition. For example, if there are open files, a START command causes an error message and FDT returns control to the monitor. The START command has no parameters. When the executed, FDT ignores any commands remaining in the START line. command 1is FORTRAN DEBUGGING TECHNIQUE (FDT) STEP STEP 2.5.12 The STEP command continues execution of ybur program in step mode, and indicates the number of statements that you want to execute before the next The FDT pause. forms of the command and its optional parameter are: STEP [n] S [n] (Notice that the STEP command has the special abbreviation S.) The parameter n An is: integer in the range 1 to 32767. FDT executes n FORTRAN The default value for n is 1, pausing. before statements which results in single-step operation with a pause before each statement. Step mode disables all statement pause definitions. You cancel step mode and reenable the pause definitions by entering any FDT command (other than another STEP command). The occurrence of an FDT pause also cancels step mode. STEP counts only executable as one logical executable 1IF (depending statement on the statements. statement may be if one it or A logical IF statement counts contains a GOTO; two outcome of the IF test). executable otherwise, a statements The END statement is an executable statement. Nonexecutable statements are FORMAT statements, declaration statements, and SUBROUTINE and FUNCTION statements. After in the it executes a STEP command, line. FDT ignores any commands remaining FORTRAN DEBUGGING TECHNIQUE (FDT) STOP 2.5.13 STOP You issue the STOP command to end a command in FDT is equivalent to program. The STOP command closes any necessary exit The STOP actions, command has no and returns parameters. a debugging session. The STOP STOP statement in the FORTRAN open logical units, performs control to the operating system. FORTRAN DEBUGGING TECHNIQUE (FDT) TYPE 2.5.14 TYPE The TYPE command prints the values of variables in the FORTRAN program ' during a debugging session. The forms of the TYPE command are: TYPE loc|[,more] or TYPE The 'text'([,more] parameters are: The location specification of the variable whose value loc you want to examine. A literal text string to be printed on 'text' the terminal. The FORTRAN conventions for text literals apply to FDT literals. Another more loc or text parameter. Multiple loc or text parameters may appear in a single TYPE command. The maximum length of the The parameters must be separated by commas. TYPE command is one line. FDT finds each location specified and prints the contents of the FDT location in the mode indicated by the location specification. the for (except them type you as exactly literals prints text If multiple parameters appear in a TYPE enclosing quotation marks). command, FDT separates the values with commas. Examples: Meaning Command TYPE 202 Prints INTEGER*2 variable at offset 202. TYPE 'HI' Prints HI. TYPE 'DON''T' Prints DON'T. TYPE DELTA,EPSILON Prints two values separated by a comma. TYPE DELTA/O Prints first 16 bits of DELTA in octal. TYPE 'DELTA=',DELTA Prints DELTA= TYPE DATA(I,J) followed by the value of DELTA. Prints the value of the in DATA. (i,]j) array element FORTRAN DEBUGGING TECHNIQUE (FDT) WATCH 2.5.15 WATCH The WATCH to perform command The form a of WATCH The directs watch the pause WATCH FDT to watch the the value whenever command contents in that of a location location and changes. is: [loc] parameter is: loc The specification of the 1location to be watched. (Secticns 2.4.2 and 2.4.3 describe how to specify a location.) Only one location can be watched at any given time. A new WATCH 1loc command cancels the previous WATCH command. A WATCH command without a locaticn specification cancels the previous WATCH loc command. The location to be watched can have any FDT mode except Alpha (/An). Only the first character of the string is watched for locations in ASCIZ string mode (/2) . When WATCH the value PAUSE, statement. equal If to of The 5, another a and value then FDT watched performs must the command value in changes, pause actually changes pause does occur. pause by using FDT's watched FDT statement watch watch a location an at change. IVALUE=5 the value FDT the does of prints next For example, not a For example, you can information transfer the message executable cause watched a if FORTRAN IVALUE watch location, pauses are location. independent watch pause and any or STEP) on the same pause and another other pause first. START before the Examples of the a deliberately trigger a commands to change the Each time a watch pause occurs, FDT cancels the WATCH command initiated it. You must issue another WATCH command with the location specification if you want FDT to continue watching the location. Watch is pause. of other FDT pauses. You can place other command causing a pause (for example, FORTRAN statement. If you do specify a pause You watch WATCH WATCH MAX WATCH ARRAY (3,2) must pause for the resume can command: same statement, execution occur. using FDT that same same processes CONTINUE, a PAUSE watch STEP, the or FORTRAN DEBUGGING TECHNIQUE (FDT) WHAT 2.5.16 WHAT The WHAT command displays the current status of the FDT systenm. you type WHAT, FDT returns the following information: When A list of the definitions for all the active pauses. For each pause, FDT prints the 1location of the pause (the procedure name and optional internal statement number), the current value of the execution count (when it is greater than 1), and any associated macro number. The pause listing for an entry pause has no internal statement number. A list of of the all macros. currently defined macro numbers and the contents FORTRAN DEBUGGING TECHNIQUE 2.6 CAUTIONS AND (FDT) PITFALLS The following are some general cautions you should observe while using FDT: e @ ® Correct use of is important Invalid location specifications cause unpredictable in FDT. or constants out range of results. Under the RT-11 SJ operating system, the ends of long lines of text printed at the terminal may be lost when the terminal reaches its right margin. FDT does not provide automatic carriage e spaces return or line feed. subscripting of purposes For ASCIZ mode (/Z) with locations For example, the considers FDT copying, and to have a length of one byte. command NAME/Z=INPUT ACCEPT copies only the first character from INPUT to NAME. To copy an ASCIZ string, use mode An, where n is equal to the maximum possible length of the ASCIZ string, including the terminating zero byte. For ACCEPT NAME/A25=INPUT copies e bytes 25 example, from the INPUT to NAME. An FDT error message does not indicate that an entire command was abaorted. Some action may have occurred before discovery of the error. 1In this case, side effects <can result. For example, the command SUBR+12 PAUSE produces the error message PAUSE command e command FDT ignores any commands For example, if you type STEP 3 ?UNDEFINED, but it acts 1like the SUBR. ; TYPE following CONTINUE, the command line START, or STEP. INDEX FDT executes three FORTRAN statements and then pauses, without However, commands following CONTINUE, START, typing anything. or STEP are executed if FDT control branches around CONTINUE, START, or IF STEP. For example, if you type SPY<50;CONTINUE; TYPE INDEX then FDT resumes execution if SPY is less than 50, but the contents of INDEX and waits for another FDT command is ® greater than or equal to types if SPY 50. You cannot place an FDT pause on the GO TO of a logical IF Statement. For example, suppose the FORTRAN source listing contains 0008 the following statements: NEXT=NOW+1 0009 IF (ITEMS (NEXT) .GT.ITEMS (NOW)) GO TO 0011 TEMP=ITEMS (NOW) 50 FORTRAN You is, DEBUGGING TECHNIQUE cannot place an FDT pause the FDT command PAUSE never on internal causes a DO IF 0011 50 statement 10 would be wvalid the following statements: 50 NEXT=1,N (ITEMS (NEXT).GT.MAX) ADVANCED The use following to extend 2.7.1 Named pause 1if the MAX=ITEMS (NEXT) before If the the value of MAX condition is false, occurs. TECHNIQUES sections describe power. some advanced techniques that you can FDT's Common FDT can access variables in a FORTRAN named common block define the block using the NAME command. Use the following ll That CONTINUE In this case, the FDT pause occurs changes 1if the condition is true. 2.7 10. pause. goos 0009 FDT statement ,10 However, an FDT pause on source listing contained no (FDT) Locate the address of the named common after you procedure: block. The absolute address of the named common block appears in the link map. The name given to the block in the FORTRAN source code appears in the 1link map under the column labeled SECTION. The 6-digit number following the name 1is the address of the block. For RT-11 FB foreground programs, the named common block address appearing in the link map is a relative address. The desired absolute address is the sum of the link map relative address and the foreground Jjob load address. Obtain the foreground load address by issuing the FRUN command with the /P option. monitor; Describe (The type the named A NAME command location: NAME The addr in option to common the causes execute block the to following control to foreground return to the job.) FDT. form defines the block's block, .ABS.+addr arguments block /P RESUME are: The FDT name of the common block. If block name is the same as the name variable in a previous NAME command, erases the previous name. The 6-digit common absolute block. 2-36 address of the the of a FDT named FORTRAN 3. Refer The to DEBUGGING locations location of TECHNIQUE in named any (FDT) common. variable in named common is expressed as follows: block+nnn The components block of The nnn the FDT specification name of the are: common block. The offset of the variable FORTRAN storage map. You can assign FDT names to variables using block+nnn as a location in a NAME as given in named command. in the common by Examples: Assume the that link the name map gives of its the FORTRAN address as named common block is COMBLK and 063524, Describe the named common block to FDT: NAME Print COMBLK, .ABS.+63524 the contents of an INTEGER*2 variable at offset 000010 the address and 1in COMBLK: TYPE Name the COMBLK+10 variable NAME Print contents TYPE FDT COMBLK+10: of the variable: INDEX How uses location INDEX,COMBLK+1l0 the 2.7.2 at FDT Generates the location Addresses specification to generate mode information of a FORTRAN variable. The manner in which FDT generates the 16-bit PDP-11 address depends on the information in the location specification. The following section describes the address-generation process Octal The for the five kinds of location specifications. Offsets form oct of the An location octal specification number in the is: range of 0 to 177777. When you give an octal number as a location specification, FDT always interprets the number as an offset from the base address of the current procedure's data block. In other words, FDT adds the octal number to the base address to generate the 16-bit address. Thus, you can use the offsets produced by the FORTRAN compiler to generate addresses for any locations shown in 2-37 the FORTRAN storage map. FORTRAN DEBUGGING TECHNIQUE (FDT) Names The form of name the location specification An alphanumeric The first the variable. name character is: unique in must be a the first six letter. FDT characters. 1ignores any first number in six the characters after the sixth. The NAME command associates a name with a location. Once the association has been established, the name refers directly to the location of Relative Addressing The form of the name+oct location specification is: An alphanumeric name unique 1in the characters, a plus sign, and an octal range 0 to 177777. This location specification is a form of relative addressing in which the base address is the location associated with the name. FDT adds the octal displacement to the base address to determine the 1location of the wvariable. Displacements in the range 100000 to 177777 are negative displacements. FDT assumes that all octal numbers represent two's complement binary integers. For example, the displacement 177776 represents a displacement of -2 bytes (the word preceding the name) . You must determine the displacement yourself. It does not appear in the storage map. You could use relative addressing for array subscripts. However, this is unnecessary because FDT allows you to define subscripted names. Relative addressing allows you to address variables in named common blocks once you have supplied the base address of the common block. There are addresses several predefined names for relative addressing. . MAIN, in FDT These that you <c¢an names are: wuse as Dbase The default name assigned by FDT to the base address of the FORTRAN main program. You can reference any location in the main program using this base. If you named your main program with the FORTRAN PROGRAM statement, then FDT uses that name to find the Dbase address. . BCOM. The name assigned by FDT to the base address of the FORTRAN blank common area. Use .BCOM. to reference variables in blank common. .ABS. The zero address of base address for location. For of example, absolute TYPE the memory. FDT referencing following location .ABS.+56/0 56 uses any command (octal) in this name absolute prints octal the as the memory contents format: FORTRAN DEBUGGING TECHNIQUE (FDT) Subscript Addressing The form of the location name (i,j,k,..) A specification subscripted most seven name is: for specifying dimensions. The form of addressing name (1,1,1,...). FDT wuses the displacement element. | FORTRAN from subscripting the base address base is to with for the algorithm and arrays address locate at this address of to compute the the specified array Indirect Addressing When you define FDT wuses the a name indirect address. name as the as 1location That address a parameter is, FDT of the specifying with regards the the desired location of the parameter PARM contains 1234, then the command TYPE (by associated value mode For 2000, as name associated value. contains its parameter with example, and P), as if location an the the 2000 PARM/I,PARM/PI prints 2000,1234 2.7.3 Format Conversion TYPE, ACCEPT, and IF conversion routines. D, G format that FDT E, F, or routines D, or with E modes you commands If the use requires can force for the C, linker following 1. When you link your program, first linker command line. 2. The Type procedure: responds by a return end On-line If you use sometimes to the contains Debugging assembly need to linker and E to load include carriage conversion program the library debugging does modes. 1If the the not have not load the require C, you required /I format does routines switch in the request the SEARCH: (followed only) FORTRAN are with: floating-point resulting 2.7.4 RCIS then D, the linker the program you specifications, LIBRARY The Routines library all Technique return) routines the and search necessary a to null line (carriage list. conversion routines. (ODT) language routines with use FDT and ODT at FORTRAN routines, you may the same time. There is no interaction between the two debugging techniques except when ODT, which runs at a higher priority, occasionally interrupts the output of FDT or traps. of the FORTRAN program. FDT does not use breakpoint or T-bit FORTRAN DEBUGGING TECHNIQUE (FDT) 2.7.5 Execution Speed traceback feature to FDT uses the FORTRAN internal statement number N progra m and to execute gain control at the beginning of a FORTRA some overhea d to the adds FDT re, Therefo PAUSE and STEP commands. execution of each FORTRAN statement and slightly reduces the execution speed of any FORTRAN program. program is difficult The amount of FDT overhead time in a main FORTRAN ritical However, you can get fully debugged, time-croutine to reduce. s these compile should You speed. subroutines to run at full these within FDT use cannot You d. disable feature ck traceba the with of FDT for routines. However, you can use the entry-pause feature traceback the require not does pause entry the because s routine these ine subrout a before tely immedia feature. If you issue a STEP command the to s proceed control , numbers nt stateme l interna without compiled ck traceba the with routine a in next executable FORTRAN statement feature enabled. pause Execution speed with FDT is affected by FDT pauses. Each active slows larly particu It nts. stateme slows the execution of all FORTRAN the of that than greater numbers nt stateme l interna with those if quickly more runs program The statement where the pause occurs. (see pauses Entry y. necessar longer no are that pauses you reset Section 2.5.9) do not require overhead for traceback and hence are more time efficient than other PAUSE commands. APPENDIX A ARGUMENT AND DEFAULT SUMMARY TABLE The table contains arguments and default values for the extensions routines. Arguments in square brackets can be either defaulted or omitted. If there is a numeric default value, it appears in the column directly below the argument name. Consult the relevant reference section to find out what happens when you omit a bracketed argument that does not have an explicit default value. SECTION ROUTINE | ARGUMENTS 1.4.1 CLRD iarrayname npoints 1.4.2 CVSWG ivalue [igain#] 1.4.3 DIS iydata 144 DRS [iarrayname] ispace# rscale ispace npoints istart increment iarraysize [nsubarrays] {nsamples] [isource] 1 iarraysize 0 iydata npoints istart increment - i.4.5 DXY ixdata 1.4.6 FLT16 ivalue 1.4.7 FSH iydata | ispace npoints istart increment 14.8 FXY ixdata iydata npoints istart increment 1.4.9 HIST iarr_ayname iarraysize nsamples iendflag# nleft# 1.4.10 IADC ichannel [igain] ivalue# litype] [iwhere#] 0 - [iresult#] iunit imask l[imodeTM] iendflag# nleft# 0 Hintervall [complete] iarraysize/nsubarrays -~ [interval] [complete] iarraysize/nsubarrays - 1 1.4.11 IDIR (a) [isource] iunit imask 0 1.4.12 (b) , iflag ibefore iop (c) , iflag imask , [idest] iunit iselect iset IDOR (a) 0 (b) , — iunit 1.4.13 KB2BCD ibinary 1.4.14 KBCD2B idigits 1.4.15 LED ivalue ‘format’ 1.4.16 LWAIT ivalue1 ivalue2 1.4.17 REL irelay isetting 1.4.18 RTS [iarrayname] iarraysize - 1.4.19 SDIS 1.4.20 SETR lirate] - [ioutput#] imode imask [iset] [iclock#] [nsubarrays] [nsamples] [ifirst] [nchannels] [igain] [imodeTM] 1 iarraysize 0 1 1 0 rcount iendflag# [interval] [complete] 1 - iendflag# nleft# APPENDIX OBJECT AND LDPOBJ.OBJ, which you receive software, B SOURCE as FILES part of the is a file concatenating 28 individual appendix lists the names of all the object modules the corresponding source files. The FORTRAN software kit includes one source file, CONFIG.MAC. files can be Object File CONFIG.OBJ CLRD.OBJ ordered in Source separate kit. File CONFIG.MAC CLRD.MAC CVSWG.0OBJ CVSWG.MAC DIS.OBJ DIS.MAC DRS.OBJ DRS.MAC FSH.OBJ a Configuration CLRD definition DIS, SDIS, DRS processor FSH and DXY processors for HIST.OBJ HIST.MAC HIST digital 1I/0 processor processor IADC.OBJ IADC.MAC IDIR.OBJ IADC processor IDIR.MAC IDIR processor IDOR processor IDOR.MAC all processor FLT16 KB2BCD.MAC KBCD2B.MAC LAO.MAC LAl .MAC LA2.MAC LDISP.,MAC module CVSWG processor FLLT16.MAC IDOR.OBJ files. This and the names of extensions binary The other source processor FLT16.0BJ KB2BCD.OBJ KBCD2B.OBJ LAO.OBJ LA1.0BJ LA2,0BJ LDISP.OBJ extensions object Contents units FSH.MAC FORTRAN KB2BCD processor KBCD2B processor Parameter check routine Parameter check routine Parameter check routine Completion routine dispatcher LED.OBJ LED.MAC LGAO.OBJ LGAO.MAC LGA1.0BJ Argument LGA1l.MAC fetch routine LICMP.OBJ Argument routine LIN16.0BJ LICMP.MAC LIN16.MAC fetch Completion Device LED processor Convert of interrupts unsigned binary integer initialization routine to LINIT.OBJ LINIT.MAC LPARS.OBJ LPARS.MAC LPUT.OBJ Command parser LPUT.MAC Buffer REL.OBJ insertion REL.MAC RTS.0OBJ REL RTS.MAC processor SETR.OBJ RTS SETR.MAC processor SETR LPSMAC.MAC System be DIS, DXY, and FSH routine processor macro included command file for line except definitions. in to LPSMAC must MACRO assembler assemble any source the CONFIG.MAC. APPENDIX ERROR The table summarizes all of extensions routines. The ADC, CLK) Routine CLRD are described in C SUMMARY TABLE the conditions causing errors error name abbreviations (SYN, Section 1.6. Error SYN Cause Four arguments The number (npoints) is CVSWG DIS SYN from the ARG, DEV, The scale One or SYN Five ARG The required. of el ements to be scaled less than one. factor (rscale) is negative two arguments arguments number of required. required. points to display (npoints) is less than one or greater than 4096. The first point (istart) is less than one. The indexing factor (increment) 1is 1less than one or greater than 4096. DRS SYN Ten to ARG The digital 12 arguments input does not exist. The memory address odd. The mode The mode requested requested the call mode. DEV DXY Digital SYN Five ARG The 1is not input unit arguments number of required. unit requested specified (iunit) (iunit) 1is (imode) is not valid. (imode) is negative, but in parameter adjustment is in use. required. points to display (npoints) display (npoints) is less than 1 or g reater than 4096. The first point (istart) is less than 1. The indexing factor (increment) is greater FLT16 FSH SYN than 4096. One argument SYN Five ARG The required. arguments number of required. points to is less than 1 or greater than 4096. The indexing factor (increment) 1is than 1 or greater than 4096. The first point (istart) is less than less 1. ERROR SUMMARY TABLE Routine FXY Cause Error SYN ARG Five arguments required. The number of points to display (npoints) is less than 1 or greater than 4096. The first point (istart) is less than 1. greater The indexing factor (increment) is than HIST SYN ARG 4096. Five arguments required. The length of the array less than than zero. The number IADC SYN ARG One The (iarraysize) (nsamples) of samples to three arguments required. channel number 1is greater (AR11l, The 1. AD1l1-K). channel greater 1is number (AD11-K with AM11-K, LPS1ll). The gain code (igain) 1is greater DEV IDIR IDOR LED Four or five arguments required. Memory address (iunit) is odd. Digital input register (iunit) exist. SYN SYN Four or five arguments required. Memory address (iunit) is odd. Digital output register (iunit) exist. One argument required. The value (ibinary) is negative 9999. SYN One argument SYN Two arguments required. Illegal format requested. 15 63 or or does not does not greater required. System does not have an LPS1l. none SYN ARG RTS : use. than DEV REL in than 1less the AR1l. SYN ARG ARG LWAIT Autogain was requested for than negative A/D converter is ARG KBCD2B 4. ADC ARG KB2BCD than 1is |is Two The arguments required. relay number is less than 1. an LPS1l. DEV System does not have SYN 10 to 12 arguments required. Starting channel number is too large. The number of channels (nchannels) is negative or too large. Autogain was requested for the ARII. The gain code (igain) is greater than 4. The mode (imode) is less than -4 or greater than 15. The sum of ifirst and nchannels requests a ARG nonexistent channel. Array partition nchannels. size is not a multiple of ERROR Routine SUMMARY TABLE Error Cause Autogain was requested with DMA. Continuous sampling with stop code requested with DMA. The array length (iarraysize) with DMA greater than 4090. A/D converter 1s in use. DEV SDIS none SETR SYN ARG Four to Rate is The mode six arguments required. less than -4 or greater requested The - count value greater than 255. DEV Clock is CLK Clock interrupt (imode) (rcount) is than not for (clock 1is 7. valid. AR1ll running. lost was overrun). is APPENDIX FDT Command Parameters ACCEPT loc=value COMMAND D SUMMARY Description Assign value as the new of loc. Print text on terminal. 'text' loc Accept and a value assign it from to contents the terminal loc. CONTINUE [ntimes] Resume DIMENSION name (i,j,...) [,1loc] Associate a location specification and a subscript list with a FORTRAN execution. name. ERASE name [ ,name2,...] Remove GOTO label Unconditional branch command changes execution sequence within an IF loc<rel>value;FDT FDT the NAME m(FDT commands) macro. the Define FDT m Execute m() Delete name [ ,1loc] Associate proc,isn [AFTER ntimes] FDT condition FDT a an statement if m. m. m. location a only true. macro macro [MACRO Create command is macro FDT cation with PAUSE associations. command Execute MACRO name specifi- name. m] FDT pause number isn at internal of procedure proc. RESET proc,isn START STEP Remove Begin [n] Resume an FDT pause. execution execution statements. of main and program. execute n FDT Command COMMAND SUMMARY Parameters STOP Description Return to operating TYPE loc 'text' Print value terminal. WATCH loc Cause an contents location WHAT Print FDT or FDT of text change. system. on pause the status. the when the specified APPENDIX FDT LOCATION E SPECIFICATION Format FORMATS Meaning XXX Location name Named name-+xxx Relative name (i,Jj,k,...) Subscripted .MAIN. Base address the main offset in octal bytes location addressing name of the program FORTRAN was not main named program in statement) .BCOM. Base .ABS. The address zero of address FORTRAN of blank memory common a (if PROGRAM APPENDIX FDT Mode FORTRAN MODES Type Description I INTEGER*2 l6-bit J INTEGER*4 32 bits, first L LOGICAL*4 32 bits, displayed M LOGICAL*1 8 E REAL*4 32 value bits, displayed 16 in decimal displayed as T or as T or F scientific notation REAL*8 64 bits, scientific COMPLEX 04 bits, real B BYTE 8 bits, and notation imaginary displayed in R ———— 16 bits, displayed as 3 ———— 16 bits, displayed in octal An —-——— A string <= 255) string handling mode indicate variable. in the that above the table can associated of be n (as RAD50 ASCII used parts decimal 0 ASCIZ decimal displayed D ———— in F bits, C Z Any F in characters characters the (1 FORTRAN <= n string package). preceded location by represents the a 1letter FORTRAN "P" to parameter APPENDIX FDT ERROR Message ?BAD DIM An ?BAD LOC The MESSAGES Description of dimension limit invalid location correctly ?BAD MACRO ?BAD SUBS G Error was specification according references bounds. a An attempt was it was to location made specified. 1is not 1ts mode outside to aligned or the redefine a it program macro while executing. Subscripts are in an invalid format or cause overflow. FDT START FAIL Invalid main program, internal statement main program. ?FORMAT The input constant bad start numbers is not address, not in or enabled the in expected mode. ?LABEL ?MACRO ?NO # CONVERSION The label specified does The macro number not Floating-point current ?NO ROOM Not ?20NLY IN ?PAUSE $SUBSCR MACRO NOT OUT 2UNDEFINED The FOUND OF BOUNDS formats FORTRAN enough PAUSE, or operation FDT An attempt exist. in the range are not available program memory MACRO, an is not (see space Section to define 0-7. with 2.7.3). a new NAME. attempted is valid only within macro. was not active. The specified made to subscripts dimensions. (Warning Syntax or error remove exceed message undefined a PAUSE the only.) name. that is declared INDEX A/D, 1-2, 1-3, 1-41, 1-62 Abbreviations, 1-80, 2--3, 2-30 .ABS., 2-36, 2-38 : Absolute address, 2-36 ACCEPT, 2-3, 2-13, 2-21, 2-39 Circular ADC software, 1-2, 1-6, 1-52, 1-~75 CLOCK ERROR~--RATE TOCO CONFLICT, 1-80 Address, absolute, 2-36 base, 2-4, 2-17, 2-37, 2-38, hardware, Clock CLrRD, ARGUMENT Code, _ FDT circular, 1-7, 1-8, 1-20, 1-39, 1-63 virtual, 1-4, 2-17 Array element, 2-6, 2-10, 2-39 Array partition, 1-7, 1-8, 1-20, 1-24, 1-63, 1-67 ASCII mode, 2-17 mode, 2-33, 2-35 Asterisk convention, 1-10 Asynchronous, 1-5 Autogain, 1-2, 1-42, 1-43, 1-65, 1-69 pause, 2-1, 1-13 1-72 frequency, 1-3, 1-13, mode, 2-7, gain, 1-15, inline, mode, . 2-38, 2-4, 2--17, FDT, 1-17, data type, 1-55, 1-56 2-1 2-2 control, 2-10 2-37, control, 1-9, 2-19, to, 2-5, 2-38 2-38 1-1, 1-2, 1-8, 1-19, 1-3, 1-4, 1-5, 1-24, 1-25, 1-28, 1-33, 1-59, 1-68, 1-71, Conditional transfer of 1-55 control, 1-22, CONFIG.MAC, 1-39, 1-76 2-21 1-78 Configuration, to, 1-56 two's complement, 1-30, unsigned, 1-6, 1-30 Bipolar mode, 1-42, 1-65 Bit location, 1-22, 1-45 Bit manipulation, 1-46 Bit values, 1-10 Blank common, 2-5, 2--38 BOUNDS, OUT 2-2 2-32 Common, system, $SUBSCR 2-2, 2-33 program Commas, 2-3 transfer, 1-1, Configuration BCD 1-65 1-53, 1-2, 1-35 types, 2-4, Binary, convert 1-33, 2-8 1-42, information 2-39 convert binary 1-80 2-17 Command FDT BCD, BCD FAST, 1-72 named, 2-5, 2-36, Completion routine, address, 1-48, 2-1 threaded, blank, Base 1-20, Commands, ASCIZ Automatic FDT 1-8, Clock mode, 1-72 Clock overflow, 1-40 Clock rate, setting, 1-72 1-80 Array, 1-7, Clock, 2-39 indirect, 2-39 relative, 2-36, 2-38 /An, 2-13, 2-17, 2=-33 Analog-to-digital, see A/D ERROR, array, 1-39, 1-63 Clear display, OF, 2-6 Brackets, square, 1-9 Byte manipulation, 1-46 1-78 routine, 1-78 CONFLICT, 2-38 ADC, 1-80 DEVICE, 1-80 Constant, 1-9, octal, 1-10 1-10 string, 2-13 CONTINUE, 2-26, 2-35 2-2, 2=16, 2-23, Continuous display, 1-3, 1-27, 1-35, 1-71 1-16, Continuous sampling, 1-19, finite, 1-19, 1-62 infinite, 1-19, 1-62 Index-1 1-62 INDEX Control, relay, 1-61 scope, 1l-16, 1=-27 unconditional transfer of, 2-20 Control commands, FDT, 2-3 program, 2-2 Convention, asterisk, 1-10 mode, 2-13 notation, 1-9 syntax, 1-9, 2-3 Conventions, 1-9, 2-13 Conversion, 16-bit floating-point, 1-30 format, 2-15, 2-39 single analog-to-digital, 1-41 Convert BCD to binary, 1-56 Convert binary to BCD, 1-55 Convert switched gain value, 1-15 Digital read-in sampling, 1-19 Digital-to-analog, see D/A DIMENSION, 2-3, 2-6, 2-9, 2-10, 2-17 Dimensions, see Subscripts number of, 2-6 pis, 1-3, 1-13, 1-14, 1-1l6, 1-71 Displacement, 2-~5, 2-6, 2-38, 2-39 Display, clear, 1-13 continuous, 1-3, 1l-l6, 1-27, 1-35, 1-71 LED, 1-57 single, 1-3 stop, 1-=71 Display data, 1-16 execution, 2-16, 2-26, 2-34 Counting events, 1-=72 CTRL/C, 1-7, 2=20 Current procedure, 2-4, 2-6, 2-11, 2-25 1-2, 1-65, 1-3, 1-15, 1-27 Display X-Y data pairs, DMA sampling, 1-63, 1-69 Double-word sampling, 1-22 DRS, 1-2, 1-6, 1-7, 1-8, 1-19, 1-30, 1-74, 1-75 Dual Count, cvVswGg, (CONT.) sample-and-hold, LPS1l, 1-63 Dummy variable, DXy, 1-3, 1-14, 1-10, 1-27, 2-8 1-71 1-43, 1-69 Element, array, 2-6, 2-10, 2-39 Entry pause, 2-10, 2-25, 2-34, 2-40 Entry point, 2-10, 2-25 ERASE, 2-3, 2-17, 2-19, Data, BCD, 1-22 display, 1-3, 1-16 removing, 1-8, 1-67 Data overrun, 1-7, 1-39, 1-67, 1-69 Data pairs, display X-Y, 1-27 flash X-Y, 1-35 X-y, 1-3, 1-4, 1-27, Data type, 2-4, 2-7 to 1-35 2-10 2-1, 2-=2 Debugging procedure, Defaulted, 1-9, 1-10 Defining a label, 2-20 Defining a macro, 2-22 Deleting a macro, 2-23 DEVICE CONFLICT, 1-80 Differential mode, 1-41, Digital output register, 1-50 Events, counting, 1-72 external, 1-40 Executable statement, 2-25, Executing a macro, 2-23 Execution count, 2-16, 2-26, 2-34 1-64, Digital input reading, 1-44 Digital input register, 1-2, 1-44 ARGUMENT, 1-80 CLOCK, 1=-80 SYNTAX, 1-80 Error flag, 1-24, 1-39, 1-67 Error message, 1-4, 1-5, 1-80, 2-20, 2-27, 2=35 2-30 1-69 1-19, 2-24 ERROR, Execution speed, 1-6, 1-19, 1-28, 1-33, 1-17, 1-36, 2-40 External event, 1-40 External event timing mode, 1-2, : 1-73 EXTERNAL Index-2 statement, 1-5 1-62, INDEX Factor, scale, X-axis Iapc, 1-13 spacing, START, 1-13 IDIR, 2-2 1-62, FDT l-4, 1-5, 1-7, 2-36 2-1 addressing, 2-37 to 1-6’ 1-53, 1-2, 1-3, 2-4 to 2-6, 2-39 IF, 2-3, FDT FDT macro, FDT mode 2-7, 2-8, 2-33 FDT pause, 2-1, 2-2, INIT, 2-4, 2-10, 2-23, 2-30, 2~-33, Inline START FAIL, 2~2 FDT 2-2 commands, 2-3 codes, Finite 2-22, continuous 1-19, 1-62 Flag, error, Flash, Flash 1-24, 2=26 2-35 data Flicker, 1-17, Floating-point 1-36 2-36 1-13 PAUSE, 1-4, 1-14, 1-14, 2-3, binary, 1-6, statement 2-11, 2-40 Interrupt l1-4, Interval 2-16, service 1-30 number, 2-25, routines, 1-5, 1-17, 1-71 sampling technique, 1-39 Intervals, time, 1-2, IQSET, 1-40, 1-72 1-6 1-5 ITIMER, 1-36 1-33, KB2BCD, 1-2, KBCD2B, 1-56 ?LABEL, Label, 2-20 2-20 defining a, numeric, 2-20 Latencies, 1-2, LDPOBJ, LED, LED 1-1 1-74, 1-75 Histograms, 1-40 1-57 1-79 1-78, 1-79, Limited mode, 1-75 Link, 1-79, 2-39 Link map, 2-1, 2-36 Literals, Hardware, 1-72 1-8, 1-39 B-1 1-57 Library, peripherals, 2-20 1-79, display, LIBR, Hardware clock, Hisr, 1-2, 1-7, 1-55 1-32 1-35 Gain, 1-42, 1-65 convert switched, 1-15 switched, 1-15, 1-41 Gain codes, 1-15, 1-42, 1-65 GOTO, 1l-15 routines, 2-10 clock, 1-72 FRUN, 2-36 FSH, 1-3, 1-13, 1-3, 1-44 2-39 Frequency, FXY, 1-19, 1-9 2-1, time, 1-2 conversion 2-1 2-34, INTSET, nonstandard integer, packed integer, 1-15 FORTRAN code, Internal 1-35 1-28, 1-33, conversion, commands, 1-7 unsigned Format, 2-15, 2-33 2-4, Integer, 1-67 1-30 Foreground/Background, RT-11, 1-4, 1-5, 1-7, Format transfer 2=-2, register, digital, 1-2, l6-bit, 1-30 FLT1l6, 1-2, 1-6, BCD, Information packed, pairs, sampling, 1-62 Input sampling, 1-39, 1-55 2-39 continuous 1-19, 1-32 X-Y 1-19’ 1-30, 1-57 1-4, 1-6' 1—30, 1-50, 2-21, Infinite types, 2-13, 1-57, logical, 2-30, 2-35 Implicit macro, 2-23 Indirect addressing, 2-39 command control FDT 1-41, 1-2, IDOR, 1-49, 1-69 FB, RT-11, 1-15, 1-44, Fast-sweep mode, FDT, 1-2, 1-69 FAIL, FDT (CONT.) 1_39' text, 2-13, 2-32 l.ocation, bit, 1-22, named, Index--3 2-4, 1-45 2-5 2-25, 2-39 INDEX Location (Cont.), offset, 2-4 relative, 2-4, 2-5 subscripted name, 2-4, 2-6 Location specification, 2-4, 2-24, 2-35, 2-37 Logical IF, 2-30, 2=35 Logical relation, 2-21 NAME, 2-3, 2-5, 2-24, 2-36, 1-3, 1-8, ?NO 1-59 OUT link, 2-1, 2-36 storage, 2-1, 2-4, 2-8, 2-17, 2-37 Mask, 1-44, 1-45, 1-48, 1-52 1-80, 2-13, 2-21, 1-7, 1-39, 1-67, 1-69 event fast-sweep, 2-24, /P 1-64, timing, 1-62, noninterrupt, 1-69 1-73 1-69 1-68, 1-74 parameter-adjustment, 1-23, option, Packed FDT, 2-33 limited, 1-75 1-19, data, 2-20, 2=-35 ASCII, 2-17 bipolar, 1-42, 1-65 clock, 1=72 differential, 1-41, external 2-6 Overrun, Message, 2-27, BOUNDS, Output register, digital, 1-2, 1=50 Overflow, clock, 1-40 Overhead, 1-5, 2-40 Map, Mode, 2-7, 2=-32 OF $SUBSCR, 1-5, 1-9 2-6 Object module, 1-78, B-1 Octal constants, 1-10 oDT, 2-39 Offset, 2-4, 2-37 Offset location, 2-4 Omitted, 1-11 2-38 l1l-4, 2=15 Notation conventions, Number of dimensions, Numeric label, 2-20 Manipulation, bit, 1-46 byte, 1-46 error, CONVERSION, ?NO ROOM, 2-27 Nondisplayable, 1-13, 1-17, 1-28, 1-33, 1-36 Noninterrupt mode, 1-68, 1-74 Nonstandard system, 1-=79 MACRO, 2-3, 2-22 Macro, 2-34 defining a, 2=22 deleting a, 2-23 executing a, 2-23 FDT, 2-13, 2~22, 2-26 implicit, 2-23 Main program name, 2-2 .MAIN., 2-17, main program, 2=-2 Named common, 2-5, 2-36, 2-~38 2-4, 2-5 Named location, 1-63 1-1, 2-9, 2-38 Name, Loops, 2-20 LPS1ll dual sample-and-hold, LwaIiTr, (CONT.) 1-10, 1-62 repeated-interval, 1-73 single-ended, 1-64 single-~interval, 1-73 step, 2-27 unipolar, 1-42, 1-65 Mode code, FpT, 2-7, 2-8, 2-17, 2-33 Mode conventions, 2-13 Mode conversion, 2«14, 2-21 Module, object, 1-78, B-1 2-36 integer format, 1-15 Parameter, 2-3, 2-8, 2-39 Parameter-adjustment mode, 1-10, 1-19, 1-23, 1-62 Partition, array, 1-7, 1-8, 1-20, 1-24, 1-63, 1-67 PAUSE, 2-2, 2-16, 2~23, 2-=25, 2-28, 2-33, 2-40 Pause, 1-59, 2-10 ' automatic FDT, 2-1, 2-10 entry, 2-10, 2-25, 2-34, 2-40 FDT, 2-2, 2-4, 2-10, 2-23, 2-30, 2-33, 2-35 FORTRAN, 2-10 statement, 2-10, 2-25 step, 2-10 watch, 2-10, 2-33 Peripherals hardware, 1l-1 Priority, 1-5, 2-39 Procedure, 2-4, 2-11 current, 2-4, 2-6, 2-11, Index-4 2-25 INDEX Program control Program name, main, 2=2 RSTS/E, 2-1 RT-11, 1-4, 2-2 RT-11 Programmable set commands, clock, rate, 1-72 Programmed Prompt, (CONT.) request, 2-2, 2-3, 1l-6 2-13, RT-11 SJ, 1-4, XM, 1-4 RTS, 1-3, 1-7, 1-43, 1-62 RUN, 1l-6 Punctuation, 1 1-4, RT-11 2-22, 2-29 .PROTECT, FB, 2-20 1-9 Sample-~and-hold, RAD50, Rate 2-8, of set, LPS11 dual, Sampling, 2-13 the programmable clock, continuous, 1-19, 1-62 digital read-in, 1-19 1=72 RCIS$, 2-39 Read-in sampling, digital, 1-19 Reading, digital input, 1-44 Real-time functions, A/D sampling, 1-2, D/A output, 1-3 DMA, 1-22 continuous, 1-19, 1-62 infinite continuous, 1-19, 1-62 repeated, 1-3 Reentrant, Refresh stop, 1-21, 1-39, 1-67 time interval, 1-39 Scale factor, 1-13 1-1, 2-20 1-5 1-33, 1-36 scopes, 1-3, 1-16, input, 1-2, 1-19, 1-44 digital output, 1-2, 1-50 refresh, 1-3, 1-16, storage, 1-3, 1-4, 1-32, 1-16, 1-27 Scope control, SpIs, 1-3, Removing data, Repeated sampling, 1-8, SETR, 2-38 2-5 1-67 1-17, programmable 1-2, 1-3, 1-33, 1-36, 1-72 conversion, Single display, 1-73 Single 1-6, 1-19, 1-39, 1-41 1-3 job, RT-11, 1l-6 1-4, 1-5, 1-7, 2-35 Single-ended mode, 1-64 Single-interval mode, 1-73 Single-sweep sampling, 1-19, 2-28 1l-1, the 1-72 1-5, 1-48, 1-68, Single analog-to-digital 2-36 Routine, completion, 1-5, 1-8, of 1-1, 1-25, Request, 2-2, rate clock, 1-62 Repeated-interval mode, 1-35 1-35 1-71 routine, interrupt, 1-4, 1-71 Set logical, 2-21 Relative address, 2-36, Relative location, 2-4, Relay control, 1-61 1-32, Service REL, l1l-61 Relation, RESET, 1-13 1-35 1-32, 1-35 Register, digital RESUME, 1-3, Scatter-plot, Scope, 1-3, programmed, 1-62 single~sweep, 1-19, 1-62 single-word, 1-21, 1-22 Scaling, 2-10, 1-69 finite 1-2 Refresh, 1-63, double-word, digital 1/0, 1-2 plotting, 1-3, 1-4 time interval control, REENTER, 1-63 1-~2, 1-19, 1-24, 1-28, 1-33, 1-39, 1-59, 1-68, 1-71, configuration, 1-73 format conversion, interrupt service, 1-17, 1-71 1-3, 1-4, 1-25, 1-53, 1-4, sampling, 1-21, 1-22 SJ, 1-76 2-15, 1-62 Single-word RT-11, 2-39 1-5, 1-4, 1~5, Software clock, 1-52, Spacing, Y-axis, 1-75 Index-5 1-13 1-7, 1-2, 2-35 1-6, 1-48, INDEX Time interval, 1-2, 1-40, Time interval sampling Spacing factor, X-axis, 1-13 Specification, 2-35, 2-24, 2-4, location, 2=-37 Speed, execution, 1-6, 1-17, 1-19, 1-28, 1-33, 1-36, 1-62, 2=40 1-9 Square brackets, Stamping, time, 1-2, 1=22 Standard system, 1-78 START, 2-2, START FAIL, FDT, 2-10, 2-23, 2-20, technique, Time stamping, 1-39 1-2, 1-72 1-22 Timing mode, external event, 1-73 Transfer commands, information, 2-2, 2-4, Transfer of control, conditional, 2-21 unconditional, 2-20 Two's complement binary, 2-33 1-30, 2-38 TYPE, 2-3, 2-13, 2=32, 2-39 2-35 2-33, 2-~29, (CONT.) 2-2 Statement, 2-25, executable, EXTERNAL, 1-5 Statement number, 2-1, internal, 2-30 2-16, 2-11, 2-25, 2-34, 2-40 Statement pause, 2-10, Unconditional transfer of control, 2-20 ?UNDEFINED, 2-4, 2-17, 2-35 Unipolar mode, 1-42, 1-65 Unsigned binary integer, 1l-6, 1-30 2-25 sTEP, 2-2, 2-10, 2-23, 2=27, 2-30, 2-33, 2-35, 2-40 Step mode, 2-27 Step pause, 2-10 sTop, 2-2, 2-31 Stop display, 1-71 Stop sampling, 1-21, 1-67 Storage map, 2-1, 2=37 2-17, 1-32, 1-4, String constant, 2-13 $SUBSCR OUT OF BOUNDS, 2-6 Subscript, 2-6, 2-19, 2-38 Subscripted name location, 2-4, 2-6 convert, 1-41 1-15, 1-15 Syntax conventions, sysrnis, 1-5, 1-59 2-2, 2-11, 2-33 Watch Pause, 2-10, 2-33 WHAT, 2-3, 2-27, 2-34 X-Y 2-3, 1-9, 2-4 SYNTAX ERROR, Wait, WATCH, 1-35 Switched gain, 2-17 2-8, 2-4, 1-3, Storage scope, 1-39, Variable, dumny, 1-10, 2-8 Virtual arrays, 1-4, 1-80 1-6, 1-33, 1-79 System configuration, 1-36, 1l-1, data pairs, 1-3, X-Y data pairs, display, 1-27 flash, 1-35 X-axis spacing factor, XM, RT-11, 1-78 1-4 nonstandard, 1-79 standard, 1-78 Y-axis Text literals, 2-13, Threaded code, 2-1 Throughput, 1-3 1-4, 1-27, 1-35 2-32 Index~-6 spacing, 1-13 1-13 INDEX * convention, #, 1-10, (CONT.) 1-10 2-13 -ABS., 2-38 IBCOMO Fi 2-36’ 2-5’ oMAIN., 2”38 2-38 /P option, 2-36 /Z, 2—13, 2-33’ 2-35 l6-bit floating-point conversion, 1-~30 ?LABEL, 2-20 ?NO CONVERSION, 2-15 ?NO ROOM, 2-27 ?UNDEFINED, 2-4, 2-17, 2-35 Index-7 FORTRAN/RT~-11 Extensions Manual AA=-2124D=-TC READER'S COMMENTS NOTE: This form is for document comments only. DIGITAL will use comments submitted on this form at the company's discretion. Problems with software should be reported If you on a Software Performance Report (SPR) form. receive to eligible are and reply written require a one under SPR service, submit your comments on an SPR form. Please cut along this | mne, Did you find errors in this manual? If so, specify by page. Did you find this manual understandable, usable, and well-organized? Please make suggestions for improvement. Is there sufficlent documentation on associated system programs required for use of the software described in this manual? If not, what material is missing and where should it be placed? Please indicate the type of user/reader that you most nearly represent. O O Assembly [:] Occasional programmer O User with little programming experience (] language programmer Higher=-level language programmer (experienced) student programmer O Non-programmer interested in computer concepts and‘capabilities Name Date Organization Street City State Zip Code or Country Fold Here Do Not Tear - Fold Here and Staple FIRST CLASS PERMIT NO. 152 MARLBORO, MASS BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES Postage will be paid by: Software Documentation 200 Forest Avenue MR1-2/E37 Marlboro, Massachusetts 01752 digital equipment corporation Printed in U.S.A.
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies