PC-OPDIO-16 User Manual Optically Isolated Digital I/O Board for the PC May 1995 Edition Part Number 320937A-01 © Copyright 1995 National Instruments Corporation. All Rights Reserved.
National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, TX 78730-5039 (512) 794-0100 Technical support fax: (800) 328-2203 (512) 794-5678 Branch Offices: Australia (03) 879 9422, Austria (0662) 435986, Belgium 02/757.00.
Limited Warranty The PC-OPDIO-16 is warranted against defects in materials and workmanship for a period of one year from the date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace equipment that proves to be defective during the warranty period. This warranty includes parts and labor.
WARNING REGARDING MEDICAL AND CLINICAL USE OF NATIONAL INSTRUMENTS PRODUCTS National Instruments products are not designed with components and testing intended to ensure a level of reliability suitable for use in treatment and diagnosis of humans. Applications of National Instruments products involving medical or clinical treatment can create a potential for accidental injury caused by product failure, or by errors on the part of the user or application designer.
Contents ____________________________________________________ About This Manual............................................................................................................. ix Organization of This Manual ......................................................................................... ix Conventions Used in This Manual................................................................................. x National Instruments Documentation .................................................
Contents Chapter 3 Signal Connections .............................................................................................................3-1 I/O Connectors ...............................................................................................................3-2 Signal Connection Descriptions.........................................................................3-3 Optically Isolated Digital Output ..................................................................................
Contents Creating a Windows Application Using Microsoft Visual Basic ......................4-14 Example Programs .................................................................................4-14 Special Considerations...........................................................................4-14 Chapter 5 Theory of Operation Functional Overview......................................................................................................5-1 Theory of Operation...................................
Contents Appendix E Customer Communication............................................................................................... E-1 Glossary ......................................................................................................................Glossary-1 Index ................................................................................................................................. Index-1 Figures Figure 1-1.
About This Manual ____________________________________________________ This manual describes the electrical and mechanical aspects of the PC-OPDIO-16 and contains information concerning its installation, operation, and programming. The PC-OPDIO-16 is fully compatible with industry standard Intel-Microsoft Plug and Play specification Version 1.0a. The PC-OPDIO-16 is an optically isolated digital I/O board for PC/XT/AT and IBM Personal System 2 (PS/2) models 25 and 30 computers.
About This Manual • Appendix D, Status Codes, lists the status codes returned by NI-DAQ, including the name and description. • Appendix E, Customer Communication, contains forms you can use to request help from National Instruments or to comment on our products. • The Glossary contains an alphabetical list and description of terms used in this manual, including abbreviations, acronyms, metric prefixes, mnemonics, and symbols.
About This Manual National Instruments Documentation The PC-OPDIO-16 User Manual is one piece of the documentation set for your data acquisition system. You could have any of several types of manuals depending on the hardware and software in your system. Use the manuals you have as follows: • Your DAQ hardware user manuals—These manuals have detailed information about the DAQ hardware that plugs into or is connected to your computer.
Chapter 1 Introduction This chapter describes the PC-OPDIO-16; lists what you need to get started; describes the optional software and optional equipment; and explains how to unpack your PC-OPDIO-16. About Your PC-OPDIO-16 Board Thank you for purchasing the PC-OPDIO-16, which is an optically isolated digital I/O board for PC/XT/AT and IBM Personal System 2 (PS/2) models 25 and 30 computers. Each board has eight optically isolated digital inputs and eight optically isolated digital outputs.
Introduction Chapter 1 Software Programming Choices There are several options to choose from when programming your National Instruments DAQ and SCXI hardware. You can use LabVIEW, LabWindows/CVI, or NI-DAQ. LabVIEW and LabWindows/CVI Application Software LabVIEW and LabWindows/CVI are innovative program development software packages for data acquisition and control applications. LabVIEW uses graphical programming, whereas LabWindows/CVI enhances traditional programming languages.
Chapter 1 Introduction minimal modifications to your code. Figure 1-1 illustrates the relationship between NI-DAQ and LabVIEW and LabWindows/CVI. You can see that the data acquisition parts of LabVIEW and LabWindows/CVI are functionally equivalent to the NI-DAQ software.
Introduction Chapter 1 Cabling National Instruments offers two cable termination accessory kits, the CB-50 and CB-50 LP, for use with the PC-OPDIO-16. These kits include a terminated, 50-conductor, flat ribbon cable and a connector block. You can attach signal input and output wires to screw terminals on the connector blocks and connect to your PC-OPDIO-16 board I/O connector.
Chapter 2 Installation and Configuration This chapter contains instructions for installing the PC-OPDIO-16, installing the NI-DAQ software, configuring your PC-OPDIO-16 board, and cabling. Hardware Installation You can install the PC-OPDIO-16 in any available 8-bit or 16-bit expansion slot in your computer. The following are general installation instructions, but consult your PC user manual or technical reference manual for specific instructions and warnings. 1. Turn off your computer. 2.
Installation and Configuration Chapter 2 Hardware Configuration The PC-OPDIO-16 is completely software configurable. Typically, two types of configuration are performed on a DAQ board—bus related and data acquisition related. To configure the PC-OPDIO-16 bus, you only have to set the base address. Bus-Related Configuration The PC-OPDIO-16 works in either a Plug and Play mode or a switchless mode. These modes dictate how the base I/O address is determined and assigned to the board.
Chapter 2 Installation and Configuration Data Acquisition-Related Configuration The PC-OPDIO-16 supplies eight channels of optically isolated digital input and eight channels of optically isolated digital output at the I/O connector. NI-DAQ Software Installation This following sections describe the installation of NI-DAQ on different platforms, including DOS, LabVIEW, LabWindows/CVI, and Windows. Refer to the appropriate section and follow the instructions to install the NI-DAQ software.
Installation and Configuration Chapter 2 LabVIEW users are encouraged to use the Easy I/O VIs in LabVIEW. These VIs allow full access to the PC-OPDIO-16 board functionality. For specific information on the VIs and on how to write LabVIEW data acquisition applications, refer to your LabVIEW for Windows Data Acquisition VI Reference Manual. The PC-OPDIO-16 boards may not be specifically mentioned in your version of the LabVIEW manuals. The following LabVIEW VIs are supported for the PC-OPDIO-16.
Chapter 2 Installation and Configuration NI-DAQ Installation for Windows To install NI-DAQ for Windows, run the SETUPWIN program on Disk 1. One way to do this is to select the File menu from the Program Manager Window, then select Run... and type in a:\setupwin, assuming a: is the floppy disk drive containing Disk 1. When prompted, select the Install/Upgrade NI-DAQ for Windows option. Setupwin will install examples programs and support files for a variety of languages and compilers.
Installation and Configuration Chapter 2 When the configuration utility finds a new switchless device in your computer, it assigns the first available device number to the new device. The utility also assigns default resources such as I/O address. When you remove the device from your computer, the utility deallocates these resources and the device number will contain an “empty device.
Chapter 2 Installation and Configuration With this option, you can create multiple configuration files for different NI-DAQ applications or projects; simply use the appropriate path name when you want to create a new configuration file or view an existing one. Be sure to enter only the path name; the file will automatically be created as ATBRDS.CFG in the specified directory. When you run an NI-DAQ DOS application, NI-DAQ will look for the configuration file in the current directory first.
Installation and Configuration Chapter 2 DAQCONF Command-Line Flags You can use the following command-line flags with DAQCONF: Command-Line Flag -t -i -e -a -u -x -le -lj Description Disable auto tests Assume ISA bus computer Assume EISA bus computer Auto test for bus type Usage Disable auto-detection of switchless devices Display in English (default) Display in Japanese (you must have a Japanese operating system) You should enter multiple flags separately.
Chapter 2 Installation and Configuration 3. Select the Device menu item to select your device type. Device type is the name of your device. After you select the device type, you can see the default settings for your device. 4. Modify the base address if the default setting is not acceptable. By default, WDAQCONF does not allow you to configure the same resource to different devices. To disable this feature, go to the WDAQCONF main window and uncheck Resource Checks under the Options menu item.
Chapter 3 Signal Connections This chapter describes the pin arrangement, signal names, and signal connections on the PC-OPDIO-16. Warning: Connections that exceed any of the maximum ratings of input or output signals on the PC-OPDIO-16 may damage your PC-OPDIO-16 board and your computer. This warning includes connecting any power signals to ground and vice versa. National Instruments is NOT liable for any damages resulting from any such signal connections.
Signal Connections Chapter 3 I/O Connectors Figure 3-1 shows the pin assignments for the PC-OPDIO-16 I/O connector.
Chapter 3 Signal Connections Signal Connection Descriptions Pin Signal Name Description 1, 4, 7, 10, 13, 16, 19, 22 VCCO<0..7> Isolated Vcc for Output, channels 0 through 7—This signal is the Vcc for the output channels. Range: +5 V to +24 V. 2, 5, 8, 11, 14, 17, 20, 23 VOUT<0..7> Isolated Output, channels 0 through 7—This signal is the optically isolated digital output line. VOUT7 is the MSB; VOUT0 is the LSB. 3, 6, 9, 12, 15, 18, 21, 24 COM<0..
Signal Connections Chapter 3 Optically Isolated Digital Output I/O connector pins 1 through 24 shown in Figure 3-1 represent the optically isolated output signal pins. Output Channels The optically isolated outputs of the PC-OPDIO-16 consist of a photo coupler and a load resistor. The PC-OPDIO-16 has eight isolated output channels. Each channel has its own isolated ground (COM), supply (VCCO), and output signal (VOUT). Figure 3-2 shows signal connection examples for isolated output.
Chapter 3 Signal Connections Signal Connection Example Figure 3-2 shows signal connections for the load connected to an isolated output. PC-OPDIO-16 +5 V 5.6 kΩ TLP121 VCCO + - IOH Supply 5–24 VDC VOUT Load Digital Logic 470 Ω COM Isolation Isolated Ground a. Load sinking current PC-OPDIO-16 5.6 kΩ +5 V VCCO IOL Load + - Supply 5–24 VDC VOUT Digital Logic 470 Ω COM Isolation Isolated Ground b. Load sourcing current Figure 3-2.
Signal Connections Chapter 3 Increasing Switching Frequency for TTL Loads You can increase the switching frequency for the TTL loads by putting a resistor in parallel to VCCO and VOUT. This parallel arrangement will reduce load resistance and increase switching frequency. You can choose a value of Ro, as shown in Figure 3-3, in such a way that the effective resistance from the parallel combination of 5.6 kΩ and Ro is about 1 kΩ.
Chapter 3 Signal Connections Sensing DC Voltages When a positive or negative DC voltage with a magnitude of at least 2 V is referenced to the IGND of a channel and is applied to an input of that channel, the PC-OPDIO-16 registers a logic high for that input. If no voltage is present, the PC-OPDIO-16 will register a logic low for that input. Thus, you can use the PC-OPDIO-16 to sense a wide range of DC signals—from digital logic levels to DC power supply levels up to 24 V.
Signal Connections Chapter 3 Reducing the Forward Current for 24 V Inputs You can reduce the forward current, If, for 24 V input signals by adding a series resistance with the 3.3 kΩ current-limiting resistor, as shown in Figure 3-5. The value of resistance should be such that at least 1 mA flows through the LED. You can choose a value close to 20 kΩ for Rs. PC-OPDIO-16 3.3 kΩ 0.5 W Rs VIN Supply If Load IGND Isolation Isolated Ground Figure 3-5.
Chapter 4 Fundamentals of Building Applications with NI-DAQ _____________________________________________________________________________ This chapter contains general information about building NI-DAQ applications that run in DOS and Windows and explains the nature of the files needed and the basics of making applications. You can skip this chapter if you are an experienced NI-DAQ user.
The Fundamentals of Building Applications with NI-DAQChapter 4 2. Compile your source code with the Microsoft C Compiler (Version 8.0 or later) and use the large memory model, which you select when you include the /AL flag in the command line. For example, to compile diginout.c and its support files, use the following commands: cl /c /AL diginout.c cl /c /AL getdev.c cl /c /AL errprint.c The /c flag directs the compiler to compile only. 3.
Chapter 4 The Fundamentals of Building Applications with NI-DAQ 2. NI-DAQ library needs to allocate some memory for internal use. Therefore, you need to set aside memory using the SETMEM statement. The amount of memory you need will depend on which NI-DAQ functions you are using. If you have not set aside sufficient memory, NI-DAQ functions will return a memory error (error code -98). For a description of the SETMEM statement, refer to your BASIC manual.
The Fundamentals of Building Applications with NI-DAQChapter 4 Running Your Application Inside the Visual Basic Environment First, you must create an NI-DAQ Quick library. MAKEQLB.BAT in the QLBUTIL subdirectory is useful for creating Quick libraries for Visual Basic. The steps for making a Quick library are as follows: 1. Edit NIDAQ.BAS. Remove the keyword REM from functions you want to include in the Quick library. 2. Run this batch file by using the following command: MAKEQLB VB 3.
Chapter 4 The Fundamentals of Building Applications with NI-DAQ your LIB environment variable so the linker can find the libraries. The following statement is an example of how to set the LIB environment variable in your autoexec.bat file: SET LIB=C:\NIDAQDOS\LIB;C:\VBDOS\LIB Example Programs You can find a set of example programs and the necessary header files in the NIDAQDOS\BASIC_EX directory.
The Fundamentals of Building Applications with NI-DAQChapter 4 If you are using Borland C++ version 4.0, you need to edit the definition of halloc in the include file MALLOC.H in the include directory. To do so, go to line 65 in MALLOC.H and remove the underscore from in front of farmalloc. The line should then read as follows: #define halloc(num, size) long)(num)* (size)) (void huge *)farmalloc((unsigned This change correctly maps the halloc function, which several NI-DAQ for DOS example programs use.
Chapter 4 The Fundamentals of Building Applications with NI-DAQ Memory Requirement If the Turbo Pascal interactive environment runs out of memory while compiling NI-DAQ applications, try some or all of the following: • Set the Turbo Pascal compile destination to disk. • Set the Turbo Pascal link buffer to disk. • Remove as many TSRs or device drivers as possible before compiling.
The Fundamentals of Building Applications with NI-DAQChapter 4 The NI-DAQ Libraries The NI-DAQ for Windows function libraries are DLLs, which means that NI-DAQ routines are not linked into the executable files of applications. Only the information about the NI-DAQ routines in NI-DAQ import libraries are stored in the executable files. For that reason, Windows-executable files are usually smaller than DOS-executable files. Import libraries contain information about their DLL exported functions.
Chapter 4 The Fundamentals of Building Applications with NI-DAQ Huge (Greater Than 64 KB) Buffer Access Buffers of allocated memory that exceed 64 KB are divided into 64 KB groups, or segments. When you are accessing data within the buffer and you reach the end of one of these segments and must reference the next segment, you need some way of finding the address of the next segment. This event is called crossing a segment boundary.
The Fundamentals of Building Applications with NI-DAQChapter 4 Example Programs You can find some example programs and project files created in version 3.1 NIDAQWIN\BCCP_EX in the directory. Newer versions can use 3.1 project files. Special Considerations See Special Considerations in the Creating a Windows Application Using Borland C++ and the Windows SDK section earlier in this chapter.
Chapter 4 The Fundamentals of Building Applications with NI-DAQ Creating a Windows Application Using Microsoft Visual C++ This section assumes that you will be using the Microsoft Visual Workbench to manage your code development. For Windows programs in general, remember to follow this procedure: 1. Open a project module to manage your application code. 2. Create files of type .cpp (C++ source code). 3. Create a module definition file, and add it to the project. 4.
The Fundamentals of Building Applications with NI-DAQChapter 4 3. Turn on the {$N+} compiler option to enable the extended floating-point types. You can use this option whether or not you actually have a math coprocessor; if you do not have a coprocessor, Turbo Pascal will emulate one for you. NI-DAQ functions expect to receive 8-byte floating-point values; with the $N option enabled, Turbo Pascal for Windows can generate an 8-byte variable of type double.
Chapter 4 The Fundamentals of Building Applications with NI-DAQ Huge Buffer Access Unlike C and C++, Turbo Pascal does not support huge pointers. Consequently, you must perform your own pointer arithmetic when accessing memory buffers greater than 64 KB in size. Essentially, whenever you increment a pointer to a buffer of memory, you should check the low word of the pointer to see if it rolls over from $FFFF back to $0000.
The Fundamentals of Building Applications with NI-DAQChapter 4 Creating a Windows Application Using Microsoft Visual Basic To use the NI-DAQ functions, you must use the NI-DAQ DLL. Follow this procedure: 1. Create your forms and code as you would for any other Visual Basic program, calling NI-DAQ functions as typical function calls. 2. Prototype any NI-DAQ routines used in your application. You can do this by adding the NI-DAQ header module WDAQ_VB.BAS in the NI-DAQ VB_EX directory.
Chapter 4 The Fundamentals of Building Applications with NI-DAQ Put fh%, , strBuffer$ : close fh% : Huge Buffer Access Visual Basic does not support buffer allocation greater than 64 KB or huge buffer access. To allocate and use buffers that are larger than 64 KB, consult the NI-DAQ memory management functions. String Passing In Visual Basic, variables of data type String need no special modifications to be passed to NI-DAQ for Windows functions.
Chapter 5 Theory of Operation This chapter describes the theory of operation for optically isolated digital I/O on the PC-OPDIO-16. This chapter also discusses using NI-DAQ functions with the PC-OPDIO-16 board. Functional Overview The block diagram in Figure 5-1 shows a functional overview of the PC-OPDIO-16. PC I/O Channel Interface TLP121 PC I/O Channel A<0..1> Control Plug and Play Interface Data 82C55A Digital I/O D<0..
Theory of Operation Chapter 5 You can execute data acquisition functions by using the digital I/O circuitry. The internal data and control buses interconnect the components. Optical isolation is attained by the optical isolation circuitry. Theory of Operation I/O Channel Interface Circuitry The PC I/O channel of the PC-OPDIO-16 consists of an address bus, a data bus, a Plug and Play interface, and several control and support signals.
Chapter 5 Theory of Operation designed around an 82C55A programmable peripheral interface (PPI). Two of the 82C55A ports are used in the PC-OPDIO-16; port A is used for output, and port B is used for input. Optical Isolation Circuitry The eight bits of digital input are optically isolated by using four LDA210 solid-state photo couplers. The optical isolation circuitry for input is shown in Figure 5-3 (only two input channels, 0 and 1, are shown). +5 V +5 V IGND0 3.3 kΩ VIN0 Port B Digital Logic IGND1 3.
Theory of Operation Chapter 5 Using NI-DAQ Functions for Isolated Digital I/O The C code block below illustrates the use of the NI-DAQ digital input and output calls supported by the PC-OPDIO-16 board. The series of calls outputs the binary pattern 11110000 from port 0 and input a pattern from port 1. Next, line 4 is toggled to zero on port 0 and line 4 is read by port 1. Be aware that calling Dig_Prt_Config for one port will effect the output of the other port.
Chapter 5 Theory of Operation Using LabVIEW Data Acquisition Library for Digital I/O LabVIEW users are encouraged to use the Easy I/O VIs in LabVIEW. They allow full access to the PC-OPDIO-16 board functionality. For specific information on the VIs and how to write LabVIEW data acquisition applications refer to your LabVIEW Data Acquisition VI Reference Manual for Windows. The PC-OPDIO-16 board may not be specifically mentioned in your version of the LabVIEW manuals.
Chapter 6 NI-DAQ Function Reference This chapter contains important information about how to apply the NI-DAQ function descriptions in this manual to your programming language and environment. This chapter also includes a detailed description of each NI-DAQ function that supports the PC-OPDIO-16. You can skip this chapter if you are an experienced NI-DAQ user.
NI-DAQ Function Reference Chapter 6 Primary Types Table 6-2 shows the primary type names and their ranges. Table 6-2. Primary Type Names Type Name Range Description C -32,768 to 32,767 Type BASIC Integer (for example: deviceNum%) Pascal Integer I16 16-bit signed integer U16 16-bit unsigned 0 to 65,535 integer unsigned short Not supported by BASIC. For functions that require unsigned integers, use the signed integer type instead. See the I16 description.
Chapter 6 NI-DAQ Function Reference Visual Basic for DOS All of the function names listed in this manual have underscores (_) in the names to delineate words. In Visual Basic the underscore is illegal in a symbol name, so you must replace each underscore in the NI-DAQ function names with a period when you use function names in your program.
NI-DAQ Function Reference Chapter 6 To do so, go to the Project window and choose the Global module, then choose Load Text from the Code menu. Select NIDAQCNS.INC , which is in the NIDAQWIN\VB_EX directory. Choose Replace or Merge, depending on how you want to incorporate this file into your global module. This procedure is identical to the procedure you would follow when loading the Visual Basic file CONSTANT.TXT. Search on the word CONSTANT for more information from the Visual Basic on-line help.
Chapter 6 NI-DAQ Function Reference Device Numbers The first parameter to almost every NI-DAQ function is the device number of the DAQ device you want NI-DAQ to use for the given operation. After you have followed the instructions in Chapter 2, Installation and Configuration, the configuration utility displays the device number for each device you have installed in the system. You can use the configuration utility to verify your device numbers.
NI-DAQ Function Reference Note to C Programmers: Chapter 6 state is a pass-by-reference parameter. Using This Function DIG_In_Line returns the digital logic state of the specified digital line in the specified port. If the specified port is configured as an input port, NI-DAQ determines the state of the specified line by the way in which some external device is driving it.
Chapter 6 NI-DAQ Function Reference DIG_Out_Line Format status = DIG_Out_Line (deviceNumber, port, line, state) Purpose Sets or clears the specified digital output line in the specified digital port. Parameters Direction Input Name deviceNumber port line state Type I16 I16 I16 I16 Description assigned by configuration utility digital I/O port number digital output line new digital logic state Parameter Discussion port is the digital I/O port number.
NI-DAQ Function Reference Chapter 6 DIG_Out_Port Format status = DIG_Out_Port (deviceNumber, port, pattern) Purpose Writes digital output data to the specified digital port. Parameters Direction Input Name deviceNumber port pattern Type I16 I16 I16 Description assigned by configuration utility digital I/O port number 8-bit digital pattern for the data written Parameter Discussion port is the digital I/O port number.
Chapter 6 NI-DAQ Function Reference Get_DAQ_Device_Info Format status = Get_DAQ_Device_Info (deviceNumber, infoType, infoValue) Purpose Allows you to retrieve parameters pertaining to the device operation.
NI-DAQ Function Reference Chapter 6 Get_NI_DAQ_Version Format status = Get_NI_DAQ_Version (version) Purpose Returns the version number of the NI-DAQ library. Parameter Direction Output Name version Type U32 Description version number assigned Using This Function Get_NI_DAQ_Version returns a 4-byte value in the version parameter. The upper two bytes are reserved and the lower two bytes contain the version number. Always bitwise AND the 4-byte value with FFFF in hex before using the version number.
Chapter 6 NI-DAQ Function Reference Init_DA_Brds Format status = Init_DA_Brds (deviceNumber, deviceNumberCode) Purpose Initializes the hardware and software states of a National Instruments DAQ board to its default state, and then returns a numeric board code that corresponds to the type of board initialized. Any operation that the board is performing is halted. This function is called automatically and does not have to be explicitly called by your application.
Appendix A Specifications This appendix lists the specifications of the PC-OPDIO-16. These specifications are typical at 25°C and 50% relative humidity unless otherwise stated. The operating temperature range is 0° to 50°C. I/O Connector Electrical Specifications Compatibility ............................................................... TTL-compatible Configuration ...............................................................
Specifications Appendix A Digital logic levels ....................................................... Level Min Max Ouput low voltage (I OL = 4.0 mA) — ±1 VDC Ouput high voltage (I OH = 250 µA) 22 VDC at VCCO = 24 V 3 VDC at VCCO = 5 V — Output low current — 7.0 mA Supply current for isolated outputs 5 V outputs ............................................................1 mA/channel min 24 V outputs ..........................................................
Appendix B CP Clare LDA210 Data Sheet* This appendix contains a manufacturer data sheet for the LDA210 solid state current sensor (CP Clare Corporation). This sensor is used on the PC-OPDIO-16 isolated input port. Not available in PDF version of this document. * Copyright © CP Clare Corporation. 1994. Reprinted with permission of copyright owner. All rights reserved. CP Clare Corporation. SSP15 Catalog. CP Clare reserves the right to make changes to the specifications without notice.
Appendix C Register-Level Programming This appendix describes in detail the address and function of each PC-OPDIO-16 register. Note: If you plan to use a programming software package such as NI-DAQ or LabWindows/CVI with your PC-OPDIO-16, you do not need to read this chapter. Base I/O Address Selection The PC-OPDIO-16 is fully compatible with the industry standard Intel-Microsoft Plug and Play Specification version 1.0a.
Register-Level Programming Appendix C Register Description Register Description Format The remainder of this chapter discusses each of the PC-OPDIO-16 registers in the order shown in Table C-1. Each register group is introduced, followed by a detailed bit description of each register on the PC-OPDIO-16. The individual register description gives the address, type, word size, and bit map of the register, followed by a description of each bit.
Appendix C Register-Level Programmingt Port B Register Reading the Port B Register returns the logic state of the eight optically isolated digital input lines VIN0 through VIN7. Address: Base address + 01 (hex) Type: Read-only Word Size: 8-bit Bit Map: 7 D7 6 D6 5 D5 4 D4 3 D3 2 D2 Bit Name Description 7–0 D<7..0> Data—These are 8-bit port B data. 1 D1 0 D0 Digital Control Register The Digital Control Register configures port A for output and port B for input.
Register-Level Programming Appendix C Programming The pseudocode for controlling the output port of the PC-OPDIO-16 is: 1. Write to 82 hex to the Digital Control Register to configure port A as the output port and port B as the input port. 2. Write digital value to the Port A Register to control the optically isolated digital lines VOUT0 through VOUT7. Note: Writing a digital 1 to the port line will give a high on the corresponding VOUT line.
Appendix C Register-Level Programmingt Example: Reading binary XXXXXXX1 at port B will imply a high on the VIN0, if proper signal connections are done. Table C-2. Input Sense Data Value Read Channel Sensed XXXXXXX1 XXXXXX1X XXXXX1XX XXXX1XXX XXX1XXXX XX1XXXXX X1XXXXXX 1XXXXXXX High on VIN0 High on VIN1 High on VIN2 High on VIN3 High on VIN4 High on VIN5 High on VIN6 High on VIN7 For input and output specifications, refer to Appendix A, Specifications.
Appendix D Status Codes This appendix lists the status codes returned by NI-DAQ, including the name and description. Each NI-DAQ function returns a status code that indicates whether the function was performed successfully. When an NI-DAQ function returns a code that is a negative number, it means that the function did not execute. When a positive status code is returned, it means that the function did execute, but with a potentially serious side effect. A summary of the status codes is listed in Table D-1.
Status Codes Appendix D Table D-1. Status Code Summary (Continued) Status Code Status Name Description 8 7 readOutputLine relatedPortBusy 6 noPreTrigUnwrap 5 4 3 2 calibrationErr readOutputPort dupDMALevels dupIntLevels A digital line configured for output has been read. Another port on the same chip is busy. Config and setup call may corrupt its signal lines. Allocation of array to hold the final indices to use in unwrapping pretrigger frames failed in MDAQ_Start.
Appendix D Status Codes Table D-1.
Status Codes Appendix D Table D-1.
Appendix D Status Codes Table D-1.
Status Codes Appendix D Table D-1.
Appendix D Status Codes Table D-1.
Status Codes Appendix D Table D-1.
Appendix D Status Codes Table D-1.
Appendix E Customer Communication For your convenience, this appendix contains forms to help you gather the information necessary to help us solve technical problems you might have as well as a form you can use to comment on the product documentation. Filling out a copy of the Technical Support Form before contacting National Instruments helps us help you better and faster. National Instruments provides comprehensive technical assistance around the world. In the U.S.
Technical Support Form Photocopy this form and update it each time you make changes to your software or hardware, and use the completed copy of this form as a reference for your current configuration. Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions more efficiently.
PC-OPDIO-16 Hardware and Software Configuration Form Record the settings and revisions of your hardware and software on the line to the right of each item. Complete a new copy of this form each time you revise your software or hardware configuration, and use this form as a reference for your current configuration. Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions more efficiently.
Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. Title: PC-OPDIO-16 User Manual Edition Date: May 1995 Part Number: 320937A-01 Please comment on the completeness, clarity, and organization of the manual. If you find errors in the manual, please record the page numbers and describe the errors. Thank you for your help.
Glossary ____________________________________________________ ° Ω / % ± +5 V A AC A/D ADC AGND AO API AWG BIOS C COM D/A DAC DACOUT DAQ DC DGND DIO DLL DMA DNL EISA GND hex Hz ICU Prefix Meaning Value pnµmkMG- piconanomicromillikilomegagiga- 10-12 10-9 10-6 10-3 103 106 1012 degrees ohms per percent plus or minus +5 volt signal amperes alternating current analog-to-digital A/D converter analog ground signal analog output application programming interface American Wire Gauge basic input/output system
Glossary ID IGND INL I/O IOH IOL IOUT ISA LED LSB MB MC MSB NC OUT PA PB PPI PPM REXT rms S s SCXI SDK SHIELD TTL V VAC VCC0 VDC VDMAD VEXT VIH VIL VIN Vin VOH VOL VOUT identification isolated input ground signal integral nonlinearity input/output current, output high current, output low current output signal Industry Standard Architecture light-emitting diode least significant bit megabytes of memory Micro Channel most significant bit not connected (signal) output signal port A port B programmable periph
Index Numbers/Symbols building NI-DAQ applications. See NI-DAQ applications, building. bus-related configuration, 2-2 +5 V signal, 3-3 24 V inputs, reducing forward current for, 3-8 C A C++. See Borland Turbo C++ or Borland C++; Microsoft Visual C++. cables cables and connectors for PC-OPDIO-16, 1-4 optional equipment, 1-3 COM<0..
Index D E D<7..0> bit Port A Register, C-2 Port B Register, C-3 DAQCONF command-line flags (table), 2-8 device configuration, 2-7 NI-DAQ configuration file, 2-6 to 2-7 when to use, 2-6 data acquisition-related configuration, 2-3 data types for NI-DAQ functions, 6-1 primary types (table), 6-2 DC voltages, sensing, 3-7 device numbers, passing to NI-DAQ functions, 6-5 DGND signal, 3-3 DIG_In_Line function, 6-5 to 6-6 DIG_In_Port function, 6-6 Digital Control Register, C-3 digital input, optically isolated.
Index Microsoft Visual Basic, 4-14 to 4-15 Microsoft Visual C++, 4-11 NI-DAQ libraries, 4-8 NI-DAQ programming considerations, 4-8 to 4-9 NI-DAQ installation, 2-5 electrical specifications, A-1 pin assignments (figure), 3-2 L LabVIEW software NI-DAQ installation, 2-3 to 2-4 programming capabilities, 1-2 using data acquisition library for digital I/O, 5-5 LabWindows/CVI software NI-DAQ installation, 2-4 programming capabilities, 1-2 using NI-DAQ functions, 6-4 N NI-DAQ applications, building DOS applicat
Index PC I/O channel interface circuitry, 5-2 PC-OPDIO-16 block diagram, 5-1 features, 1-1 getting started, 1-1 optional equipment, 1-3 software programming choices LabVIEW and LabWindows/CVI application software, 1-2 NI-DAQ driver software, 1-2 to 1-3 register-level programming, 1-3 unpacking, 1-4 to 1-5 physical specifications, A-2 plug and play mode, configuring, 2-2, 2-6 Port A Register, C-2 Port B Register, C-3 power-on condition optically isolated digital input, 3-8 optically isolated digital output,
Index register-level programming. See registerlevel programming.
Index U unpacking the PC-OPDIO-16, 1-4 to 1-5 V variable data types for NI-DAQ functions, 6-1 primary types (table), 6-2 VCCO<0..7> signal description (table), 3-3 exceeding voltage limits (warning), 3-4 isolation from output channels, 3-4 VIN<0..7> signal description (table), 3-3 isolation from input channels, 3-7 VIs supported by PC-OPDIO-16, 5-5 Visual Basic. See Microsoft Visual Basic, for NI-DAQ applications. VOUT<0..