CONTENTS Title Page Copyright Page Preface 1 Overview of Laboratory Input/Output (LIO) Under VMS 1.1 What Is LIO? 1.2 Types of Devices Supported 1.3 Example of an LIO Program 1.4 Summary of LIO Routines 2 Laboratory I/O Interfaces and Operations 2.1 Synchronous I/O 2.2 Asynchronous I/O 2.3 I/O Operations Supported by DEC RT Integrator 2.3.1 QIOs to a VMS Device Driver 2.3.2 Polled I/O 2.3.3 Connect-to-Interrupt I/O 2.4 Asynchronous I/O Buffer-Handling Mechanisms 2.4.1 Buffer Dequeueing 2.4.2 Buffer Forwarding 2.4.3 Asynchronous System Traps (ASTs) 2.5 I/O Device-Specific Interfacing 2.5.1 First-In/First-Out Buffers 2.5.2 Handshaking 2.5.2.1 The DRQ3B and Handshaking 2.5.2.2 The DRV11-J and Handshaking 2.5.2.3 The DRV11-WA and Handshaking 2.5.3 Direct Memory Access I/O 2.5.3.1 Single-Buffer DMA 2.5.3.2 Continuous DMA 2.5.3.3 Alternate-Buffer DMA 2.5.3.4 Double-Buffer DMA 3 Laboratory I/O Device Support 3.1 Realtime Clock Devices 3.1.1 Attaching the KWV11-C or Simpact RTC01 3.1.2 Setting Up the KWV11-C or Simpact RTC01 3.1.3 Using the KWV11-C or Simpact RTC01 to Time External Events 3.1.4 Using the KWV11-C to Trigger a Device 3.1.5 Using the Simpact RTC01 to Count External Events 3.1.6 Using the KWV11-C to Avoid Trigger Slivering 3.2 Analog I/O Devices 3.2.1 AAF01 and ASF01 Support 3.2.1.1 Attaching the AAF01 3.2.1.2 Setting Up the AAF01 3.2.1.3 Using the AAF01 for Synchronous Output 3.2.1.4 Using the AAF01 for Asynchronous Output 3.2.2 AAV11-D Support 3.2.2.1 Attaching the AAV11-D 3.2.2.2 Setting Up the AAV11-D 3.2.2.3 Using the AAV11-D for Synchronous Output 3.2.2.4 Using the AAV11-D for Asynchronous Output 3.2.3 ADF01, AMF01, and ASF01 Support 3.2.3.1 Attaching the ADF01 3.2.3.2 Setting Up the ADF01 3.2.3.3 Using the ADF01 for Synchronous Input 3.2.3.4 Using the ADF01 for Asynchronous Input 3.2.4 ADQ32 Support 3.2.4.1 Attaching the ADQ32 3.2.4.2 Setting Up the ADQ32 3.2.4.3 Using the ADQ32 for Synchronous Input 3.2.4.4 Using the ADQ32 for Asynchronous Input 3.2.5 ADV11-D Support 3.2.5.1 Attaching the ADV11-D 3.2.5.2 Setting Up the ADV11-D 3.2.5.3 Using the ADV11-D for Synchronous Input 3.2.5.4 Using the ADV11-D for Asynchronous Input 3.2.6 AXV11-C Support 3.2.6.1 Attaching the AXV11-C 3.2.6.2 Setting Up the AXV11-C 3.2.6.3 Using the AXV11-C for Synchronous Input 3.2.6.4 Using the AXV11-C for Asynchronous Input 3.2.7 DRQ11-C Support 3.2.7.1 Attaching the DRQ11-C 3.2.7.2 Setting Up the DRQ11-C 3.2.7.3 Using the DRQ11-C for Synchronous I/O 3.2.7.4 Using the DRQ11-C for Asynchronous I/O 3.2.8 Preston Support 3.2.8.1 Attaching the Preston 3.2.8.2 Setting Up the Preston 3.2.8.3 Using the Preston for Synchronous Input 3.2.8.4 Using the Preston for Asynchronous Input 3.3 Digital I/O Devices 3.3.1 DRB32 Support 3.3.1.1 Attaching the DRB32 3.3.1.2 Setting Up the DRB32 3.3.1.3 Using the DRB32 for Synchronous I/O 3.3.1.4 Using the DRB32 for Asynchronous I/O 3.3.2 DRB32W Support 3.3.2.1 Attaching the DRB32W 3.3.2.2 Setting Up the DRB32W 3.3.2.3 Using the DRB32W for Synchronous I/O 3.3.2.4 Using the DRB32W for Asynchronous I/O 3.3.3 DRQ3B Support 3.3.3.1 Attaching the DRQ3B 3.3.3.2 Setting Up the DRQ3B 3.3.3.3 Using the DRQ3B for Synchronous I/O 3.3.3.4 Using the DRQ3B for Asynchronous I/O 3.3.4 DRV11-J Support 3.3.4.1 Attaching the DRV11-J 3.3.4.2 Setting Up the DRV11-J 3.3.5 DRV11-WA Support 3.3.5.1 Attaching the DRV11-WA 3.3.5.2 Setting Up the DRV11-WA 3.3.5.3 Using the DRV11-WA for Synchronous I/O 3.3.5.4 Using the DRV11-WA for Asynchronous I/O 3.4 Isolated Realtime I/O Devices 3.4.1 IAV11-A, IAV11-AA, IAV11-C, and IAV11-CA Support 3.4.1.1 Attaching the IAV11-A 3.4.1.2 Setting Up the IAV11-A 3.4.1.3 Using the IAV11-A for Synchronous Input 3.4.1.4 Using the IAV11-A for Asynchronous Input 3.4.2 IAV11-B Support 3.4.2.1 Attaching the IAV11-B 3.4.2.2 Setting Up the IAV11-B 3.4.2.3 Using the IAV11-B for Synchronous Output 3.4.2.4 Using the IAV11-B for Asynchronous Output 3.4.3 IDV11-A Support 3.4.3.1 Attaching the IDV11-A 3.4.3.2 Setting Up the IDV11-A 3.4.3.3 Using the IDV11-A for Synchronous Input 3.4.3.4 Using the IDV11-A for Asynchronous Input 3.4.4 IDV11-B and IDV11-C Support 3.4.4.1 Attaching the IDV11-B 3.4.4.2 Setting Up the IDV11-B 3.4.4.3 Using the IDV11-B for Synchronous Output 3.4.4.4 Using the IDV11-B for Asynchronous Output 3.4.5 The IDV11-D Realtime Counter Device 3.4.5.1 Attaching the IDV11-D 3.4.5.2 Setting Up the IDV11-D 3.4.5.3 Using the IDV11-D to Count External Events 3.4.5.4 Using the IDV11-D to Measure Pulse Duration 3.4.5.5 Using the IDV11-D to Generate Pulse Trains 3.4.5.6 Using the IDV11-D to Generate Output Frequencies 3.5 IEEE-488 Bus Devices 3.5.1 IEQ11 and IEZ11 3.5.2 An IEEE-488 Device as the System Controller 3.5.3 An IEEE-488 Device as a Controller 3.5.4 An IEEE-488 Device as an Instrument 3.5.5 Attaching an IEEE-488 Device 3.5.6 Setting Up an IEEE-488 Device 3.5.7 Assigning IEEE-488 Bus Addresses 3.5.8 Enabling IEEE-488 Events 3.5.9 Detecting IEEE-488 Bus Events 3.5.10 Supplying AST Routines 3.5.10.1 Example 3.5.11 Requesting Service with an SRQ 3.5.12 Passing and Receiving Control 3.5.13 Responding to a Service Request 3.5.14 Sending Data and Receiving Data When the IEEE-488 Device Is Controller-In-Charge 3.5.15 Sending Data to Multiple IEEE-488 Devices 3.5.16 Sending Data and Receiving Data When the IEEE-488 Device Is Attached as an Instrument 3.5.16.1 Using Termination Characters to Terminate Read Requests 3.5.16.2 Using EOI to Terminate Write Requests 3.6 Serial Line Devices 3.6.1 Attaching Serial Line Devices 3.6.2 Setting Up Serial Line Devices 3.6.3 Using Serial Line Devices for Synchronous I/O 3.6.4 Using Serial Line Devices for Asynchronous I/O 3.7 Software Pseudodevices 3.7.1 Disk File Support 3.7.1.1 Attaching a Disk File 3.7.1.2 Setting Up the Disk File Device 3.7.1.3 Using Disk Files for Synchronous I/O 3.7.1.4 Using Disk Files for Asynchronous I/O 3.7.2 Memory Queue Support 3.7.2.1 Attaching the Memory Queue Device 3.7.2.2 Setting Up the Memory Queue Device 3.7.2.3 Using a Memory Queue Device to Manage Local Memory 3.7.2.4 Setting Up a Memory Queue Device for Interprocess Communication 3.7.3 Realtime Plotting 3.7.3.1 Attaching the Realtime Plotting Device 3.7.3.2 Setting Up the Realtime Plotting Device 3.7.3.3 Using the Realtime Plotting Device 4 Laboratory I/O Routine Reference Descriptions ATTACH DEQUEUE DETACH ENQUEUE READ SET I SET R SET S SHOW WRITE 5 SET and SHOW Parameter Reference Descriptions LIO$K_ACK_NAK_TERMINATOR LIO$K_AD_CHAN LIO$K_AD_DIFFERENTIAL LIO$K_AD_GAIN LIO$K_ADD_AD_CHAN LIO$K_ANA_OUT LIO$K_AST_RTN LIO$K_ASYNCH LIO$K_AUX_COMMAND LIO$K_BAUD_RATE LIO$K_BIN_DDR LIO$K_BITS_PER_CHAR LIO$K_BOUNCE LIO$K_BREAK LIO$K_BUFF_SIZE LIO$K_BUFF_SOURCE LIO$K_BURST_DIV LIO$K_BURST_RATE LIO$K_CANCEL LIO$K_CC_FOUT LIO$K_CC_SETUP LIO$K_CHANNEL LIO$K_CLK_BASE LIO$K_CLK_DIV LIO$K_CLK_RATE LIO$K_CLK_SRC LIO$K_CLR_LBO LIO$K_COB LIO$K_COMMAND LIO$K_CONT LIO$K_COUNTER LIO$K_CTA LIO$K_CTI_BUF LIO$K_CTI_OVERHD LIO$K_CTRL_ACTIVE LIO$K_CTRL_AST LIO$K_CTRL_HANDLING LIO$K_CTRL_STANDBY LIO$K_CURRENT_CHANNEL LIO$K_CWT LIO$K_DA_CHAN LIO$K_DATA LIO$K_DATA_PATH LIO$K_DATA_WIDTH LIO$K_DBL_BUF LIO$K_DEVICE_ACK_NAK_BUFF LIO$K_DEVICE_EF LIO$K_DIAG_CHAN LIO$K_DIRECTION LIO$K_DISPLAY_ONLY LIO$K_DRX_AST_RTN LIO$K_DRX_STAT LIO$K_DUPLEX LIO$K_ECHO LIO$K_ED_CTT LIO$K_ED_ECE LIO$K_ED_SBE LIO$K_EOI LIO$K_ERR_HANDLE LIO$K_ERROR_ENABLE LIO$K_EVENT_AST LIO$K_EVENT_EF LIO$K_EVENT_ENA LIO$K_EVENT_WAIT LIO$K_FILE_EXTENT LIO$K_FILE_POS LIO$K_FILE_REMAIN LIO$K_FILE_SIZE LIO$K_FLOW_CONTROL LIO$K_FLOW_MASTER LIO$K_FORWARD LIO$K_FUNCTION LIO$K_FUNCTION_BITS LIO$K_GATE LIO$K_HANDSHAKE LIO$K_HANGUP LIO$K_IEEE_ADDR LIO$K_INIT_AD_CHAN LIO$K_INPUT_TERMINATOR LIO$K_INTERRUPT_LEVEL LIO$K_LEAVE_IN_STATE LIO$K_LOCK_BUFFER LIO$K_LOOP_BACK LIO$K_MAX_CHANNELS LIO$K_MODEM LIO$K_MODEM_STATUS LIO$K_MULTIPLE_X_AXES LIO$K_N_AD_CHAN LIO$K_N_BUFFS LIO$K_N_DA_CHAN LIO$K_NAME LIO$K_OPEN_FILE LIO$K_OUTPUT_PREFIX LIO$K_OUTPUT_TERMINATOR LIO$K_PAGE_ALIGN LIO$K_PAR_POLL LIO$K_PAR_POLL_CONFIG LIO$K_PAR_POLL_STATUS LIO$K_PARITY LIO$K_PASS_CTRL LIO$K_PCR LIO$K_PLOT_SIZE LIO$K_PLOT_TYPE LIO$K_PO_CHAN LIO$K_POLARITY LIO$K_POSITION LIO$K_PROTOCOL LIO$K_PURGE LIO$K_READ_ONLY LIO$K_READ_PROMPT LIO$K_READ_STAT LIO$K_RESET_AXF LIO$K_RESET_DRX LIO$K_SCHMITT_TRIGGER LIO$K_SER_POLL LIO$K_SER_POLL_CONFIG LIO$K_SGL_BUF LIO$K_SKIP_COUNT LIO$K_SRQ LIO$K_ST0_1 LIO$K_START LIO$K_STAT_BITS LIO$K_STE LIO$K_STOP LIO$K_SWEEP_RATE LIO$K_SYNCH LIO$K_TERM_CHAR LIO$K_TERM_SRQ LIO$K_TIMEOUT LIO$K_TIMEOUT_ENABLE LIO$K_TITLE LIO$K_TITLE_n LIO$K_TRANSFER LIO$K_TRIG LIO$K_TYPE_AHEAD LIO$K_UNLOCK_BUFFER LIO$K_UNSOLICITED LIO$K_UPDATE LIO$K_USER_ACK_AST LIO$K_USER_ACK_STRING LIO$K_USER_NAK_AST LIO$K_USER_NAK_STRING LIO$K_USER_READ_PROTOCOL_AST LIO$K_USER_WRITE_NAK_HANDLING LIO$K_VLT_DDR LIO$K_VOLTAGE LIO$K_X_LABEL LIO$K_X_RANGE LIO$K_XON LIO$K_Y_LABEL LIO$K_Y_MAX LIO$K_Y_MIN 6 Laboratory I/O Error Handling 6.1 Overview 6.2 Checking Routine Call Status 6.3 Setting Up Devices for Error Handling 6.4 Symbolic Status Values and Descriptions 7 Online Sample Programs 7.1 Overview 7.2 Programs for European Devices 7.3 Listing of Online Sample Programs A ADQ32 Triggering and Clock Modes A.1 Clock Mode Summary A.2 Definition of Terms Used to Describe Clock Modes A.3 Channel Specification A.4 Gain Specification A.5 Buffer Specification A.5.1 Single Buffer Transfers A.5.2 Double Buffer Transfers A.6 Start of Data Acquisition A.7 Clock Overrun Errors A.8 Important Points About the Clock Logic A.9 Clock Mode 1, Burst A.10 Clock Mode 2, Burst, with Edge Gate A.11 Clock Mode 3, Burst, with Delayed Edge Gate A.12 Clock Mode 4, Burst, Activated by External Trigger A.13 Clock Mode 5, Timed Triggers A.14 Clock Mode 6, Timed Triggers, with Edge Gate A.15 Clock Mode 7, Timed Triggers, with Delayed Edge Gate A.16 Clock Mode 8, Timed Triggers, with Level Gate A.17 Clock Mode 9, Timed Triggers, Activated by External Trigger A.18 Clock Mode 10, Burst Sweeps A.19 Clock Mode 11, Burst Sweeps, with Edge Gate A.20 Clock Mode 12, Burst Sweeps, with Level Gate A.21 Clock Mode 13, Burst Sweeps, Activated by External Trigger A.22 Clock Mode 14, Burst Sweeps, Sweep Controlled by External Trigger A.23 Clock Mode 15, Timed Sweeps A.24 Clock Mode 16, Timed Sweeps, with Edge Gate A.25 Clock Mode 17, Timed Sweeps, with Level Gate A.26 Clock Mode 18, Timed Sweeps, Activated by External Trigger A.27 Clock Mode 19, Timed Sweeps, Sweep Controlled by External Trigger A.28 Clock Mode 20, External Triggers A.29 Clock Mode 21, External Triggers, with Edge Gate A.30 Clock Mode 22, External Triggers, with Delayed Edge Gate B Using CTI I/O with the AXV11-C B.1 Connecting the CTI Driver to the AXV11-C B.2 Reloading the QIO Driver B.3 Reconnecting the QIO Driver EXAMPLES 1-1 Sample LIO Program FIGURES 2-1 Synchronous I/O Device Model 2-2 Asynchronous I/O Device Model 2-3 Double-Buffer DMA Pointer Sequence 5-1 State of the Function Bits on the DRQ3B A-1 Clock Mode 1, Burst A-2 Clock Mode 2, Burst, with Edge Gate A-3 Clock Mode 3, Burst, with Delayed Edge Gate A-4 Clock Mode 4, Burst, Activated by External Trigger A-5 Clock Mode 5, Timed Triggers A-6 Clock Mode 6, Timed Triggers, with Edge Gate A-7 Clock Mode 7, Timed Triggers, with Delayed Edge Gate A-8 Clock Mode 8, Timed Triggers, with Level Gate A-9 Clock Mode 9, Timed Triggers, Activated by External Trigger A-10 Clock Mode 10, Burst Sweeps A-11 Clock Mode 11, Burst Sweeps, with Edge Gate A-12 Clock Mode 12, Burst Sweeps, with Level Gate A-13 Clock Mode 13, Burst Sweeps, Activated by External Trigger A-14 Clock Mode 14, Burst Sweeps, Sweep Controlled by External Trigger A-15 Clock Mode 15, Timed Sweeps A-16 Clock Mode 16, Timed Sweeps, with Edge Gate A-17 Clock Mode 17, Timed Sweeps, with Level Gate A-18 Clock Mode 18, Timed Sweeps, Activated by External Trigger A-19 Clock Mode 19, Timed Sweeps, Sweep Controlled by External Trigger A-20 Clock Mode 20, External Triggers A-21 Clock Mode 21, External Triggers, with Edge Gate A-22 Clock Mode 22, External Triggers, with Delayed Edge Gate TABLES 2-1 I/O Interfaces and Operations Summary 3-1 KWV11-C and Simpact RTC01 SET and SHOW Parameters 3-2 AAF01 SET and SHOW Parameters 3-3 AAV11-D SET and SHOW Parameters 3-4 ADF01 SET and SHOW Parameters 3-5 ADQ32 SET and SHOW Parameters 3-6 ADV11-D SET and SHOW Parameters 3-7 AXV11-C SET and SHOW Parameters 3-8 DRQ11-C SET and SHOW Parameters 3-9 Preston SET and SHOW Parameters 3-10 DRB32 SET and SHOW Parameters 3-11 DRB32W SET and SHOW Parameters 3-12 DRQ3B SET and SHOW Parameters 3-13 DRV11-J SET and SHOW Parameters 3-14 DRV11-WA SET and SHOW Parameters 3-15 IAV11-A SET and SHOW Parameters 3-16 IAV11-B SET and SHOW Parameters 3-17 IDV11-A SET and SHOW Parameters 3-18 IDV11-B SET and SHOW Parameters 3-19 IDV11-D SET and SHOW Parameters 3-20 IEEE-488 Device SET and SHOW Parameters 3-21 IEEE-488 Bus Events 3-22 Serial Line SET and SHOW Parameters 3-23 Disk File SET and SHOW Parameters 3-24 Memory Queue SET and SHOW Parameters 3-25 Realtime Plotting SET and SHOW Parameters 4-1 Laboratory I/O Routine Summary 4-2 Device Specifications and I/O Types 4-3 DEQUEUE Device-Specific Argument Values 4-4 ENQUEUE Device-Specific Argument Values 4-5 READ Device-Specific Argument Values 4-6 WRITE Device-Specific Argument Values 5-1 SET and SHOW Parameter Summary 5-2 IEQ11 and IEZ11 IEEE-488 Auxiliary Commands 5-3 Address Command Group 5-4 Universal Command Group 5-5 Listener Address Group 5-6 Talker Address Group 5-7 Secondary Command Group 5-8 Pin Numbers on the DRQ3B 5-9 AAV11-D Trigger Modes 5-10 ADQ32 Point Trigger Sources 5-11 ADQ32 Sweep Trigger Sources 5-12 ADQ32 Buffer Trigger Sources 5-13 ADV11-D Trigger Modes 5-14 AXV11-C Trigger Modes 5-15 KWV11-C/Simpact RTC01 Trigger Modes 5-16 Preston Trigger Modes 6-1 Error Handling Symbolic Status Definition Files 7-1 LIO Online Sample Programs A-1 Burst Rates