Professional Documents
Culture Documents
Information in this document is subject to change without notice. The software described is this document is furnished under a license agreement. The software may be used or copied only in accordance with the terms of the agreement. SCIENTIFIC SOFTWARE TOOLS, INC. SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RELATED TO THE USE OF THIS PRODUCT. THIS PRODUCT IS NOT DESIGNED WITH COMPONENTS OF A LEVEL OF RELIABILITY SUITABLE FOR USE IN LIFE SUPPORT OR CRITICAL APPLICATIONS. This document may not, in whole or in part, be copied, photocopied, reproduced, translated or reduced to any electronic medium or machine readable form without prior written consent from Scientific Software Tools, Inc.
DriverLINX Digital I/O Programming Guide Copyright 1996 - 1998, Scientific Software Tools, Inc. All rights reserved. Fourth Printing. SST 07-0698-1
LabOBJX, SSTNET and DriverLINX are registered trademarks and DriverLINX/VB is a trademark of Scientific Software Tools, Inc. Microsoft and Windows are registered trademarks and Visual C++ and Visual Basic are trademarks of Microsoft Corporation. Borland is a registered trademark and Borland C++ is a trademark of Borland International, Inc. All Keithley product names are trademarks or registered trademarks of Keithley Instruments, Inc. All other brand and product names are trademarks or registered trademarks of their respective companies.
Contents
Preface 5
Software License and Software Disclaimer of Warranty............................................................5 About DriverLINX.....................................................................................................................7 About This Programming Guide ................................................................................................7 Conventions Used in This Manual .............................................................................................9
11
Introducing DriverLINX
13
About DriverLINX...................................................................................................................13 DriverLINX Hardware Model..................................................................................................13 DriverLINX Driver ....................................................................................................13 Logical Devices .........................................................................................................13 Logical Subsystems....................................................................................................14 Logical Channels........................................................................................................14 DriverLINX Programming Model............................................................................................14 Logical Device Descriptors........................................................................................15 Service Requests ........................................................................................................15 C/C++ Interface .........................................................................................................16 Control Interface ........................................................................................................16 Summary ..................................................................................................................................16
17
Digital I/O Hardware Description ............................................................................................17 Mapping Logical Channels to Digital Hardware Channels ......................................................18 Properties of Logical Channels ..................................................................................18 Combining or Splitting Logical Channels ..................................................................19 Implementation Notes ................................................................................................20
22
Using the DriverLINX Control Panel.......................................................................................22 The Device Property Page .........................................................................................23 The Digital Input Property Page ................................................................................24 The Digital Output Property Page..............................................................................27 Using DriverLINX to Dynamically Configure Ports................................................................28
Contents 3
29
DriverLINX Digital I/O Operations ........................................................................................ 29 Using DriverLINXs Service Requests.................................................................................... 30 Properties Common to All Service Requests ............................................................ 30 Using Events to Control Service Requests ................................................................ 31 Events for Digital I/O................................................................................................ 31 Specifying Digital I/O Channels in a Service Request .............................................. 32 Specifying Data Buffers in a Service Request........................................................... 33 Interfacing to DriverLINX ...................................................................................................... 33 Opening and Closing a DriverLINX Device Driver ................................................................ 35 Configuring a Logical Device ................................................................................................. 36 Initializing the Device ............................................................................................................. 37 Initializing a Digital Subsystem............................................................................................... 39 Determining the Digital Port Configuration ............................................................................ 40 Configuring a Digital Port at Run Time .................................................................................. 41 Reading or Writing a Single Value.......................................................................................... 43 Reading or Writing Specific Digital Bits................................................................................. 46 Rapidly Transferring a Block of Digital Data ......................................................................... 49 Performing Background Digital I/O ........................................................................................ 53
61 67
4 Contents
Preface
Licensing Agreement
Copyright. The software and documentation is owned by Scientific Software Tools, Inc. and is protected by both United States copyright laws and international treaty provisions. Scientific Software Tools, Inc. authorizes the original purchaser only (Licensee) to either (a) make one copy of the software solely for backup or archival purposes, or (b) transfer the software to a single hard disk only. The written materials accompanying the software may not be duplicated or copied for any reason. Trade Secret. Licensee understands and agrees that the software is the proprietary and confidential property of Scientific Software Tools, Inc. and a valuable trade secret. Licensee agrees to use the software only for the intended use under this License, and shall not disclose the software or its contents to any third party. Copy Restrictions. The Licensee may not modify or translate the program or related documentation without the prior written consent of Scientific Software Tools, Inc. All modifications, adaptations, and merged portions of the software constitute the software licensed to the Licensee, and the terms and conditions of this agreement apply to same. Licensee may not distribute copies, including electronic transfer of copies, of the modified, adapted or merged software or accompanying written materials to others. Licensee agrees not to reverse engineer, decompile or disassemble any part of the software. Unauthorized copying of the software, including software that has been modified, merged, or included with other software, or of the written materials is expressly forbidden. Licensee may not rent, transfer or lease the software to any third parties. Licensee agrees to take all reasonable steps to protect Scientific Software Tools software from theft, disclosure or use contrary to the terms of the License. License. Scientific Software Tools, Inc. grants the Licensee only a non-exclusive right to use the serialized copy of the software on a single terminal connected to a single computer. The Licensee may not network the software or use it on more than one computer or computer terminal at the same time. Term. This License is effective until terminated. This License will terminate automatically without notice from Scientific Software Tools, Inc. if Licensee fails to comply with any term or condition of this License. The Licensee agrees upon such termination to return or destroy the written materials and all copies of the software. The Licensee may terminate the agreement by returning or destroying the program and documentation and all copies thereof.
Preface 5
Limited Warranty
Scientific Software Tools, Inc. warrants that the software will perform substantially in accordance with the written materials and that the program disk, instructional manuals and reference materials are free from defects in materials and workmanship under normal use for 90 days from the date of receipt. All express or implied warranties of the software and related materials are limited to 90 days. Except as specifically set forth herein, the software and accompanying written materials (including instructions for use) are provided as is without warranty of any kind. Further, Scientific Software Tools, Inc. does not warrant, guarantee, or make any representations regarding the use, or the results of the use, of the software or written materials in terms of correctness, accuracy, reliability, currentness, or otherwise. The entire risk as to the results and performance of the software is assumed by Licensee and not by Scientific Software Tools, Inc. or its distributors, agents or employees. EXCEPT AS SET FORTH HEREIN, THERE ARE NO OTHER WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE, THE ACCOMPANYING WRITTEN MATERIALS, AND ANY ACCOMPANYING HARDWARE.
Remedy. Scientific Software Tools entire liability and the Licensees exclusive remedy shall be, at Scientific Software Tools option, either (a) return of the price paid or (b) repair or replacement of the software or accompanying materials. In the event of a defect in material or workmanship, the item may be returned within the warranty period to Scientific Software Tools for a replacement without charge, provided the licensee previously sent in the limited warranty registration card to Scientific Software Tools, Inc., or can furnish proof of the purchase of the program. This remedy is void if failure has resulted from accident, abuse, or misapplication. Any replacement will be warranted for the remainder of the original warranty period. NEITHER SCIENTIFIC SOFTWARE TOOLS, INC. NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION, SALE OR DELIVERY OF THIS PRODUCT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, OR INCIDENTAL DAMAGES (INCLUDING DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION AND THE LIKE) ARISING OUT OF THE USE OF OR THE INABILITY TO USE SUCH PRODUCT EVEN IF SCIENTIFIC SOFTWARE TOOLS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. BECAUSE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR LIMITATIONS ON DURATION OF AN IMPLIED WARRANTY, THE ABOVE LIMITATIONS MAY NOT APPLY TO LICENSEE. This agreement is governed by the laws of the Commonwealth of Pennsylvania.
6 Preface
About DriverLINX
Welcome to DriverLINX for Microsoft Windows, the high-performance realtime data-acquisition device drivers for Windows application development. DriverLINX is a language- and hardware-independent application programming interface designed to support hardware manufacturers high-speed analog and digital data-acquisition boards in Windows. DriverLINX is a multiuser and multitasking data acquisition resource manager providing more than 100 services for foreground and background data acquisition tasks. Included with your DriverLINX package are the following items:
The DriverLINX DLLs and drivers supporting your data acquisition hardware Learn DriverLINX, an interactive learning and demonstration program for DriverLINX that includes a Digital Storage Oscilloscope Source code for the sample programs The DriverLINX Application Programming Interface files for your compiler DriverLINX On-line Help System DriverLINX 4.0 Installation and Configuration Guide DriverLINX Technical Reference Manual Supplemental Documentation on DriverLINX and your data acquisition hardware
For help installing and configuring your hardware and DriverLINX, please see the hardware manuals that accompanied your board and the DriverLINX 4.0 Installation and Configuration Guide for your version of Windows. For more information on the DriverLINX API, please see the DriverLINX Technical Reference Manual. For additional help programming your board, please examine the source code examples on the Distribution Disks.
This manual is divided into the following chapters: Why Use a Digital I/O Device Driver Brief discussion of why modern operating systems require device drivers. Introducing DriverLINX Presents a quick overview of DriverLINXs hardware and programming model. Digital I/O and DriverLINX Describes how DriverLINXs hardware model supports digital I/O boards.
Preface 7
Configuring Digital I/O Hardware Using the DriverLINX Control Panel to configure digital I/O boards. Programming Digital I/O with DriverLINX Using DriverLINX for digital I/O tasks.
8 Preface
Code
Itemized lists are identified by a round bullet (). Numbered lists indicate a step-by-step procedure. DriverLINX Application Programming Interface and Windows macro and function names are set in bold when mentioned in the text. DriverLINX indicates the exported function name of the device driver DLL while DriverLINX indicates the product as a whole. DriverLINX Application Programming Interface identifiers, menu items, and Dialog Box names are italicized when mentioned in the text. Italics are used for emphasis. Source code and data structure examples are displayed in Courier typeface and bounded by a box with a single line.
Tables
Concept
Preface 9
hardware-independent access to boards belonging to a class of devices, resource sharing of a single physical device among multiple applications and/or threads,
resource arbitration when multiple device users contend for the same hardware resources, and system security either at the logical level of authorized device users or at the physical level of preventing misuse of a device.
The main disadvantage of the device driver model is the extra overhead the system requires to communicate device requests between the application, the device driver, and the hardware. For device requests, such as acquiring a million data samples in one request, the overhead is negligible, but for acquiring one sample using a million separate requests, the time penalty is significant. For this reason, developers must often redesign the protocols and algorithms that worked well in a single-tasking OS, such as DOS, for use in a multitasking system, such as Windows NT.
Introducing DriverLINX
About DriverLINX
The DriverLINX Distribution Disks contain many sample programs for a variety of hardware devices. Many samples won't work with digital I/O devices. Welcome to DriverLINX for Microsoft Windows. DriverLINX is a language and hardware-independent, high-performance, real-time, data-acquisition device driver for 16 and 32-bit Windows 3.x, Windows 95 and Windows NT. DriverLINX supports an abstract hardware model for generalized data-acquisition hardware that includes analog and digital I/O as well as counter/timer functions. This chapter briefly surveys the DriverLINX hardware and programming model. The DriverLINX Technical Reference Manual included with the DriverLINX package is the complete, board-independent specification for the abstract DriverLINX hardware model. Whether or not youre familiar with DriverLINX programming, this guide will ease your learning curve by focusing on just the digital I/O subsystem programming model.
Logical Devices
A single DriverLINX driver can support multiple boards from its list of supported models. During configuration, you assign each physical device a Logical Device number that you use to identify a particular board to DriverLINX. At run time, applications can determine the manufacturer, model name, I/O address, and hardware resources of a Logical Device by consulting DriverLINXs Logical Device Descriptor.
Introducing DriverLINX 13
Logical Subsystems
DriverLINX treats all data-acquisition devices uniformly as abstract hardware consisting of seven possible subsystems.
DEVICEthe physical hardware considered as a whole. AI (Analog Input)the A/D converters, multiplexers, and associated hardware. AO (Analog Output)the D/A converters and associated hardware. DI (Digital Input)the digital input ports and associated hardware. DO (Digital Output)the digital output ports and associated hardware. CT (Counter/Timer)the counter/timer channels and associated hardware.
DriverLINXs Logical Device Descriptor contains properties specifying which Logical Subsystems are available for a particular device.
Logical Channels
The subsystems, except DEVICE, consist of one or more data channels known as Logical Channels. Usually a Logical Channel corresponds to one hardware channel, but, for some boards, DriverLINX may use multiple Logical Channel numbers to access a group of hardware channels using different data widths. DriverLINX records the number of Logical Channels and their capabilities in the Logical Device Descriptor.
The power of the Service Request approach is that you use the same structure for all data-acquisition tasks on any supported hardware. Once you understand how to program one type of device, you can use that knowledge to program any other supported device. To notify an application of the progress or error conditions detected during a dataacquisition task, DriverLINX sends the application a series of messages just as Windows sends messages to an apps message loop. This feature allows an app to
14 Introducing DriverLINX
overlap data processing with data acquisition and easily synchronize the two activities. Most data-acquisition drivers manage a hardware board exclusively for one application. DriverLINX, however, manages the subsystems of a hardware board as a shared resource that multiple applications or threads can share. If your hardware board has the necessary features, DriverLINX supports running multiple, independent tasks concurrently on one board.
Service Requests
The DriverLINX Technical Reference Manual defines the DriverLINX Specification for all data-acquisition boards. Using DriverLINX for a specific board requires learning just the supported properties for the board. The most important DriverLINX concept to understand is the Service Request. This is the data structure, or form, that you use to specify all data-acquisition tasks. As much as is possible, DriverLINX treats all data-acquisition tasks as similar using the same concepts and properties to define each possible task. The key to learning how to specify a Service Request is first learning the major groups of a Service Request, and then learning the properties for each group.
Request Groupspecifies the target Logical Device and Logical Subsystem of a task and the data-acquisition mode and operation to perform. Events Groupspecifies how DriverLINX should time or pace data acquisition, when DriverLINX should start acquisition, and when it should end. Select Groupspecifies the Logical Channels to acquire and the number and length of data buffers to acquire. Results GroupDriverLINX uses these properties to return result codes and single data values.
You can fill out Service Requests either interactively using the Edit Service Request Dialog Box in DriverLINX or programmatically by assigning values to the required properties in each group.
Introducing DriverLINX 15
C/C++ Interface
If youre using C/C++, the Service Request is a C data structure type definition. Create an instance of the data structure, set all fields to zero, and then assign the proper values to each needed property in the groups. After setting up the Service Request, pass the address of the Service Request to DriverLINX for execution.
Control Interface
If youre using the Visual Basic custom control (VBX) or ActiveX (OLE or OCX) version of DriverLINX, the Service Request is an instance of the control on your form or dialog. Assign the proper values to the needed properties for your task. Then tell DriverLINX to execute the Service Request by calling the Refresh method for the control.
Summary
DriverLINX provides a hardware-independent, abstract model of data-acquisition hardware consisting of seven possible Logical Subsystems. Each Logical Subsystem treats data-acquisition tasks as conceptually similar. Developers program dataacquisition tasks by setting up the properties in the Request, Event, and Select Groups of a Service Request. The DriverLINX Technical Reference Manual defines the DriverLINX Specification for all data-acquisition boards. Using DriverLINX for a particular board requires learning the supported properties for the hardware.
16 Introducing DriverLINX
Port Aconfigurable as either an 8-bit data output latch/buffer or an 8bit data input latch. Port Bconfigurable as either an 8-bit data output latch/buffer or an 8bit data input buffer. Port Cconfigurable as an 8-bit data output latch/buffer, an 8-bit data input buffer, or as two 4-bit ports (Port Cu and Cl).
The 24 digital lines are programmable in two groups of 12 Group APort A and Port Cu Group BPort B and Port Cl
The Intel 8255 chip has three operational modes Basic (Mode 0)supports simple input or output without control and status signals. Outputs are latched and inputs are not latched. Strobed (Mode 1)supports input or output for Group A and B using Port C for control and status signals. The 8-bit inputs and outputs are latched. Bidirectional (Mode 2)supports bidirectional input and output only for Group A using 5 lines of Port C for control and status bits. The 8-bit inputs and outputs are latched.
Many 8255 emulations, however, only support the Basic mode (Mode 0). For more information, see the Intel 8255A Programmable Peripheral Interface data sheet and your digital I/O hardware Users Guide. Each 8255 chip occupies 4 consecutive I/O addresses. The first three locations address Ports A, B, and C, and the fourth location addresses a hardware control port.
Logical Channel
PIO-12 PIO-24 PCI-PIO24 PIO-96 PCI-PIO96 PIO-SSR-24 PIO-SSR-48 PIO-SSR-120 PIO-HV Intel 8255 PIO-32IN PIO-32IO PIO-32OUT PDISO-8 REL-16
0
A A A A A A A A O A I I O O O
1
B B B B B B B B I B I I O I O
2
C C C C C C C C S C I O O
10 11 12 13 14
A A
B B
C C
A A
B B
C C
A A
B B
C C
A A
B B
C C A B C A B C A B C
I O O
Logical Channel
PIO-12 PIO-24 PCI-PIO24 PIO-96
0
R W R W R W R
1
R W R W R W R
2
R W R W R W R
10 11 12 13 14
W PCI-PIO96 PIO-SSR-24 PIO-SSR-48 PIO-SSR-120 PIO-HV Intel 8255 PIO-32IN PIO-32IO PIO-32OUT PDISO-8 REL-16 R W R W R W R W R W R W r r rw rw rw
W R W R W R W R W R W R W r r rw r rw
W R W R W R W R W R W R W r rw rw
W R W
W R W
W R W
W R W
W R W
W R W
W R W
W R W
W R W
R W R W
R W R W
R W R W R W R W R W R W R W R W R W R W R W
r rw rw
0
15 MSB
Size Code
14 13 12 11 10 9 8
Channel Number
7 6 5 4 3 2 1 0 LSB
Size Code
0 1 2 3 4 5 6 7
Unit
native bit half nibble nibble byte word dword qword
Bits
varies with hardware 1 2 4 8 16 32 64
Native units refer to the hardware-defined digital channel size. For most boards, this is the same as an 8-bit byte. When using extended Logical Channel addressing, DriverLINX groups digital bits in units defined by the size code and then assigns consecutive channel numbers starting from zero. For instance, an Intel 8255 with three 8-bit ports would have the following channel addresses for each size code:
Unit
native bit half nibble nibble byte word
Channels
0..2 0..23 0..11 0..5 0..2 0..1
Address (dec)
0..2 4096..4119 8192..8203 12288..12293 16384..16386 20480..20481
Address (hex)
0..2 1000..1017 2000..200B 3000..3005 4000..4002 5000..5001
Implementation Notes
For extended Logical Channel addressing of unit sizes less than the native size, DriverLINX only supports single-value transfers. For block I/O transfers, DriverLINX only allows Logical Channel addressing at unit sizes equal or larger than the native size. Note that extended Logical Channels may not map to consecutive physical channels. Because DriverLINX uses the CPUs block I/O instructions for polled, block I/O transfers, some bytes wont represent I/O ports. For buffered interrupt transfers, DriverLINX requires transfers to use native addressing or larger sizes. DriverLINX will map extended Logical Channels to consecutive I/O ports even if the physical port addresses arent consecutive.
When using size codes larger than the native addressing unit, you may not be able to address all hardware ports if the number of available digital I/O lines is not an integral multiple of the size unit.
Use the Configuration Panel to tell DriverLINX the model of the board youve installed, its base I/O address, and the interrupt channel youve assigned to the board, if it has one. You can also instruct DriverLINX to initialize the hardware into a custom configuration of input and output ports and default output values. This may be useful if you connect your hardwares outputs to external devices that expect high logic signals, rather than the default low logic signals, as their starting state.
Your applications can also program DriverLINX to display the Configure DriverLINX Device dialog at run-time (see Configuring a Logical Device on page 36).
Pushing the Setup button on the DriverLINX Configuration Panel displays a Configure DriverLINX Device dialog box for configuring the selected Logical Device. The tabbed dialog box has a page for each Logical Subsystem that your board supports. Select and complete each property page to configure the Logical Device.
To successfully configure your hardware, enter the following required fields on the Device page:
Modelselect the model name that matches the installed board. The selection, Intel 8255, will work with most digital boards that use an 8bit ISA interface. Addressenter the base I/O address that you set on the boards jumpers or dip switch. This address must not conflict with any other device in your system.
The following fields should usually be left with their default values: Detectwhen checked, this instructs DriverLINX to attempt to detect and test the installed hardware during driver loading. For simple digital I/O boards, DriverLINX may not use any detection protocols so this switch may have no effect. You may need to disable detection if your hardware has malfunctioning I/O ports that youre not using or if the hardware testing algorithms interfere with permanently attached equipment.
Calibratewhen checked, DriverLINX performs hardware calibration if the device supports this feature. This switch has no effect for digital I/O boards.
At this point, you may either select OK and accept default initialization or advance to the Digital Input and Digital Output Property Pages.
The Configuration properties have no effect if youre hardware has a fixed configuration.
This page allows you to assign an interrupt channel to your board, if it supports interrupts, and to modify DriverLINXs default hardware initialization. DriverLINX disables options not supported by your hardware. Enter the selections for the following fields:
Channelsshows the available Logical Channels for digital input and selects the Logical Channel for the Configuration properties. Interruptspecifies the interrupt channel youve assigned to your hardware. If youre not using interrupts, select none. DMA levelspecifies the DMA channel youve assigned to your hardware. Most digital I/O boards dont use DMA.
DriverLINX configures and initializes all Logical Channels when the operating system loads the kernel mode device driver, usually at boot time. At run time, the hardware effects of a Device Initialization operation depend on the number of times apps have concurrently opened the DriverLINX device driver.
If one application has opened the device, DriverLINX will reconfigure and reinitialize the hardware. If other applications are sharing the device, DriverLINX does not change the hardware configuration or initialization status.
24 Configuring Digital I/O Hardware
Setuptells DriverLINX to configure the Logical Channel selected in the Channels list box as input (1) or output (0). DriverLINX ignores
this property if Initialize isnt checked. Certain Logical Channels on some boards support additional configuration values (see Definition of Configuration Values on page 25).
Initializewhen checked, this property indicates that DriverLINX should automatically configure this channel as specified in the Setup property. If unchecked, DriverLINX ignores the value of the Setup property.
To configure the ports at run time, see Configuring a Digital Port at Run Time on page 41.
Configuration Example
To configure Logical Channel 2 as an output port, perform the following steps: 1. 2. 3. Select 2 (bits 0-7) in the Channels list box. Enter 0 in the Configuration Setup edit box. Click the Initialize check box.
Repeat steps 1 to 3 for every Logical Channel that requires user-defined configuration. After completing all Property Pages, press OK to save your configuration.
Bit 4
0 0 0 0 1 1
Bit 3
0 0 1 1 0 0
Bit 2
x x x x x x
Bit 1
x x x x x x
Bit 0
0 1 0 1 0 1
Meaning
Mode 0, output port Mode 0, input port Mode 1, output port Mode 1, input port Mode 2, output port Mode 2, input port
Model
PIO-12 PCI-PIO24
Logical Channels
0, 1 0, 1
0, 1, 3, 4, 6, 7, 9, 10 0, 1 0, 1
Port C of an 8255 chip doesnt support modes, but it does support nibble programming of the I/O direction. To setup the third channel in each group of 3, use the following definition for the Configuration Setup property:
Bit 2
0 0 1 1 1 1
Bit 1
x x 0 0 1 1
Bit 0
0 1 0 1 0 1
Meaning
All 8 bits are output. All 8 bits are input. All 8 bits are output. Low 4 bits are input. High 4 bits are output. Low 4 bits are output. High 4 bits are input. All 8 bits are input.
Model
PIO-12 PIO-24 PCI-PIO24 PIO-96 PCI-PIO96 PIO-SSR-24 PIO-SSR-48 PIO-SSR-120 Intel 8255 DASCard-PIO12
Logical Channels
2 2 2 2, 5, 8, 11 2, 5, 8, 11 2 2, 5 2, 5, 8, 11, 14 2 2
Note: Some special considerations apply when transfer data to or from a port with one nibble configured for input and the other for output.
When writing data, DriverLINX ignores the nibble data for the input nibble. When reading data, DriverLINX returns both nibbles. The input nibble has new input data while the output nibble has the last data written.
As an alternative, DriverLINX allows applications to explicitly specify masks or access subdivisions of a port. See Reading or Writing Specific Digital Bits on page 46 or Combining or Splitting Logical Channels on page 19.
This page allows you to define output values for initializing the ports, and it allows you to define interrupt resources if you didnt define them on the Digital Input Property Page. By default DriverLINX sets output values to zero. To change the defaults, modify the following fields:
Channelsshows the available Logical Channels for digital output and selects the Logical Channel for the Initialization properties. Valuespecifies the output value DriverLINX uses to initialize the port selected in the Channels list box. DriverLINX ignores this property if Initialize isnt checked. Initializewhen checked, this property indicates that DriverLINX should automatically initialize this channel as specified in the Value property.
If you specify an initialization value for an input port, DriverLINX ignores the initialization value. However, if you dynamically reconfigure an input port for output, DriverLINX will write the initialization value, or the last output value if previously reconfigured, to the output port. DriverLINX configures and initializes all Logical Channels when the operating system loads the kernel mode device driver, usually at boot time. At run time, the hardware effects of a Device Initialization operation depend on the number of times apps have concurrently opened the DriverLINX device driver.
If one application has opened the device, DriverLINX will reconfigure and reinitialize the hardware. If other applications are sharing the device, DriverLINX does not change the hardware configuration or initialization status.
Repeat steps 1 to 3 for every Logical Channel that requires user-defined initialization. After completing all Property Pages, press OK to save your configuration.
Connecting to a deviceDriverLINX requires applications to open, select, and close drivers for specific boards. See Opening and Closing a DriverLINX Device Driver on page 35. Configuring a deviceDriverLINX allows your application to display the Configure DriverLINX Device dialog box for users. See Configuring a Logical Device on page 36. Device initializationDriverLINX initializes all subsystems on a board. See Initializing the Device on page 37. Subsystem initializationDriverLINX initializes a single, specified subsystem. See Initializing a Digital Subsystem on page 39. Single value I/ODriverLINX synchronously reads or writes a single value to an I/O port. See Reading or Writing a Single Value on page 43. Masked, single value I/ODriverLINX synchronously reads or writes only the selected bits of an I/O port. See Reading or Writing Specific Digital Bits on page 46. Block transfer on an I/O portDriverLINX synchronously transfers a block of data to or from an I/O port. See Rapidly Transferring a Block of Digital Data on page 49.
If the board has the necessary hardware, the DriverLINX API also supports the following digital I/O operations:
Dynamic port configurationDriverLINX dynamically reconfigures a programmable digital I/O port as input or output or changes the
hardwares operating mode. See Statically Configure Digital Ports on page 24, Determining the Digital Port Configuration on page 40, and Configuring a Digital Port at Run Time on page 41.
Buffered I/O on one or more portsDriverLINX asynchronously transfers values between data buffers and one or more I/O ports. See Performing Background Digital I/O on page 53.
Most digital I/O operations are synchronous. DriverLINX doesnt return control back to the calling application until the I/O transfer has completed. Buffered I/O operations, however, are asynchronous. DriverLINX initiates the I/O operation and then immediately returns control back to the calling application. Both DriverLINX and the host application run concurrently. DriverLINX can support asynchronous mode only if
the digital I/O board supports interrupts you have configured the board to use an available interrupt.
Devicespecifies the Logical Device number of a configured device as the target of this Service Request. Subsystemspecifies the primary Logical Subsystem that is the target of this Service Request.
Modesuggests the hardware technique (Other, Polled, Interrupt, DMA) that DriverLINX should use for this Service Request. Operationspecifies the primary command to execute for this Service Request.
The additional Service Request groups and properties depend on the selected subsystem, operation, and task your application intends to perform.
Timingspecifies the timing, or pacing, clock DriverLINX uses to acquire a series of samples during processing a Service Request. Startspecifies when DriverLINX starts acquiring data for this Service Request. Stopspecifies when DriverLINX stops acquiring data for this Service Request.
The example Service Request above defines a synchronous (polled) digital read of one sample (no timing event) on Logical Device 0 that starts immediately (on software Command) and ends when DriverLINX reads all, i.e., one, sample (on Terminal count). The DriverLINX Technical Reference Manual defines an extensive set of possible events for a wide variety of hardware and data-acquisition protocols. A DriverLINX driver for a specific manufacturers product, however, uses only a few of the defined events. The DriverLINX Technical Reference Manual describes the Logical Device Descriptor. DriverLINX tries to define events as hardware independent and to allow each event to be used as a timing, start, or stop event whenever logical. Some hardware boards, however, dont support events that are common to the majority of similar products, or they support only a subset of the events parameters. To allow applications to handle hardware-dependent features, DriverLINX publishes board-specific information for applications in the Logical Device Descriptor.
DriverLINX Digital I/O Programming Guide
Digital Setupspecifies how to configure a programmable digital channel. Commandindicates that the Service Request starts or stops on software command. Terminal countindicates that the Service Request completes when the hardware has transferred all samples into or out of the data buffers. Digitalspecifies a digital input channel to read and a masked set of bits to compare to a pattern. Use as a timing, start, or stop event. Ratespecifies the operating parameters for an internal or external hardware clock.
The following table defines the events DriverLINX allows for each event class and mode.
Mode
Other Polled
Timing
None Digital Setup None
Start
None None Command Digital Command Digital
Stop
None None Terminal count Command Digital Terminal count
Interrupt
Rate Digital
DriverLINX simulates simultaneous digital I/O transfers using a fast software loop.
When specifying more than one Logical Channel, all Logical Channels must specify the same size addressable unit, such as native or byte. For buffered interrupt operations, DriverLINX can transfer one Logical Channel at each interrupt or transfer all specified Logical Channels at each interrupt. The Simultaneous property tells DriverLINX to transfer either one channel (unchecked or false) or all channels (checked or true) at each interrupt.
For untimed I/O transfers using fast CPU block I/O instructions, applications can specify one Logical Channel and one buffer as long as 128 KB. For timed I/O transfers using external interrupts, applications can specify multiple Logical Channels and up to 255 fixed-length buffers of arbitrary size.
To transfer only a single value in a Service Request, see Reading or Writing a Single Value on page 43.
Interfacing to DriverLINX
To use DriverLINX, applications must incorporate the DriverLINX API into their code. Applications can then control multiple DriverLINX drivers and multiple Logical Devices using DriverLINXs API. The DriverLINX API supports multiple languages as well as both Win16 and Win32 application development. DriverLINX supports three different language interfaces.
C/C++a data structure and function call API available for both 16and 32-bit C/C++ applications. VBX16-bit Visual Basic Custom Control that supports the Visual Basic 1.0, or higher, control standard. Some C/C++ compilers and 16bit Delphi 1.0 can also use this interface.
A specific DriverLINX driver may not be available on all platforms.
ActiveXor OLE 2.0 Custom Control (OCX) in both 16- and 32-bit interfaces. Visual Basic 4.0, Microsoft Visual C++ 4.0, Delphi 2.0, and most new language tools support 32-bit ActiveX controls.
The DriverLINX language interfaces bind to either DrvLNX16.DLL or DrvLNX32.DLL. These DLLs are operating system independent and allow you to run your binary application on either Win 3.x, Win 95, or Win NT as long as you have installed the correct version of DriverLINX for your hardware and operating system.
2.
Add the following import library to your project or linkers list of libraries, for 16-bit applications, DRVLNX16.LIB for 32-bit applications, DRVLNX32.LIB
Note that some compiler tools, such as Borland C/C++, use a library file format that is not compatible with Microsofts format. Please check DLAPI subdirectory where you installed DriverLINX for library files compatible with your compiler. If present, youll have to rename them to the above library names. If not present, most compilers provide a tool to create a linking library given a DLL. Please consult your compiler vendors documentation for assistance.
ActiveX Control To add the ActiveX Custom Control (OCX) to your project, see the instructions for your compiler. The name of the 16-bit control is DLXOCX16.OCX, while the 32-bit control is DLXOCX32.OCX. You may also want to add symbolic constant definitions to your project. Look on the DriverLINX Distribution Disks or SSTs Web site to see if files exist for your compiler.
Applications should close the device driver when they no longer need its services. Closing a DriverLINX driver stops all active tasks and unloads it from memory.
Parameter
hWnd Name
Type/Description
HWND Specifies one of the callers Window handles. LPCSTR Specifies the name of the DriverLINX driver to load. If NULL, DriverLINX displays the Open DriverLINX dialog box.
This function returns an instance handle that the application can use to identify the DriverLINX driver for the SelectDriverLINX and CloseDriverLINX function calls.
Parameter
hDLL
Type/Description
HINSTANCE Specifies the instance handle returned by an OpenDriverLINX call.
Device
<Logical Device>
Subsystem
DEVICE
Mode
OTHER
Operation
CONFIGURE
The other properties of a Service Request are unused and should be set to zero.
If the application is the only process using the device, DriverLINX reconfigures and reinitializes the hardware to the user-defined state. If you dont define initialization values for output ports, DriverLINX writes zeros to output ports when the driver first loads and the last known output value at any other Device Initialization. If multiple processes are sharing the device, DriverLINX does not reconfigure or reinitialize the hardware state. If another process is executing a Service Request on the device, DriverLINX returns a Device Busy error to app requesting initialization.
Device
<Logical Device>
Subsystem
DEVICE
Mode
OTHER
Operation
INITIALIZE
The other properties of a Service Request are unused and should be set to zero.
Device
<Logical Device>
Subsystem
<Logical Subsystem>
Mode
OTHER
Operation
INITIALIZE
The other properties of a Service Request are unused and should be set to zero.
This algorithm wont disturb the current state of any Logical Channel.
For the subroutines, ReadChannel and WriteChannel, see Read or Write a Single Value Using C/C++ on page 44.
For the subroutines, ReadChannel and WriteChannel, see Read or Write a Single Value Using Visual Basic on page 45.
<Logical Device>
OTHER
CONFIGURE
And specify a Digital Setup Event for the timing event as follows:
Channel
<Logical Channel>
Mode
DIO_BASIC or DIO_STROBED or DIO_BIDIRECTIONAL
For a list of error codes, see the DriverLINX Technical Reference Manual.
The Logical Channel in the Digital Setup Event specifies the channel you want to reconfigure. To configure as an input channel, set the subsystem to digital input. To configure as an output channel, set the subsystem to digital output. If the port doesnt support dynamic reconfiguration, DriverLINX will return an error code for Operation Not Supported. If the port youre configuring is already an input, DriverLINX reports no error. Note that reconfiguring Intel 8255 PPI chips will reinitialize the values on the other output ports of the chip. DriverLINX will rewrite the last known output values to the ports, but any equipment attached to the ports may respond to transient changes on the outputs, or glitches.
Device
<Logical Device>
Subsystem
<Logical Subsystem>
Mode
POLLED
Operation
START
Timing
None
Start
None or Command
Stop
None or Terminal count
For a Start Event, None or Command are equivalent as are None or Terminal Count for a Stop Event. Start on Command and stop on Terminal Count tells DriverLINX to transfer the data once. Select Channels Setup the Select Group Channels as follows:
Number of channels
1
Start Channel
<Logical Channel>
Format
native
Select Buffers Single-value transfers use ioValue property in the Service Request instead of a buffer to hold the data. Set the number of Buffers to zero. For output, assign the output value to the ioValue property in the Results Group. For input, read the input from the ioValue property after executing the Service Request.
//******************************************* // Use this procedure to write a single value // to a specific channel //******************************************* UINT WriteChannel (LPServiceRequest pSR, UINT Device, UINT Channel, DWORD Value) { memset(pSR, 0, sizeof(DL_SERVICEREQUEST)); DL_SetServiceRequestSize(*pSR); pSR->device = Device; pSR->subsystem = DO; pSR->mode = POLLED; pSR->operation = START; pSR->channels.nChannels = 1; pSR->channels.chanGain[0].channel = Channel; pSR->status.typeStatus = IOVALUE; pSR->status.u.ioValue = Value; UINT result = NoErr; if (DriverLINX(pSR) != NoErr) { result = pSR->result; // Display error message pSR->operation = MESSAGEBOX; DriverLINX(pSR); } return result; }
'Use this procedure to write one sample 'to a specific channel Sub WriteChannel(dl As Control, Channel As Integer, ByVal Value As Integer) Dim Res% With dl .Req_subsystem = DL_DO .Req_mode = DL_POLLED .Req_op = DL_START Evt_Tim_type = DL_NULLEVENT .Evt_Str_type = DL_NULLEVENT .Evt_Stp_type = DL_NULLEVENT .Sel_buf_N = 0 .Sel_chan_format = DL_tNATIVE .Sel_chan_N = 1 .Sel_chan_start = Channel .Res_Sta_ioValue = Value .Refresh End With End Sub
Setting up masked I/O is similar to single value transfers. First, setup the Service Request Group as follows:
Device
<Logical Device>
Subsystem
<Logical Subsystem>
Mode
POLLED
Operation
START
Timing
None
Start
Digital
Stop
None or Terminal count
For a Stop Event, None or Terminal Count are equivalent. Start Event Setup the Digital Event as follows:
Channel
<Logical Channel>
Mask
<bit mask>
Match
<unused>
Pattern
<unused>
DriverLINX composes the new output value for the port as new value = (old value AND NOT Mask) OR (user value AND Mask). Select Channels Setup the Select Group Channels as follows:
Number of channels
1
Start Channel
<Logical Channel>
Format
native
Select Buffers Single-value transfers use ioValue property in the Service Request instead of a buffer to hold the data. Set the number of Buffers to zero. For output, assign the value to write to the ioValue property in the Results Group. For input, read the input from the ioValue property after executing the Service Request.
Applications can rapidly transfer a single data buffer of values to or from an I/O port using the computers block I/O hardware instructions.
Device
<Logical Device>
Subsystem
<Logical Subsystem>
Mode
POLLED
Operation
START
Timing
None
Start
None or Command
Stop
None or Terminal count
For a Start Event, None or Command are equivalent as are None or Terminal Count for a Stop Event. Start on Command and stop on Terminal Count tells DriverLINX to transfer the data in buffer once. Select Channels Setup the Select Group Channels as follows:
Number of channels
1
Start Channel
<Logical Channel>
Format
native
Select Buffers Set the number of Buffers to one and the BufferSize to the number of bytes to transfer.
//********************************** // Use this procedure to read a data // array from a specific channel //********************************** UINT ReadChannelBuff (LPServiceRequest pSR, UINT Device, UINT Channel, PVOID Buffer, DWORD Length) { memset(pSR, 0, sizeof(DL_SERVICEREQUEST)); DL_SetServiceRequestSize(*pSR); pSR->device = Device; pSR->subsystem = DI; pSR->mode = POLLED; pSR->operation = START; pSR->channels.nChannels = 1; pSR->channels.chanGain[0].channel = Channel; pSR->lpBuffers = (LPBUFFLIST)malloc(DL_BufferListBytes(1)); if (!pSR->lpBuffers) return Error(Abort, BufAllocErr); pSR->lpBuffers->nBuffers = 1; pSR->lpBuffers->bufferSize = Length; pSR->lpBuffers->BufferAddr[0] = Buffer; UINT result = NoErr; if (DriverLINX(pSR) != NoErr) { result = pSR->result; // Display error message pSR->operation = MESSAGEBOX; DriverLINX(pSR); } return result; }
//*********************************** // Use this procedure to write a data // array to a specific channel //*********************************** UINT WriteChanBuf (LPServiceRequest pSR, UINT Device, UINT Channel, PVOID Buffer, DWORD Length) { memset(pSR, 0, sizeof(DL_SERVICEREQUEST)); DL_SetServiceRequestSize(*pSR); pSR->device = Device; pSR->subsystem = DO; pSR->mode = POLLED; pSR->operation = START; pSR->channels.nChannels = 1; pSR->channels.chanGain[0].channel = Channel; pSR->lpBuffers = (LPBUFFLIST)malloc(DL_BufferListBytes(1)); if (!pSR->lpBuffers) return Error(Abort, BufAllocErr); pSR->lpBuffers->nBuffers = 1; pSR->lpBuffers->bufferSize = Length; pSR->lpBuffers->BufferAddr[0] = Buffer; UINT result = NoErr; if (DriverLINX(pSR) != NoErr) { result = pSR->result; // Display error message pSR->operation = MESSAGEBOX; DriverLINX(pSR); } return result; }
'Use this procedure write an integer data 'array to a specific channel Sub WriteChanBuf(dl As Control, Channel As Integer, Buffer() As Integer, Length As Integer) Dim i% With dl .Req_subsystem = DL_DO .Req_mode = DL_POLLED .Req_op = DL_START .Evt_Tim_type = DL_NULLEVENT .Evt_Str_type = DL_NULLEVENT .Evt_Stp_type = DL_NULLEVENT .Sel_buf_N = 1 .Sel_buf_samples = Length For i = 0 To Length - 1 .Buf_0(i) = Buffer(i) Next I .Sel_chan_format = DL_tNATIVE .Sel_chan_N = 1 .Sel_chan_start = Channel .Refresh End With End Sub
To transfer a buffer in the background, setup the Service Request Group as follows:
Device
<Logical Device>
Subsystem
<Logical Subsystem>
Mode
INTERRUPT
Operation
START
Timing
Digital or Rate
Start
Command or Digital
Stop
Command or Digital or Terminal count
Timing Event Use a Digital Timing Event to tell DriverLINX which hardware input source to use for the interrupt. Setup the Digital Event as follows:
Channel
<external interrupt channel>
Mask
<input lines to test>
Match
FALSE or not equal
Pattern
0
For the Channel, either specify the Logical Channel DriverLINX has assigned as the external interrupt input line (for an N-channel digital input board, this is usually Logical Channel N) or use a hardwareindependent, symbolic Logical Channel, DI_EXTCLK. DriverLINX automatically replaces this value with the correct hardware channel when the app sends the Service Request to DriverLINX. Use the Mask property to indicate which line(s) to enable for interrupts. Most boards only support one external interrupt line so use a value of 1. The MetraByte PIO-SSR Series, however, logically combines (logical OR operation) the C0 and C3 inputs of every Port C on the board to trigger an interrupt. You can enable (1) or disable (0) individual interrupt input lines by setting the corresponding bit in the Mask property. The LSB specifies the C0 input of the lowest Logical Channel, and the MSB specifies the C3 input of the highest Logical Channel. Set the Match and Pattern properties to not equal zero. This specifies that a rising edge at any input will trigger the interrupt. Other values for these properties will generate an error.
As an alternative to a Digital Timing Event, you can specify a Rate Event that uses a Rate Generator with an external clock. This option is for compatibility with other data-acquisition devices that support pacing clocks. This option is logically equivalent to specifying the above Digital Event with a Mask value of 1. Start and Stop Events DriverLINX can optionally post buffer filled messages to the application as DriverLINX completes processing each buffer. To start or stop data transfer on software command, use Command Events for the Start or Stop Event. If you use a Stop Command or Digital Event, after DriverLINX finishes processing the last buffer, it will automatically start transferring data again from the first buffer. With a Stop Command, DriverLINX will acquire data until the application resets the Service Requests Operation property to Stop and resubmits the Service Request to DriverLINX.
DriverLINX can optionally post start trigger and stop trigger messages to the application. See the DriverLINX Technical Reference Manual for more information about messages.
To start or stop data transfer when a certain condition occurs on a digital input channel, use a Digital Event for the Start or Stop Event. At each interrupt, DriverLINX tests the requested Logical Channel for the trigger event. If DriverLINX detects the start trigger, it starts processing the data buffers immediately. After processing one sample or scan, DriverLINX tests for the stop trigger event, and, if found, stops processing data immediately. Note that a digital input may change value between the time when DriverLINX reads the Logical Channel for a trigger test and reads a channel for data input. Setup a Digital Event as follows:
Channel
<Logical Channel>
Mask
<input lines to test>
Match
0 - not equal or 1 - equal
Pattern
<pattern to match>
For the Channel property, specify the Logical Channel for any digital input port. Use the Mask property to select which input bits to test as a digital trigger. Use the Match property to select how DriverLINX tests for a digital trigger. Use the Pattern property to specify the bits DriverLINX uses for comparison.
DriverLINX supports two types of digital triggers tests based on the value of the Match property.
Match Value
0 1
Trigger Test
Channel AND Mask Pattern Channel AND Mask = Pattern
With a Stop Digital Event, DriverLINX will terminate acquisition either when the digital input value satisfies the digital trigger condition or when the application sends a stop operation. If the delay property of a Digital Event is not zero, DriverLINX wont trigger the event until it has counted the number of additional interrupts the app specified in the delay property. As a special case, if the stop delay property has the maximum count, DriverLINX treats this event as stop on command, but it will send a message to the application each time it detects the stop event. Select Channels Setup the Select Group Channels for 1 Logical Channel:
Number of channels
1
Start Channel
<Logical Channel>
Format
native
Number of channels
2
Start Channel
<Logical Channel>
Stop Channel
<Logical Channel>
Format
native
Specify the number of channels as 2, not the number of channels in the consecutive sequence.
DriverLINX scans all channels between the starting and stopping channel. If the starting channel is greater than the stopping channel, the channel sequence wraps around at the highest Logical Channel and continues from zero. Setup the Select Group Channels for a random channel list:
Number of channels
<size of list>
Channeli
<Logical Channel>
Gaini
0
Format
native
You may use extended Logical Channel addressing, but all channels must have the same size attribute. DriverLINX can transfer one Logical Channel at each interrupt or transfer all the specified Logical Channels (a scan) at each interrupt. The Simultaneous property tells DriverLINX to transfer either one channel (unchecked or false) or all channels (checked or true) at each interrupt. Most digital I/O hardware doesnt support true simultaneous transfers, so DriverLINX rapidly reads each channel in a loop. Select Buffers Set the number of Buffers between 1 and 255 and the BufferSize to the number of bytes to transfer. Buffers must contain an integral multiple of the number of channels.
Write Buffers
//*********************************** // Use this procedure to write a data // array to a specific channel // in the background //*********************************** UINT WriteChannelBuffBkg (LPServiceRequest pSR, UINT Device, UINT Channel, PVOID Buffer, DWORD Length) { memset(pSR, 0, sizeof(DL_SERVICEREQUEST)); DL_SetServiceRequestSize(*pSR); pSR->device = Device; pSR->subsystem = DO; pSR->mode = INTERRUPT; pSR->operation = START; /* Setup external interrupt as timing clock */ pSR->timing.typeEvent = DIEVENT; pSR->timing.u.diEvent.channel = DI_EXTCLK; pSR->timing.u.diEvent.mask = 1; pSR->timing.u.diEvent.match = FALSE; pSR->timing.u.diEvent.pattern = 0; pSR->start.typeEvent = COMMAND; pSR->stop.typeEvent = TCEVENT; pSR->channels.nChannels = 1; pSR->channels.chanGain[0].channel = Channel; pSR->lpBuffers = (LPBUFFLIST)malloc(DL_BufferListBytes(1)); if (!pSR->lpBuffers) return Error(Abort, BufAllocErr); pSR->lpBuffers->nBuffers = 1; pSR->lpBuffers->bufferSize = Length; pSR->lpBuffers->BufferAddr[0] = Buffer; UINT result = NoErr; if (DriverLINX(pSR) != NoErr) { result = pSR->result; // Display error message pSR->operation = MESSAGEBOX; DriverLINX(pSR); } return result; }
Write Buffers
' Use this procedure to write a data ' array to a specific channel ' in the background Sub WriteChannelBuffBkg (dl As Control, Channel As Integer, Buffer As Integer, Length As Integer) With dl .Req_subsystem = DL_DO .Req_mode = DL_INTERRUPT .Reqoperation = DL_START ' Setup external interrupt as timing clock .Evt_Tim_type = DL_DIEVENT .Evt_Tim_diChannel = DL_DI_EXTCLK .Evt_Tim_diMask = 1 .Evt_Tim_diMatch = DL_NotEquals .Evt_Tim_diPattern = 0 .Evt_Str_type = DL_COMMAND .Evt_Stp_type = DL_TCEVENT .Sel_chan_N = 1 .Sel_chan_start = Channel .Sel_chan_format = DL_tNATIVE .Sel_buf_N = 1 .Sel_buf_samples = Length .Sel_buf_notify = DL_NOTIFY .Refresh End With Sub DriverLINXSR1_BufferFilled(task As Integer, device As Integer, subsystem As Integer, mode As Integer, bufIndex As Integer) .VBArrayBufferXfer(0, Buffer, DL_VBArrayToBuffer) End Sub
Glossary of Terms
ActiveX
Component software object using Microsofts Component Object Model specification for 16- and 32-bit controls. ActiveX controls were formerly called OCX controls.
API
Application Programming Interfacethe properties and methods used to communicate with a software service.
COM
Component Object Model is a specification of a binary standard for reusable software objects.
DMA
Direct Memory Access provides a direct device to memory hardware channel that doesnt require software overhead to transfer acquired data.
Kernel Mode
The privileged mode in which the operating system runs system software such as device drivers. Kernel mode software has complete access to memory and hardware resources.
Logical Channel
A DriverLINX-assigned number for a data channel of a Logical Subsystem.
Logical Device
A user-assigned number that a DriverLINX driver uses to designate an installed hardware device.
Glossary of Terms 61
Logical Subsystem
A set of related hardware resources on a data-acquisition device. DriverLINX abstractly characterizes all data-acquisition devices as consisting of seven possible subsystemsdevice, analog input, analog output, digital input, digital output, and counter/timer.
nibble
A nibble is 4 bits or byte.
OCX
OLE Custom Controls are now called ActiveX custom controls.
OLE
Object Linking and Embedding is an older term for Microsoft's ActiveX technology.
Service Request
A DriverLINX data structure that completely specifies the parameters for all dataacquisition tasks.
User Mode
The mode in which the operating system runs user applications. User mode software has restricted access to memory, other processes, and hardware.
VBX
Component software object using the 16-bit Visual Basic Custom Control specification. Many 16-bit C/C++ compilers and Delphi 1.0 also support VBX controls.
62 Glossary of Terms
Index
Configuration Example 25 Configuration Setup 2526 Configuration Values 25 Configure digital ports 24, 30 Configure DriverLINX Device dialog box 23, 36 Configuring a device 29 Configuring DriverLINX administrative account 22 Connecting to a device 29 Constant DI_EXTCLOCK 54, 5759 Control Interface 16 CT 14 custom configuration 22
1
16-bit 33
D
DASCard-PIO12 26 Data Buffers Specifying 33 default hardware initialization 24 Delphi 33 Detect 23, 41 detection protocols 23 DEVICE 14, 3639 device drivers 711, 22 advantages 11 disadvantages 12 Device initialization 24, 27, 2931, 37 Device Property Page 23 Address 23 Calibrate 24 Detect 23, 41 Model 1314, 23, 25 DI 14, 40, 4546, 5152, 54, 5759 DI_EXTCLK 54, 5759 dialog box Configure DriverLINX Device 23, 36 Edit Service Request 15, 30 Open DriverLINX 35 Digital Event 32 Digital I/O events 31 Digital I/O hardware 8, 17, 22, 36, 41, 56 Digital I/O operations 7, 2931 Digital Input Property Page 24, 27 Channels 24, 27 Configuration Setup 2526 Initialize 25, 27 Interrupt 24, 31, 32 Setup 23, 2426, 28, 32, 42, 44, 4647, 4950, 5259 Digital Output Property Page 27 Channels 24, 27 Initialize 25, 27 Value 27, 4346, 4346, 4346, 49 Digital Setup Event 28, 32, 42
3
32-bit 13, 3334
A
ActiveX 16, 2930, 34 Address 23 administrative account 22 AI 14 AO 14 asynchronous 30 Asynchronous I/O 30, 53
B
Background I/O 30, 53 base I/O address 2223 Block I/O transfers 20 Block transfer 29 Buffered I/O 30 Buffered interrupt transfers 20
C
C/C++ Interface 16, 34 Calibrate 24 channel size 20 Channels 24, 27 CloseDriverLINX 35 Command Event 3132, 44, 50, 54 Configuration base address 2223 custom 22 DriverLINX Control Panel 8, 22, 36 interrupt channel 22, 24, 54
Index 63
direct hardware I/O 11 Direct Memory Access 24, 31 Distribution Disks 713, 34 DLCODES.BAS 34 dlcodes.h 34, 39 DLXOCX16.OCX 34 DLXOCX32.OCX 34 DMA 24, 31 DO 6, 14, 4546, 49, 5253, 5860 DOS 1112 DriverLINX AI 14 AO 14 CT 14 DEVICE 14, 3639 DI 14, 40, 4546, 5152, 54, 5759 DO 6, 14, 4546, 49, 5253, 5860 hardware model 713 Interfacing 29, 33 Logical Channels 1415, 1820, 2427, 3233, 40, 56 Logical Device 1315, 2223, 29, 36, 38, 40, 42, 44, 47, 50, 53 Logical Device Descriptor 1315, 31 Logical Subsystems 14, 16 Opening 29, 35 programming model 714 Serivce Requests 13, 15, 2931, 37, 39 DriverLINX 4.0 Installation and Configuration Guide 7, 22 DriverLINX Control Panel 8, 22, 36 Device Property Page 23 Digital Input Property Page 24, 27 Digital Output Property Page 27 DriverLINX Distribution Disks 13, 34 DriverLINX Technical Reference Manual 713, 1516, 3031, 42 drvlinx.h 30, 34, 39 DrvLNX16.DLL 34 DrvLNX32.DLL 34 DRVLNXVB.BAS 34 DRVLNXVBX.VBX 34 Dynamic port configuration 29
Types for digital I/O 31 Events Group 15, 44, 47, 50, 54
F
Functions CloseDriverLINX 35 ConfigDevice 37 DetectPortConfig 41 InitDevice 39 InitDigitalInput 40 InitDIOPort 43 OpenDriverLINX 35 ReadChannel 41, 4546 ReadChannelBuff 5152 ReadChannelBuffBkg 57, 59 SelectDriverLINX 35 WriteBits 49 WriteChanBuf 5253 WriteChannel 41, 4546 WriteChannelBuffBkg 5860
G
Group A 17, 25 Group B 17, 25
H
hardware I/O direct 11 hardware model 713 hardware testing algorithms 23 HINSTANCE 35
I
I/O address 13, 2223 base 2223 I/O addresses 17 I/O hardware calibration 24 description 17 detecting 23, 41 initialization 24 I/O instructions 11, 20, 33 I/O transfer asynchronous 30 background 30, 53 block 29, 49 buffered 30 masked I/O 29, 46 masked single value 29 overlapped 30, 53 single value 29, 33, 43
E
Edit Service Request Dialog Box 15, 30 Event Digital 32 Events Command 3132, 44, 50, 54 Digital Setup 28, 32, 42 None 3132, 44, 47, 50 Rate 32, 54 Terminal count 3132, 44, 47, 50, 54
64 Index
starting and stopping 5455 synchronous 3031 timed or paced 33 untimed 33 I/O transfers 20, 33 block 20 buffered 20 interrupt 20 single value 20, 44, 48 Implementation notes 20 Initialize 25, 27 Initialize digital output ports 24, 27 Intel 8255 1719, 2326, 42 Group A 17, 25 Group B 17, 25 Operational modes 17, 25 Port A 17 Port B 17 Port C 17, 26, 54 Reconfiguring 42 Intel 8255A Programmable Peripheral Interface 17 Interface C/C++ 16, 34 Control 16 Interfacing to DriverLINX 29, 33 Interrupt 24, 31, 32 interrupt channel 22, 24, 54 Interrupt I/O 30, 53 ioValue property 4446, 4849 ISA 23
Properties 18, 24 Logical Device 1315, 2223, 29, 36, 38, 40, 42, 44, 47, 50, 53 configuration 8, 22, 36 configuring 29 connecting 29 initialization 24, 27, 2931, 37 Initializing 29, 37 Logical Device Descriptor 1315, 31 LDD 15 Logical Driver Connecting 29, 35 Logical Subsystem AI 14 AO 14 CT 14 DEVICE 14, 3639 DI 14, 40, 4546, 5152, 54, 5759 DO 6, 14, 4546, 49, 5253, 5860 initialization 39 Initializing 29, 39 Logical Subsystems 14, 16 LPServiceRequest 37, 3941, 43, 45, 49, 5152, 5758
M
Mapping Logical Channels 18 Masked I/O transfer 29, 46 Masked, single value I/O 29 Method Refresh 16 MetraByte DASCard-PIO12 26 PDISO-8 1819 PIO-12 18, 25 PIO-24 18, 26 PIO-32IN 1819 PIO-32IO 1819 PIO-32OUT 1819 PIO-96 18, 26 PIO-HV 1819 PIO-SSR-120 1819, 26 PIO-SSR-24 18, 26 PIO-SSR-48 18, 26 REL-16 1819 Mode 31, 32, 36, 38, 40, 41, 44, 47, 50, 53 Model 1314, 23, 25 multiple processes 37 multitasking 712
K
Kernel Mode 24, 27 KMBPIO.BAS 34 kmbpio.h 34
L
LDD 15 library files 34 License software 5 Logical Channel block I/O 29, 49 Determining configuration 30, 40 Dynamic configuration 25, 28, 29, 30, 41 masked I/O 29, 46 Reading or writing 29, 33, 43 reconfiguring 42 Logical Channel addressing 1920, 43, 56 notes 20 Logical Channels 1415, 1820, 2427, 3233, 40, 56 Combining or splitting 19 Mapping to hardware channels 18
N
Native 20, 33, 44, 47, 50, 5556 nibble 20, 2526 None Event 3132, 44, 47, 50
Index 65
O
Object Linking and Embedding 16, 34 OCX 16, 30, 3435 ActiveX 16, 2930, 34 OLE 16, 34 ActiveX 16, 2930, 34 OLE Custom Control 16, 30, 3435 Open DriverLINX dialog 35 OpenDriverLINX 35 Operation 31, 36, 38, 40, 41, 44, 47, 50, 5354 operational modes 17 Overlapped I/O 30, 53
P
PDISO-8 1819 PIO-12 18, 25 PIO-24 18, 26 PIO-32IN 1819 PIO-32IO 1819 PIO-32OUT 1819 PIO-96 18, 26 PIO-HV 1819 PIO-SSR-120 1819, 26 PIO-SSR-24 18, 26 PIO-SSR-48 18, 26 Port A 17 Port B 17 Port C 17, 26, 54 process 28, 37, 39 programming model 714 Properties of Logical Channels 18, 24 Property ioValue 4446, 4849 Req_DLL_name 3536
SelectDriverLINX 35 Service Request Common properties 30 Edit dialog box 15, 30 Events 31 Events Group 15, 36, 38, 39, 44, 47, 50, 53, 54 Mode 31, 32, 36, 38, 40, 41, 44, 47, 50, 53 Operation 31, 36, 38, 40, 41, 44, 47, 50, 5354 Results Group 15, 44, 48 Select Group 15, 44, 47, 50, 5556 Specifying data buffers 33 Specifying I/O channels 32 Start Events 3132, 44, 47, 50, 5455 Stop Events 3132, 44, 47, 50, 5455 Subsystem 1516, 23, 2930, 36, 3840, 41, 44, 47, 50, 53 Timing Events 3132, 44, 47, 50, 54 Service Requests 13, 15, 2931, 37, 39 Setup 23, 2426, 28, 32, 42, 44, 4647, 4950, 5259 Sharing hardware 37 Single value I/O 29 single-value transfers 20, 44, 48 Software License 5 Splitting Logical Channels 19 Start Event 3132, 44, 47, 50, 5455 Stop 3132, 44, 47, 50, 5455 Stop Event 3132, 44, 47, 50, 5455 Subsystem 1516, 23, 2930, 36, 3840, 41, 44, 47, 50, 53 Subsystem initialization 39 synchronous 3031
T
Terminal count Event 3132, 44, 47, 50, 54 threads 11, 15, 46 Timing Events 3132, 44, 47, 50, 54
V R
Rate Event 32, 54 Refresh method 16 REL-16 1819 Req_DLL_name property 3536 Request Group 15, 36, 38, 39, 44, 47, 50, 53 resource arbitration 12 resource sharing 11 Results Group 15, 44, 48 Value 27, 4346, 4346, 4346, 49 VBX 16, 29, 3335 Visual Basic 11, 16, 29, 33, 37, 3941, 43, 45, 49, 52, 59 VBX 16, 29, 3335
W
Web site 34 Win 3.x 11, 13, 34 Win 95 11, 13, 34 Win NT 1113, 34 administrative account 22 security 12, 22 Win32 11, 33
S
Scientific Software Tools 56 security 12, 22 Select Group 15, 44, 47, 50, 5556
66 Index
Index 67