AMPDIO DRIVERS AMPDIO DRIVERS DIGITAL/ANALOGUE INPUT/OUTPUT WINDOWS APPLICATION INTERFACE This Instruction Manual is supplied with the AMPDIO drivers to provide the user with sufficient information to utilise the purchased product in a proper and efficient manner. The information contained has been reviewed and is believed to be accurate and reliable, however MEV Limited and Amplicon Liveline Limited accept no responsibility for any problems caused by errors or omissions.
AMPDIO DRIVERS
AMPDIO DRIVERS WINDOWS Analogue and Digital IO Driver Software TABLE OF CONTENTS 1 INTRODUCTION ................................................................................................................................ 11 1.1 Windows AMPDIO Drivers.............................................................................................................. 11 1.2 Products supported........................................................................................................................
AMPDIO DRIVERS 3.3 Basic Analogue I/O Functions......................................................................................................... 36 3.3.1 Determining Analogue Resources............................................................................................... 36 3.3.2 Channel Masks............................................................................................................................ 36 3.3.3 Channel Groups .....................................................
AMPDIO DRIVERS 5.2 Register Grouping........................................................................................................................... 62 5.2.1 Cluster X, Y and Z Groups .......................................................................................................... 62 5.2.2 Counter Connection Register Group........................................................................................... 62 5.2.3 Interrupts Group ..................................................
AMPDIO DRIVERS 6.4.3.2 6.4.3.3 6.4.3.4 6.4.4 6.4.4.1 6.4.4.2 6.4.4.3 6.4.4.4 6.4.4.5 6.4.4.6 6.4.4.7 6.4.4.8 6.4.4.9 6.4.4.10 6.4.4.11 6.4.4.12 6.4.4.13 6.4.4.14 6.4.5 6.4.5.1 6.4.5.2 6.4.5.3 6.4.5.4 6.4.5.5 6.4.5.6 6.4.5.7 6.4.5.8 6.4.5.9 6.4.5.10 6.4.5.11 6.4.5.12 6.4.5.13 6.4.5.14 6.4.5.15 6.4.5.16 6.4.5.17 6.4.6 6.4.6.1 6.4.6.2 6.4.6.3 6.4.6.4 6.4.7 6.4.7.1 6.4.7.2 6.4.7.3 6.4.7.4 6.4.7.5 6.4.7.6 6.4.7.7 6.4.7.8 6.4.7.9 6.4.7.10 6.4.7.11 6.4.8 6.4.8.1 6.4.8.2 6.4.8.3 6.4.8.4 6.4.8.
AMPDIO DRIVERS 6.4.8.6 6.4.8.7 6.4.8.8 6.4.8.9 6.4.8.10 6.4.8.11 6.4.8.12 6.4.8.13 6.4.8.14 6.4.8.15 6.4.8.16 6.4.8.17 6.4.8.18 6.4.8.19 6.4.8.20 6.4.8.21 6.4.8.22 6.4.8.23 6.4.8.24 6.4.8.25 6.4.8.26 6.4.8.27 6.4.8.28 6.4.8.29 6.4.8.30 6.4.8.31 6.4.8.32 6.4.8.33 6.4.8.34 6.4.8.35 6.4.8.36 6.4.9 6.4.9.1 6.4.9.2 6.4.9.3 6.4.9.4 6.4.9.5 6.4.10 6.4.10.1 6.4.10.2 6.4.10.3 6.4.10.4 6.4.10.5 6.4.11 Generate a Pulse — TCgeneratePulse .................................................................................
AMPDIO DRIVERS 6.4.11.1 Test if Digital I/O Chip is Free — DIOisAvailable................................................................... 172 6.4.11.2 Configure a Digital I/O Port for Input or Output — DIOsetMode............................................ 172 6.4.11.3 Check Digital I/O Port Direction — DIOgetMode ................................................................... 173 6.4.11.4 Re-define Channel Width within a Digital I/O Chip — DIOsetChanWidth.............................. 174 6.4.11.
AMPDIO DRIVERS 6.4.18 Analogue I/O Configuration ....................................................................................................... 212 6.4.18.1 Query ADC Software Bipolar/Unipolar Settings — AIOgetADCchanMode ........................... 212 6.4.18.2 Query ADC Hardware Bipolar/Unipolar Settings — AIOgetHWADCchanMode.................... 212 6.4.18.3 Configure ADC Software Bipolar/Unipolar Settings — AIOsetADCchanMode...................... 213 6.4.18.
AMPDIO DRIVERS
AMPDIO DRIVERS 1 1.1 INTRODUCTION Windows AMPDIO Drivers The Windows AMPDIO Drivers are Windows software drivers that support a range of Amplicon digital and analogue data acquisition cards. They consist of kernel level drivers, a comprehensive application level Windows Dynamic link library (DLL) interface and example software. The software can handle most analogue and digital signal types.
AMPDIO DRIVERS 1.2.1 PC200 Series The 200 Series cards are a range of ISA Bus PC Digital IO / Counter Timer expansion cards. The 200 Series digital input/output products may be configured in a variety of ways to provide flexible, expansible systems. Several digital input/output boards with timer/counter facilities are offered. These boards are complemented by four external panels for signal conditioning and user connection through individual terminals.
AMPDIO DRIVERS 1.2.2.1 Analogue Output Cards Product Number 1.2.2.
AMPDIO DRIVERS The PCI230+ is an enhanced version of the PCI230, with 16-bit ADC, start acquisition control and extra timer/counter gate controls. It is backwards compatible with the old card except that the maximum ADC sample rate has been reduced from 312500 to 250000 samples per second. 1.3 1.3.1 Features of the Software Overview The software consists of low-level Windows kernel drivers, a Windows Dynamic Link Library (DLL) and a suite of example software. The Windows Dynamic Link Library (DIO_TC.
AMPDIO DRIVERS 1.4 Windows Installation Program The software is installed onto the user's hard disk by a Windows installation program. See section 2 of this manual for information on getting started. 1.5 Technical Support Should this product appear defective, please check the information in this manual and any 'Help' or 'READ.ME' files appropriate to the program in use to ensure that the product is being correctly applied.
AMPDIO DRIVERS 2 2.1 GETTING STARTED General Information The installed software package contains a number of ready-to-run Windows 32-bit executable programs. These programs allow the user to perform I/O operations on the target card immediately after installing the board and software onto a PC. 2.2 Installing the Software 2.2.1 Software Installation from CD-ROM To install the AMPDIO driver software from CD-ROM you will first need to decompress it on to your hard disk.
AMPDIO DRIVERS 2.3.1.1 PCI Card For a PCI card, Windows will detect the new hardware automatically and attempt to install the drivers without user interraction. Unless the AMPDIO drivers have been previously installed (or pre-installed as a Windows driver package), this is likely to install the device as a non-working device of type ‘PCI Data Acquisition and Signal Processing Controller’ in the ‘Other devices’ section of Windows Device Manager.
AMPDIO DRIVERS 1. Run the ‘Add Hardware Wizard’ by clicking the START button, typing ‘hdwwiz.exe’ into the search box and pressing the ‘Enter’ key. 2. On the ‘Welcome to the Add Hardware Wizard’ page, click ‘Next’ to continue. 3. On the ‘Add Hardware page’, to the question ‘What do you want the wizard to do?’, select the option ‘Install the hardware that I manually select from a list (Advanced)’, then click ‘Next’. 4. Windows shows a list of hardware categories.
AMPDIO DRIVERS (e.g. 5 or 10). The IRQ will have to be reserved for use by legacy devices in the PC BIOS settings. Note that the entered resource settings will conflict with the PCI bus initially. Windows will pop-up a ‘Conflict Warning’ dialog box. On this dialog, click ‘Yes’ to keep the new resource setting. Repeat for the other resources you wish to change. 14. When you are happy with the new resource settings, click ‘OK’, then ‘Finish’. 15.
AMPDIO DRIVERS 5. On the page that says ‘Windows couldn't find driver software for your device’, click the ‘Browse my computer for driver software (advanced)’ option. 6. On the page that says ‘Browse for driver software in this location’, click the ‘Browse...’ button and browse to the AMPDIO software installation directory on the hard disk. Then click the ‘Next’ button. 7. On the ‘Windows Security’ dialog, to the question ‘Would you like to install this device software?’ click the ‘Install’ button. 8.
AMPDIO DRIVERS install your hardware’ click ‘Next’. 10. On the ‘Windows Security’ dialog, to the question ‘Would you like to install this device software?’ click the ‘Install’ button. 11. Windows should install the driver and reach the ‘Completing the Add Hardware Wizard’ page. On this page, click the link labelled ‘View or change resources for this hardware (Advanced)’ to open the ‘Add Hardware Properties’ page. 12.
AMPDIO DRIVERS are just dummy entries. For versions prior to 4.30 the supported PCI cards will appear as unknown devices under Device Manager. For AMPDIO software versions 4.32 and later a ‘Plug and Play’ Windows 2000 / Windows XP driver is used. This section describes how to install a card to use this Plug and Play driver under Windows XP. 2.3.3.1 PCI Card For a PCI card, Windows will detect the new hardware automatically and attempt to install the drivers.
AMPDIO DRIVERS 4. Windows will search for Plug and Play hardware. Assuming it finds none, Windows will ask ‘Is the hardware connected?’. Select the option ‘Yes, I have already connected the hardware’ and press ‘Next’. 5. Windows will show a list of hardware already installed on your computer. Scroll to the end of the list and select the bottom entry, ‘Add a new hardware device’. Press ‘Next’. 6.
AMPDIO DRIVERS 16. When you are happy with the new resource settings, press ‘OK’, then ‘Finish’, then on the popup dialog press ‘Yes’ to allow Windows to reboot. 2.3.4 Installing a card in Windows 2000 For versions of the AMPDIO software prior to 4.32, please follow the instructions for installing a card in Windows NT 4.0 (see section 2.3.5). For versions 4.30 and 4.31, the supplied AMPDIOV4.INF file will allow the supported PCI cards to appear under Device Manager, but these are just dummy entries.
AMPDIO DRIVERS 1. Go to the Control Panel by pressing START > Settings > Control Panel. 2. Double click on the ‘Add/Remove Hardware’ icon. Press ‘Next’. 3. Select ‘Add/Troubleshoot a device’. Press ‘Next’. 4. Windows will search for Plug and Play hardware. Assuming it finds none, it will present a list of installed devices. Select ‘Add a new device’. Press ‘Next’. 5. To the question ‘Do you want Windows to search for your new hardware?’ select ‘No’ then press ‘Next’. 6.
AMPDIO DRIVERS 2.3.5 Installing a card in Windows NT 4.0 2.3.5.1 PCI Card Note: the driver will automatically detect and install PCI ADIO cards to a spare DIO port name in the range DIO0 to DIO255. The ‘Amplicon DIO’ control panel applet may be used to display the settings for these cards and may be used to configure a card not to use interrupts. The DIO port names of PCI cards that have been removed are remembered. The DIO port name will be restored if the PCI card is reinstalled.
AMPDIO DRIVERS 2.3.6.2 ISA Card To install an ISA ADIO card in Windows 95, 98 or ME do the following: 1. Go to the Control Panel by pressing START > Settings > Control Panel. 2. Double click on the ‘Add New Hardware’ icon. Then press ‘Next’. 3. To the question ‘Do you want Windows to search for your new hardware?’ select ‘No’ then press ‘Next’. 4. Select ‘Amplicon Analogue Digital IO Counter Timer Cards’ if it exists, otherwise select ‘Other’. Press ‘Next’. 5.
AMPDIO DRIVERS 2.3.7 Installing Multiple Boards in a Single Host PC More than one ADIO board may be installed in a single host PC. Furthermore, any combination of boards supported by the driver may be installed in a single host PC. Subject to the number of physical slots and resources, the maximum number of boards supported by the driver is 256. 1. To install more than one board in the host PC, the following points should be checked: 2. Sufficient space is available to mount the required number of boards.
AMPDIO DRIVERS 3 DRIVER FUNCTIONS AND CONCEPTS This chapter describes the functions and concepts of the AMPDIO driver and library. Details of the underlying register structures and software are given in chapters 4 and 5 respectively. Reference should also be made to chapter 2. The driver is shipped with a Windows dynamic link library (DIO_TC.DLL) written in C and example programs written in a number of different Windows visual programming languages.
AMPDIO DRIVERS any other application. Provision is also made by TCsetDiffCounters to specify the clock and gate connections for both timer/counters. The functions TCgetDiffCount and TCgetRatio can be called at any time after TCsetDiffCounters, and these two functions latch and read the current count values of the timer/counters, using the read-back command, and return the difference and ratio of the two count values respectively.
AMPDIO DRIVERS clock selections must be made by hand, and therefore a discussion of the calculations involved are necessary to obtain the correct input clock source jumper selections. MARK SPACE tM tS 1 / freq tM = msratio / freq where msratio = mark to space ratio freq = output frequency (Hz) tM = mark time (seconds). The CDR for the 'mark' timer/counter, cdrM, is defined as cdrM = tM x fClkM where fClkM = 'mark' timer's input clock frequency.
AMPDIO DRIVERS Also a low-to-high transition on the gate input causes the initial count value to be re-latched into the counting element. Two functions TCgetExtFreq and TCgetExtPeriod (see sections 6.4.9.1 and 6.4.9.2) are used to program a timer/counter to provide a one-shot gate pulse of precise duration to a second timer/counter. The second timer/counter has an external signal as its clock input. When the gate pulse is over, the second timer/counter's counting stops, and its value is then read.
AMPDIO DRIVERS 3.1.8 Pulse Train Generation By connecting the gate input of a frequency generator to the inverted output of another timer/counter channel, it is possible to generate a fixed number of negative-going pulses within a fixed period of time. These pulses will be narrow pulses if mode 2 is used for the frequency generator channel (the ‘pulse’ channel), or square if mode 3 is used.
AMPDIO DRIVERS The specified timer/counter channel is set to mode 2 with an initial count of 65536 and divides the event clock. The output is fed to the input of another timer/counter channel offset by +1 from the specified channel. This second channel is set to mode 0 with an initial count of 65536. The initial count of the second channel is loaded by toggling the mode of the first channel. The initial count of the first channel is loaded on the first event clock pulse.
AMPDIO DRIVERS There are also lower level functions available. These functions were first implemented in version 2.0x of the library. They allow direct programming of the 82C55 ports without using the channel concept and allow modes 1 and 2 to be selected. The extra functions are DIOsetModeEx, DIOgetModeEx, DIOgetDataEx and DIOsetDataEx (see sections 6.4.11.7, 6.4.11.8, 6.4.11.9 and 6.4.11.10). With these functions, the supplied value is written directly to the associated 82C55 device.
AMPDIO DRIVERS Function DIOsetSwitchMatrix allows you to set up the matrix, specifying the matrix order. For the PC214E, this can be 12 X 12 or 24 X 24 switches. The function also registers the PPIs used as being 'in use' and unavailable for use by other programs. Function DIOgetSwitchStatus returns the status of a given switch in the matrix, and function DIOfreeSwitchMatrix frees the PPIs so they can be used by other programs when the switch matrix is no longer required. 3.
AMPDIO DRIVERS Cooked data to be written to a DAC channel is uncooked in a card-specific way by the driver before being output to the DAC. Raw data read from an ADC channel by the driver is cooked in a card-specific way before being passed to the user. The cooking or uncooking of data depends on the mode the channel is in, either unipolar or bipolar.
AMPDIO DRIVERS This function accepts an array of values as its data. The number of values supplied depends on the number of channels enabled in the channel mask. For example, if the channel mask is set to 5 (1012), then an array of two values is required where: 3.3.7 Array element [0] is the data for channel 0. Array element [1] is the data for channel 2.
AMPDIO DRIVERS In order to determine whether any events have occurred, use the getLongIntItem function (see section 6.4.4.14). This returns the index of the current interrupt item in the supplied buffer. The Item can then be read using the readLongBuf function (see section 6.4.4.6). When finished, the TCfreeEventRecorder function (see section 6.4.7.5) frees up the resources used so they can be used again by another service. This does not free the stopwatch or buffer. 3.4.
AMPDIO DRIVERS Each Amplicon card has up to 6 individual sources that can cause an interrupt to occur (some have fewer than 6 interrupt sources). The ADIO library allows a user supplied function to be called when a particular interrupt event occurs, such as a timer interrupt or a certain PPI port pin going high. Once the user function has been set up, the enableInterrupts and disableInterrupts functions (see sections 6.4.2.1 and 6.4.2.
AMPDIO DRIVERS TCenableUserInterrupt Like TCenableInterruptChip except that the user interrupt trigger source is determined from a handle returned by one of the user interrupt set-up functions. TCdisableUserInterrupt Like TCdisableInterruptChip except that the user interrupt trigger source is determined from a handle returned by one of the user interrupt set-up functions.
AMPDIO DRIVERS associated with callback. This means that by asking the driver for data you can be sure that the data is sampled soon after the event that caused the interrupt. The driver supports the following data requests: Page 42 ISR_NODATA = –1 Reads value 0 from a null source. ISR_READ_16COUNT = 0 Reads a specified 16-bit counter (Chip1, Chan1). ISR_READ_16COUNTSTAT = 16 Reads status and count from a specified 16-bit counter (Chip1, Chan1). Bits 23 to 16 contain the status.
AMPDIO DRIVERS three data values on each interrupt. Ports A, B and C from the first PPI chip (PPIX) are formed into the first data value. Ports A, B and C from the second PPI chip (PPIY) are formed into the second data value. Ports A, B and C from the third PPI chip (PPIZ) are formed into the third data value. Page 43 ISR_READ_PPIC = 6 Reads port C of the interrupting PPI chip. ISR_PC27 = 7 Reads the raw analogue data from the PC27’s ADC chip. Not recommended.
AMPDIO DRIVERS ISR_WRITE_PPIABC = 34 Writes PPI ports A, B and C (Chip1, [Chan1=0]). The low 8 bits are written to port A, the next 8 bits to port B, and the next 8 to port C. ISR_WRITE_2PPIABC = 41 Like ISR_WRITE_PPIABC but writes to ports A, B and C of two specified PPI chips (Chip1, Chip2) on each interrupt. Consumes two data values on each interrupt. The first data value is written to ports A, B and C of the first specified PPI chip.
AMPDIO DRIVERS PCI224, PCI234 PCI230 PCI260 1 2 EXT0=0, DAC2=8, Z2=20 PPIXC0=0, PPIXC3=4, ADC2=8, SATRIG=121, DAC4=162, Z2=20 0, 4, ADC2=8, Z2=20 (0 and 4 are non-functional) Yes Yes Yes SATRIG is supported on PCI230+ and PCI260+. DAC4 is supported on PCI230+ hardware version 2.
AMPDIO DRIVERS read and any additional parameters required to specify the source of the data to be read (see table of data request types in section 3.4.3). These functions are currently only supported by the C/C++ and Delphi bindings supplied with the driver. For Visual Basic, the non-callback functions described in section 3.4.3.3 may be used instead.
AMPDIO DRIVERS source, the type of data transfer required and any other parameters required to specify where the data is to be read from or written to (see table of data request types in section 3.4.3).
AMPDIO DRIVERS , PULONG pBuffer ); The wParam parameter is the user parameter specified in the interrupt set-up function call. It can be any user value, a pointer to a user’s data structure, a user code etc. The sizeofBuffer parameter is the length of the buffer being passed to the function. This is generally the buffer length passed to the interrupt set-up function. It is possible for sizeofBuffer to be 0 if an error has occurred. The pBuffer parameter points to the buffer in memory.
AMPDIO DRIVERS across equal periods of time, i.e. the time between sampling the first channel and the next channel is the same as the time between sampling the last channel and the first channel of the next cycle. For some applications it is desirable to read all the desired channels in a short period, then have a long gap before starting the next reading cycle. On the PCI230 and PCI260, this may be accomplished by using the periodic pulse train generation functions introduced in version 4.
AMPDIO DRIVERS occurring at the start of every buffer. It is recommended that the hardware fix is applied to avoid the problem altogether. 3.4.3.2.1.2 Controlling Start of Aquisition on PCI230+ and PCI260+ For the new PCI230+ and PCI260+ cards, it is possible to delay the start of acquisition until a programmable start acquisition trigger occurs. Alternatively, data can be acquired as normal while keeping a count of the number of samples stored until the start acquisition trigger occurs.
AMPDIO DRIVERS The function AIOgetADCpretriggerCount (see section 6.4.19.6) can be used to determine whether the start acquisition trigger has occurred. When the start acquisition type is set to ‘START_NOW’ it also indicates the number of samples that were acquired before the trigger occurred (a pre-trigger count). For the original PCI230 and PCI260 and other supported ADC cards, the only supported start acquisition trigger source is ‘TRIG_NOW’ and the only supported start type is ‘START_NOW’.
AMPDIO DRIVERS 6.4.15.5) has been available, which allows the caller to tell whether or not TCdriveNCBufferUserInterrupt would block. The TCwaitNCBufferReady function has a timeout parameter that allows it to wait until either a specified maximum number of milliseconds have elapsed (rounded up to a number of system clock ticks), or it is known that TCdriveNCBufferUserInterrupt may be called without blocking. The return value indicates which of these conditions is the case.
AMPDIO DRIVERS 4 4.1 SOFTWARE INSTALLED WITH THE DRIVER Installed Software The self-extracting executable installs the following software into the target directory. SubDirectory \DIO_CODE \EX_VB \EX_DELPH \EX_VEE \EX_C \EX_VBNET \EX_C# \SYS_DLLs Source code and documentation for DIO_TC.DLL API library. Visual Basic examples (VB 5.0 onwards) Delphi examples (Delphi 3.0 onwards) Agilent Vee Pro / Hewlett Packard HP VEE examples Win32 console examples in C Visual Basic .NET examples Visual C# .
AMPDIO DRIVERS It allows the available timer resources to be programmed in a variety of modes (rate, single shot etc.) and frequencies. It does not use interrupts. 4.2.3 Frequency Multiplier — FREQMULT.EXE The “Frequency Multiplier” example demonstrates using the TCmultiplyFreq function on Series 200 Digital IO Cards. It runs on the PC212E, PC214E, PC215E, PC218E and PCI215 digital counter timer cards.
AMPDIO DRIVERS 4.2.7 D-to-A Converter — DACSET.EXE The “DACSet” example uses a slider to write values to a DAC channel. It allows the jumper settings in use to be set and the channel to be chosen and displays the numeric values written to the driver and the real value of the output in volts or milliamps. It may be of use for calibration of the DACs. It runs on the PC24E/PC25E, PC30AT, PCI224, PCI230 and PCI234. It requires Visual Basic 5.0 SP2 or higher. It does not use interrupts. 4.2.
AMPDIO DRIVERS It does not use interrupts. 4.3.2 Digital IO — INOUT.EXE The “IN OUT” example demonstrates basic Digital IO using the 82C55 peripheral port interface. It runs on all supported Amplicon cards that have PPI resources, PC212E, PC214E, PC215E, PC263, PC272E, PC30AT, PC36AT, PC36LP, PCI215, PCI230, PCI236, PCI263 and PCI272. It allows the user to select PPI ports as inputs or outputs, set outputs high or low and monitor their actual state. It is equivalent to the Visual Basic “INOUT” example.
AMPDIO DRIVERS jumpers correctly. It requires that the cards be installed with interrupts. 4.4 Agilent VEE Pro / Hewlett Packard HP VEE Examples The sub directory EX_VEE contains the VEE examples written in VEE 4.0 and VEE 5.0. It also contains “dio_vee.h” the header file that allows DIO_TC.DLL to be imported into VEE and “dio_tc_lib.vee” which contains a number of VEE helper functions. 4.4.1 ADC Test — ADCTEST.VEE The ADC test example implements a simple oscilloscope in VEE.
AMPDIO DRIVERS ..\DIO_CODE\x64 for the “x64” build. If things are moved around, then the project settings need to be adjusted accordingly (in which case it is probably easiest to copy the adioctl.h, dio_tc.h and dio_tc.lib into the same directory as the rest of the application files). For later versions of Microsoft Visual C++, the project files can be automatically converted to use the new version when they are opened.
AMPDIO DRIVERS 4.6 Visual Basic .NET Examples The subdirectory EX_VBNET contains executables and source code for example programs written in Microsoft Visual Basic .NET. In order to run the examples the Microsoft .NET Framework version 1.1 or later is required. If not already installed, a suitable version may be downloaded using the Windows Update service or the Microsoft Download Center. The project files (*.vbproj) have been created with Microsoft Visual Studio .NET 2003.
AMPDIO DRIVERS The project files (*.csproj) have been created with Microsoft Visual Studio .NET 2003. If a later version of Visual Studio is used, including the free “Express” edition of Visual C#, the project files can be automatically converted to use the later version when they are opened. For developers, the Visual C# .NET bindings for DIO_TC.DLL are in the Dioc_tc_h.CS file. 4.7.1 Digital IO — InOut_CSHARP.
AMPDIO DRIVERS The DIO_TC.vcproj file can also be used to build DIO_TC.DLL using the free Microsoft Visual C++ 2005 “Express” edition, but it will also be necessary to obtain and install “Microsoft Platform SDK” and configure the directories in the “Projects and Solutions” section in the “Options” dialog in Visual C++ Express.
AMPDIO DRIVERS 5 STRUCTURE AND ASSIGNMENTS OF THE REGISTERS In order to gain the maximum out of the ADIO driver it is useful to have an appreciation of the underlying register locations. The driver was originally developed for the series 200 DIO cards and the register structure used on those cards forms the fundamental basis of the driver architecture. 5.1 Register Assignments on Series 200 DIO Cards The series 200 registers occupy 32 consecutive address locations in the I/O space.
AMPDIO DRIVERS Each CT or PPI I/O block contains 4 ports, 3 data ports and a control port. When writing to data registers, the port number can be set between 0 and 3. A PPI block is usually followed by an empty block. Up to six individually programmable interrupt sources can be assigned to the cards interrupt using the Interrupt Enable (IE) registers. The precise interrupts sources available are card specific and are detailed in the card’s manual.
AMPDIO DRIVERS The blocks marked ‘2 DACs’ consist of a pair of D-to-A converters. The blocks marked ‘DAC’ consist of a single D-to-A converter. The blocks marked ‘ADC’ consist of a multiplexed A-to-D converter. The version 4.
AMPDIO DRIVERS The version 4.31 (and above) driver also supports the following PCI card types: ADDRESS OFFSET IO Block PCI215 PCI236 PCI272 PCI263 0016 – 0316 0 (X1) PPI PPI PPI 16 relay 0416 – 0716 1 (X2) 0816 – 0B16 2 (Y1) 0C16 – 0F16 3 (Y2) 1016 – 1316 PPI PPI 4 (Z1) CT PPI 1416 – 1716 5 (Z2) CT 1816 – 1D16 6 CT Connect Unused 1E16 7 IE IE Unused Unused 1F16 The PCI215, PCI272 and PCI263 are the PCI equivalents of the PC215E and PC272E and PC263 respectively.
AMPDIO DRIVERS The PPI can be configured to operate in several modes. Further details may be found by reference to the device manufacturer’s 82C55 data sheets in the appendices on the SOFTMAN CD. The eight data bits of port A are data input, data output or bi-directional data I/O according to the PPI mode: Mode 0 Mode 1 Mode 2 Input or Output Input or Output Bi-directional Input/output BIT ASSIGNMENTS The bit layout of the PPI-X Port A data register is shown below. 7 5.4.1.
AMPDIO DRIVERS BIT ASSIGNMENTS The bit layout of the PPI-X port B data register is shown below. 7 5.4.1.3 6 5 4 3 2 1 0 PPI-X Port B Digital I/O Data Bits Digital I/O SK1 Pin Connections PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7 SK1 46 SK1 7 SK1 65 SK1 26 SK1 45 SK1 6 SK1 64 SK1 25 82C55 Programmable Peripheral Interface PPI Data Register Port C This eight-bit register writes to and reads from port C of the 82C55 Programmable Peripheral Interface PPI.
AMPDIO DRIVERS BIT ASSIGNMENTS The bit layout of the PPI-X port C data register is shown below. 7 6 5 4 3 2 1 0 PPI-X Port C Lower Nybble Data Bits PPI-X Port C Upper Nybble Data Bits PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 5.4.1.
AMPDIO DRIVERS Two I/O groups (Group A — also known as Group 0 or Group I) (Group B — also known as Group 1 or Group II) Both groups contain an 8 bit port and a 4 bit control/data port Both 8 bit data ports can be latched input or latched output Mode 2 provides strobed bi-directional operation using port A as the bi-directional data bus. Port C3 to C7 bits are used for interrupts and handshaking bus flow control similar to mode 1.
AMPDIO DRIVERS Command Word for Bit Set/Reset Format 7 6 5 4 3 2 1 0 X X X Don’t Care Bit Set/Reset 0 = Reset 1 = Set 0 = Bit Set/Reset Port C Bit Select 0 0 0 0 5.4.2 1 1 0 0 2 0 1 0 3 1 1 0 4 0 0 1 5 1 0 1 6 0 1 1 7 1 B0 1 B1 1 B2 82C54Counter Timer Registers The following paragraphs describe the operations of the 82C54 counter timer that is a common element on many of the supported cards. Each 82C54 has three counter timer channels.
AMPDIO DRIVERS Register Offset Write and/or Read Register Width Register Title Mnemonic 0016 Write and Read 8 bits 82C54 Counter/Timer Counter 0 Data Register CT0 FUNCTION The Counter 0 Data Register is used to write and read 8 bit data to the 82C54 counter/timer 0. The counter is normally configured for 16 bit operation and to ensure validity of the data it is important to always write/read two bytes to the register, least significant byte first.
AMPDIO DRIVERS This register is also used to read counter 1 status if the status has been latched using the ReadBack command (not supported on 82C53). The counter can be configured to operate in several modes. Further details may be found by reference to the device manufacturer's 82C54 (or 82C53) data sheets. BIT ASSIGNMENTS The bit layout of the counter 1 register is shown below. 7 5.4.2.
AMPDIO DRIVERS BIT ASSIGNMENTS The bit layout of the counter 2 register is shown below. 7 5.4.2.4 6 5 4 3 2 1 0 16 BIT COUNTER 2 DATA BIT First Byte (Least Significant) Second Byte (Most Significant) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Counter/Timer Control Register The control register provides the means to configure the three sixteen bit counter/timers of the 82C54.
AMPDIO DRIVERS Mode 4 Mode 5 Software Triggered Mode Hardware Triggered Strobe (Re-triggerable) BIT ASSIGNMENTS The bit layout of the counter timer control register is shown below. D7 SC1 D6 SC0 D5 RW1 D4 RW0 D3 M2 D2 M1 D1 M0 D0 BCD SC – Select Counter SC1 0 0 1 1 SC0 0 1 0 1 Select Counter 0 Select Counter 1 Select Counter 2 Read-Back Command (See Below) RW – Read/Write RW1 0 0 1 1 RW0 0 1 0 1 Counter Latch Command (See Below) Read/Write least significant byte only.
AMPDIO DRIVERS Read-Back Command D7 1 D5: D4 D3 D4 D5 D6 1 D5 /COUNT D4 /STATUS D3 CNT2 D2 CNT1 D1 CNT0 D0 0 0 = Latch count of selected Counter(s) 0 = Latch status of selected Counter(s) 1 = Select Counter 2 1 = Select Counter 1 1 = Select Counter 0 N.B. The Read-Back Command is not supported by the 82C53. Prior to AMPDIO v4.23, The driver uses the Read-Back Command to latch counters, so reading counters is not reliable on those cards which use the 82C53.
AMPDIO DRIVERS 5.4.3.1 Group Clock Connection Registers These registers can be used to select the counter/timer clock sources.
AMPDIO DRIVERS BIT ASSIGNMENTS Bit layout of each clock connection register is shown below. 7 5.4.3.
AMPDIO DRIVERS of Z1 channel 1, and the /OUT n–2 gate source for Z1 channel 0 comes from the output of Z2 channel 1. For the PCI230 and PCI230+, the Z2 counter/timer’s GAT inputs are connected internally to PPI-X C0, C1 and C2. For the PCI260+, all three counter/timer GAT inputs are connected internally to the external trigger input (SK1 pin 17). For the original PCI260, PCI224 and PCI234, the GAT input is not connected. BIT ASSIGNMENTS Bit layout of each gate connection register is shown below.
AMPDIO DRIVERS 6 6.1 PROGRAMMING WITH THE AMPDIO DRIVER Windows DLL and Examples The AMPDIO DIO_TC DLL is a Windows programmer's interface to the analogue and digital IO boards. As long as the compiler/interpreter supports Windows, i.e. uses the Windows calling conventions; all the functions can be called by software written in any language. The application interface to the driver is defined in a number of header files, for use by different languages. Module definition file DIO_TC.H and ADIOCTL.H DIO_TC.
AMPDIO DRIVERS or DIO_TC.vcproj is used to build the DLL using Microsoft Visual C/C++ DIO_TC.IDE is used for Borland C++. 6.3 Using the Dynamic Link Library 6.3.1 C/C++ Section 6.4 describes the library functions available. Please note that in C/C++, the function call examples given should always end with a semi-colon. Where arguments to functions are described as pointers, the address of a user-declared variable is required. This is easily done by using the '&' reference operator.
AMPDIO DRIVERS 4) Add the library newly generated file DIO_TC.LIB to project workspace. Note the DIO_TC.LIB supplied with the AMPDIO package is a Microsoft format library file and is incompatible with Borland compilers. 6.3.2 Visual Basic 5.0 and 6.0 The Visual Basic example projects can be opened from within Microsoft Visual Basic by choosing ‘File|Open Project…’ in the menu and selecting the appropriate .VBP project file within the EX_VB subdirectory of the AMPDIO software directory.
AMPDIO DRIVERS 8) The menu bar will now appear in the Form1 design window. Click on the 'Exit' item to bring up the code window for the mnuExit_Click() subroutine. At runtime, this routine will be called whenever the 'Exit' menu is selected. 9) Type the following lines into the mnuExit_Click() subroutine, to un-registers the board from the DLL as the program closes.
AMPDIO DRIVERS if hboard >= 0 then begin cardtype := GetBoardModel(hBoard); if cardType = then exit; FreeBoard(hBoard); end; hBoard := -1; inc(i); until (i >= 8); end; These lines of code will search through installed ADIO cards until the desired card type is found. The limit of 8 in the ‘until (i >= 8)’ condition may be increased to 256 if using DIO_TC.DLL version 4.40 or later.
AMPDIO DRIVERS Application’ in the ‘Templates’ box. Enter a name for the project and specify a location using the ‘Browse…’ button. Press the ‘OK’ button to continue. 2) Select ‘File|Add Existing Item’ from the menu and add DIO_TC.VB from the the EX_VBNET subdirectory of the AmpDIO software directory. 3) Close the Form1 design window and source code window (if present) and open the properties for the project, ‘Project| Properties’. Clear the ‘Root Namespace’ property to allow the DIO_TC.
AMPDIO DRIVERS that are not passed as pointers and the ‘ByRef’ prefix for function arguments that are passed as pointers. For example, function TCgetCount requires a pointer to a variable declared as long, into which the count value result will be placed. A typical VB.NET code example for displaying the Z1 Counter 0 count value would be as follows: Dim count As Integer i = TCgetCount(hBoard, Z1, 0, count)' count now contains new Text1.Text = Str(count) ' value 6.3.5 Visual C# .NET The Visual C# .
AMPDIO DRIVERS CardType = DIO_TC.GetBoardModel(hBoard); if (CardType = ) { break; // Exit loop as we // have valid card } else { // Free the unwanted card DIO_TC.FreeBoard(hBoard); } } hBoard = -1; // We don't have a suitable card // Try the Next card } 8) Go back to the form design window and press the F4 key to open the form’s properties window. On the form properties, select ‘Events’ (represented by a ‘lightning strike’ icon).
AMPDIO DRIVERS 6.4.1 Initialization Functions The board can not be registered with the library unless it has been correctly installed and configured in he system registry, using the configuration tool supplied (in the control panel). 6.4.1.1 Register a Board with the Library — registerBoard Requests a card matching a model number, base address and IRQ setting.
AMPDIO DRIVERS Prior Calls none See Also registerBoardEx registerBoardPci FreeBoard 6.4.1.2 Extended Register Board Function — registerBoardEx Requests use of a card at a specified slot number. This function returns a Board Handle greater than or equal to 0 on success. SUPPORTED IN VERSION 2.00 ONWARDS. i = registerBoardEx (CardNo); 6.4.1.3 where CardNo short: card ‘Slot Number’. The slot number can be determined by looking at the order cards are installed in the system. I.E.
AMPDIO DRIVERS PCI272 = 272 bus short: PCI bus number (usually 0). slot short: PCI slot number. Returns short: Board handle to be used in all subsequent function calls for that board. or ERRSUPPORT Prior Calls none See Also registerBoard registerBoardPci FreeBoard 6.4.1.4 Get the Model Number of a Board — GetBoardModel Returns the model number of a registered board. N.B.
AMPDIO DRIVERS GetBoardIRQ GetBoardPciPosition DIO_TC_hardwareVersion 6.4.1.5 Get Board Base Address — GetBoardBase Gets the base-address setting of a board as set in the registry. SUPPORTED IN VERSION 4.02 ONWARDS. i = GetBoardBase (h) where h Returns short: Base address. or 0 for invalid board handle Prior Calls registerBoardEx See Also GetBoardModel GetBoardIRQ GetBoardPciPosition 6.4.1.6 short: board handle as registerBoardEx function.
AMPDIO DRIVERS where h short: board handle as registerBoardEx function. pbus pointer to short: pointer to variable where PCI bus number result will be stored. pslot pointer to short: pointer to variable where PCI slot number result will be stored. Returns short: OK or ERRHANDLE ERRSUPPORT ERRDATA Prior Calls registerBoardEx See Also GetBoardModel GetBoardBase GetBoardIRQ 6.4.1.
AMPDIO DRIVERS Bits 31 to 24: Major version Bits 23 to 16: Minor version Bits 15 to 0: All zero. 6.4.1.10 Returns short: OK or ERRHANDLE ERRSUPPORT ERRDATA Prior Calls registerBoardEx See Also DIO_TC_dllVersion DIO_TC_hardwareVersion Get DLL Version — DIO_TC_dllVersion Gets value of the DIO_TC_VERSION macro in DIO_TC.H at the time the DLL was compiled. SUPPORTED IN VERSION 4.02 ONWARDS. i = DIO_TC_dllVersion () Returns short: (256*major)+minor e.g. 4.02 becomes ((4*256)+2) = 1026. 6.4.1.
AMPDIO DRIVERS least 1. For the older PCI230 and PCI260, the version is 0. Returns short: OK or ERRHANDLE ERRDATA Prior Calls registerBoardEx See Also DIO_TC_driverVersion DIO_TC_dllVersion DIO_TC_realHardwareVersion 6.4.1.12 Get Real Hardware Version — DIO_TC_realHardwareVersion Gets the real version number IOCTL_QUERY_REALHWVERSION. of the board from the driver using SUPPORTED IN VERSION 5.02 ONWARDS.
AMPDIO DRIVERS 6.4.1.13 Control Hardware Reinitialization — DIO_TC_SetResetOnRegister Controls whether or not the board registration functions reinitialize the hardware on the board being registered. By default, the board registration functions do reinitialize the hardware. SUPPORTED IN VERSION 4.40 ONWARDS.
AMPDIO DRIVERS 6.4.2 Prior Calls none See Also DIO_TC_SetResetOnRegister registerBoard registerBoardEx registerBoardPci Interrupt Control Functions 6.4.2.1 Enable a Board's Interrupts — enableInterrupts Enables the card’s interrupts to be processed by the driver. This enables interrupts at the first level.
AMPDIO DRIVERS getIntMask 6.4.2.3 Check whether a Board's Interrupts are Enabled — interruptsEnabledP Reports whether the card's interrupts are enabled or not at the first level. SUPPORTED IN VERSION 4.40 ONWARDS Interrupts are initially disabled at the first level. i = interruptsEnabledP (h) 6.4.2.4 where h short: board handle as registerBoardEx function.
AMPDIO DRIVERS manuals for a description of the interrupt sources, and their functionality. 6.4.2.5 Returns short: OK or ERRHANDLE ERRSUPPORT Prior Calls registerBoardEx See Also getIntMask TCenableInterruptChip TCdisableInterruptChip enableInterrupts disableInterrupts Check Which Interrupt Sources are Enabled — getIntMask Reports which interrupt sources are enabled at the second level. The return value is a bit mask. Interrupt sources that are enabled are not necessarily active.
AMPDIO DRIVERS or ERRHANDLE Prior Calls registerBoardEx See Also 6.4.2.7 Enable an Individual Interrupt Source — TCenableInterruptChip Enables an interrupt source at the second level if it is a valid interrupt source for the card. An interrupt source is active when it is enabled at the first level (enableInterrupts) and at the second level and has been set-up (TCsetEventRecorder, TCsetUserInterrupt, etc.). SUPPORTED IN VERSION 4.40 UPWARDS In versions of the DLL from version 4.
AMPDIO DRIVERS 6.4.2.8 Disable an Individual Interrupt Source — TCdisableInterruptChip Disables an interrupt source at the second level if it is a valid interrupt source for the card. If the interrupt source is active, it will be deactivated. SUPPORTED IN VERSION 4.40 UPWARDS In versions of the DLL from version 4.40 onwards, all valid interrupt sources are initially enabled at the second level. i = TCdisableInterruptChip (h, Chip) where h short: board handle as registerBoardEx function.
AMPDIO DRIVERS or FALSE on failure Prior Calls none See Also 6.4.3.2 Set Normal Priority — DIO_TC_restorenormalpriority Puts current process and thread back to normal priority. Prior to version 4.23, this was only done for Windows NT. For version 4.23 onwards it is also done for Windows 9x. i = DIO_TC_restorenormalpriority () Returns BOOLEAN: TRUE on success or FALSE on failure Prior Calls none See Also 6.4.3.
AMPDIO DRIVERS TCsetBufferUserInterrupt TCsetBufferUserInterruptAIO TCsetBufferUserInterrupt2 See Also 6.4.3.4 TCsetInterruptThreadPriority Set Priority of User Interrupt Thread — TCsetInterruptThreadPriority Sets the Win32 thread priority value used for the user interrupt callback thread. May be used even if the user interrupt thread is not currently running (e.g. has not been enabled).
AMPDIO DRIVERS See Also 6.4.4 TCgetInterruptThreadPriority enableInterrupts Data Buffer Functions 6.4.4.1 Allocate a Short Integer Data Buffer — allocateIntegerBuf Creates a data buffer, by allocating a block of memory of short integer (16-bit) data. The function returns a Buffer Handle (>= 0). The Buffer Handle must be used in any subsequent function calls to identify that particular data buffer. b = allocateIntegerBuf (nItems) where nItems Returns short: Buffer Handle (>= 0).
AMPDIO DRIVERS i = freeIntegerBuf (b) where b Returns short: OK or ERRBUFFER Prior Calls allocateIntegerBuf short: buffer handle as allocateIntegerBuf function. issued by the See Also 6.4.4.4 Free up a Long Integer Data Buffer — freeLongBuf Frees a block of memory previously allocated for the given data buffer by the allocateLongBuf function. i = freeLongBuf (b) where b Returns short: OK or ERRBUFFER Prior Calls allocateLongBuf short: buffer handle as allocateLongBuf function.
AMPDIO DRIVERS 6.4.4.6 Read Data from a Long Integer Buffer — readLongBuf Reads a data item from a long integer buffer, returning the item via a user-supplied pointer. The pointer must reference a long integer variable. i = readLongBuf (b, item, p) where b short: buffer handle, as issued by the allocateLongBuf function item long: index of the data item in the buffer. p pointer to long: points to a long integer variable to be used for the result.
AMPDIO DRIVERS data Returns short: OK or ERRBUFFER ERRRANGE ERRDATA Prior Calls allocateLongBuf long: data value. See Also 6.4.4.9 Copy a Block of Data to a Short Integer Buffer — copyToIntegerBuf Copies a block of short integer data to a short integer buffer. i = copyToIntegerBuf (b, start, nItems, p) where b short: buffer handle as allocateIntegerBuf function. start long: index of the starting item in the buffer. nItems long: number of items to copy.
AMPDIO DRIVERS ERRRANGE ERRDATA Prior Calls allocateLongBuf See Also 6.4.4.11 Copy a Block of Data from a Short Integer Buffer — copyFromIntegerBuf Copies a segment of a short integer data buffer to a block of memory. i = copyFromIntegerBuf (b, start, nItems, p) where b short: buffer handle as allocateIntegerBuf function. start long: index of the starting item in the buffer. nItems long: number of items to copy.
AMPDIO DRIVERS Prior Calls allocateLongBuf See Also 6.4.4.13 Query Current Interrupt Position within a Short Integer Data Buffer — getIntegerIntItem Gets the current interrupt position within a short integer data buffer. None of the currently supported interrupt functions in the library use short integer data buffers, so the returned position will be 0. i = getIntegerIntItem (b, pitem) where b short: buffer handle as allocateIntegerBuf function.
AMPDIO DRIVERS 6.4.5 Basic Timer/Counter Functions 6.4.5.1 Test if Timer/Counter is Free — TCisAvailable Checks if a particular timer/counter channel is currently available on a board. A counter/timer may not be available for one of two reasons: 1. the counter/timer is not provided by the board specified, or 2. the counter/timer is being used by some other function. i = TCisAvailable (h, chip, chan) where h short: board handle as previously issued by the registerBoardEx function.
AMPDIO DRIVERS Z1 = 16 Z2 = 20 chan Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx short: timer/counter channel number within the chip (0, 1 or 2). See Also 6.4.5.3 Connect Timer/Counter Clock Source — TCsetClock Configures a timer/counter clock input source. i = TCsetClock (h, chip, chan, clk) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the timer/counter chip.
AMPDIO DRIVERS See Also 6.4.5.4 TCgetClock TCgetLinkedClockChannel TCsetGate Get Connected Timer/Counter Clock Source — TCgetClock Gets a timer/counter channel’s currently connected clock source, if it has been configured. This is not supported on PC214E or other models that have no clock connection registers.
AMPDIO DRIVERS where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the timer/counter chip. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). pClkChip pointer to short: pointer to a short integer variable into which the address offset of the timer/counter chip containing the linked channel is to be stored.
AMPDIO DRIVERS Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). gate short: gate source (0 to 7). One of the following pre-defined constants may be used: GAT_VCC = 0: Enabled GAT_GND = 1: Disabled GAT_EXT = 2: GAT(chan) — external i/p GAT_OUTN_2 = 3: /OUT(chan–2) Note: for PCI230 and PCI230+, GAT(chan) input is PPI-X C(chan). For PCI260+, GAT(chan) is EXTTRIG. For the original PCI260, GAT(chan) is not connected.
AMPDIO DRIVERS registerBoardEx function. chip short: address offset of the timer/counter chip. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). pgate pointer to short: pointer to a short integer variable into which the current gate source is to be stored. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA ERRSUPPORT Prior Calls registerBoardEx See Also TCsetGate 6.4.5.
AMPDIO DRIVERS timer/counter chip containing channel is to be stored. pGatChan linked pointer to short: pointer to a short integer variable into which the channel number of the linked timer/counter channel is to be stored. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx See Also TCgetLinkedClockChannel TCsetGate 6.4.5.9 the Configure Timer/Counter Mode — TCsetMode Sets a timer counter to one of its six available modes of operation.
AMPDIO DRIVERS 6.4.5.10 Read Timer/Counter Status — TCgetStatus Returns the mode and status of a timer/counter by performing a read-back operation on the channel. This does not work on PC24E, PC25E, PC26AT, PC27E or PC30AT as they have the wrong sort of timer/counter chip. i = TCgetStatus (h, chip, chan) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the timer/counter chip.
AMPDIO DRIVERS chip short: address offset of the timer/counter chip. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). pmode pointer to short: pointer to a short integer variable into which the current counter mode is to be stored. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA ERRSUPPORT Prior Calls registerBoardEx See Also TCsetMode TCgetStatus 6.4.5.
AMPDIO DRIVERS ERRCHAN ERRDATA Prior Calls registerBoardEx TCsetMode See Also TCgetCount TCsetClock TCsetGate 6.4.5.13 Set two Timer Count Values — TCsetCounts Sends two 16-bit count values to two timer/counters. SUPPORTED IN VERSION 4.00 ONWARDS. i = TCsetCounts (h, chip1, chan1 count1, chip2, chan2, count2) where: h chip1 short: board handle as issued by the registerBoardEx function. short: address offset of the timer/counter chip #1.
AMPDIO DRIVERS Prior Calls registerBoardEx TCsetMode See Also TCsetCount TCgetCounts TCsetClock TCsetGate 6.4.5.14 Read Timer's current Count Value — TCgetCount Latches and reads a timer/counter's 16-bit count value, using the counter latch command. (Prior to version 4.23 of the driver, the read-back command was used, but that never worked properly on PC24E, PC25E, PC26AT, PC27E or PC30AT.) i = TCgetCount (h, chip, chan, pcount) where h short: board handle as registerBoardEx function.
AMPDIO DRIVERS i = TCgetUpCount (h, chip, chan, pcount) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the timer/counter chip. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). pcount pointer to long: pointer to a long integer variable into which the up-count value result will be placed.
AMPDIO DRIVERS #1. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan1 short: timer/counter #1 channel number within the chip (0, 1 or 2). pcount1 pointer to long: pointer to a long integer variable into which the count value #1 result will be placed. chip2 short: address offset of the timer/counter chip #2.
AMPDIO DRIVERS SUPPORTED IN VERSION 4.40 ONWARDS. i = TCgetInitialCount (h, chip, chan, pcount) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the timer/counter chip. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2).
AMPDIO DRIVERS X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan1 short: timer/counter #1 channel number within the chip (0, 1 or 2). clk1 short: timer #1 clock source. One of the following pre-defined constants may be used: CLK_CLK = 0: external CLK(chan1) i/p CLK_10MHZ = 1: 10 MHz CLK_1MHZ = 2: 1 MHz CLK_100KHZ = 3: 100 kHz CLK_10KHZ = 4: 10 kHz CLK_1KHZ = 5: 1 kHz CLK_OUTN_1 = 6: OUT(chan1–1) CLK_EXT = 7: external EXTCLK(chip1) i/p gat1 short: timer #1 gate source.
AMPDIO DRIVERS GAT_VCC = 0: Enabled GAT_GND = 1: Disabled GAT_EXT = 2: GAT(chan2) external i/p GAT_OUTN_2 = 3: /OUT(chan2–2) Returns short: Differential counter handle (>= 0). Use this handle as the hD parameter in calls to TCgetDiffCount, TCgetRatio and TCfreeDiffCounters when referring to this particular differential counter pair. or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx See Also TCsetGate TCgetDiffCount TCgetRatio TCfreeDiffCounters 6.4.6.
AMPDIO DRIVERS i = TCgetRatio (h, hD, pratio) where h short: board handle as registerBoardEx function. hD short: differential counter handle as issued by the TCsetDiffCounters function. pratio pointer to float: pointer to a 32-bit floating point variable into which the value representing the ratio of counts (Counter#2 / Counter#1) will be placed. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx TCsetDiffCounters See Also TCgetDiffCount TCfreeDiffCounters 6.4.6.
AMPDIO DRIVERS i = TCsetStopwatch (h, chip, chan) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the timer/counter chip. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). This channel and the next channel (chan+1) are used. The second channel may be on the next timer/counter chip. Returns short: Stopwatch handle (>= 0).
AMPDIO DRIVERS 6.4.7.3 Get Stopwatch Elapsed Time — TCgetElapsedTime Gets the elapsed time, in milliseconds, since a given stopwatch was started. i = TCgetElapsedTime (h, hS, ptime) where h short: board handle as registerBoardEx function. hS short: handle to stopwatch as issued by the TCsetStopwatch function. ptime pointer to long: pointer to a long integer variable into which the elapsed time result will be placed.
AMPDIO DRIVERS Returns short: Event recorder handle (>= 0). Use this handle to call the TCfreeEventRecorder function when finished. or ERRHANDLE ERRCHAN ERRBUFFER Prior Calls registerBoardEx TCsetStopwatch allocateLongBuf See Also TCfreeEventRecorder getLongIntItem readLongBuf copyFromLongBuf enableInterrupts 6.4.7.5 Free-up Event Recorder Timer and Digital Input Channels — TCfreeEventRecorder Frees up the event recorder.
AMPDIO DRIVERS or ERRDATA Prior Calls none See Also TCgetElapsedTime 6.4.7.7 Free-up Stopwatch Counter/Timers — TCfreeStopwatch Frees the timer/counters used by a stopwatch, as previously set up by TCsetStopwatch. Call this function when the stopwatch is no longer required. i = TCfreeStopwatch (h, hS) where h short: board handle as registerBoardEx function. hS short: stopwatch handle as issued by the TCsetStopwatch function.
AMPDIO DRIVERS Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). This channel and the next channel (chan+1) are used. The second channel may be on the next timer/counter chip. clock short: clock source (source of events) for the event counter.
AMPDIO DRIVERS 6.4.7.10 Read a 32-bit Event Counter — TCgetEventCount Gets the number of events since a given 32-bit event counter, as previously set up by the TCsetEventCounter function, was set up or reset. SUPPORTED IN VERSION 4.42 ONWARDS. i = TCgetEventCount (h, hE, pcount) where h short: board handle as registerBoardEx function. hE short: event counter handle as issued by the TCsetEventCounter function.
AMPDIO DRIVERS TCresetEventCounter 6.4.8 Frequency/Pulse Generation Functions 6.4.8.1 Send Monostable Pulse — TCsetMonoShot Creates a single pulse of specified duration on the output of a timer/counter, using the timer’s ‘Hardware Re-triggerable One-Shot’ mode. In this mode, the timer output will go low for the duration specified on the clock pulse following a gate trigger. Subsequent gate triggers will retrigger the pulse. See section 3.1.2 for more details on the Monostable application.
AMPDIO DRIVERS TCfreeResource 6.4.8.2 Generate Astable Multivibrator Waveform — TCsetAstable Generates a clock signal of specified frequency and mark-to-space ratio. This is implemented on two counters, both in mode 1 (digital one-shot). One counter counts the mark time and the other counts the space time. The outputs of each counter/timer control the gate of the other, so that when the mark times-out, the space counter is triggered and vice versa. N.B.
AMPDIO DRIVERS for 1 and low for 1. Returns short: Handle to the astable multivibrator (>= 0). Use this handle to call the TCfreeAstable function when finished, in order to free up the counter/timers for re-use. or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx See Also TCfreeAstable 6.4.8.3 Free-up Astable Multivibrator Counter/Timers — TCfreeAstable Frees the two timer counters used for an astable multivibrator, as set-up by the TCsetAstable function.
AMPDIO DRIVERS be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). freq float: desired frequency in Hertz. The frequency must be at least 0.01 Hz. The maximum frequency is the highest available internal clock frequency divided by 2. For cards with clock connection registers, this is 5000000 Hz. Returns short: OK or ERRHANDLE ERRCHAN ERRRANGE Prior Calls registerBoardEx See Also TCgenerateAccFreq TCgeneratePulse 6.4.8.
AMPDIO DRIVERS Y2 = 12 Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip (0, 1 or 2). Another timer/counter (chan – 1) will be used by this function. This timer/counter may be on the previous chip. freq float: desired frequency in Hertz. The frequency must be at least 0.002328 Hz. Returns short: OK or ERRHANDLE ERRCHAN ERRRANGE Prior Calls registerBoardEx See Also TCgenerateFreq TCfreeResource 6.4.8.
AMPDIO DRIVERS freq float: desired frequency in Hertz. The frequency must be at least 0.01 Hz. The maximum frequency is the highest available internal clock frequency divided by 2. For cards with clock connection registers, this is 5000000 Hz. For cards with clock connection registers, the internal input clock frequency is set to the highest of 1 kHz, 10 kHz, 100 kHz, 1 MHz or 10 Mhz that is no more than the desired frequency multiplied by 65536.
AMPDIO DRIVERS where h short: board handle as registerBoardEx function. issued by the pulseChip short: address offset of timer/counter chip for the pulse generator. One of the following predefined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 pulseChan short: timer/counter channel number within the chip for the pulse generator (0, 1 or 2). Two other timer/counter channels (pulseChan-2 and pulseChan-4) will also be used.
AMPDIO DRIVERS be used, or use -1 to choose a value automatically for boards with clock connection registers: -1 (choose automatically) CLK_10MHZ = 1 (fixed 10 MHz clock) CLK_1MHZ = 2 (fixed 1 MHz clock) CLK_100KHZ = 3 (fixed 100 kHz clock) CLK_10KHZ = 4 (fixed 10 kHz clock) CLK_1KHZ = 5 (fixed 1 kHz clock) trainGate short: gate input source for the train rate generator (if the board has gate connection registers).
AMPDIO DRIVERS Has no effect on boards without gate connection registers. i = TCchangePeriodicPulseTrainGate (h, hPPT, trainGate) where h short: board handle as registerBoardEx function. hPPT short: periodic pulse train generator handle, as issued by the TCsetPeriodicPulseTrain function. trainGate short: gate input source for the train rate generator (if the board has gate connection registers).
AMPDIO DRIVERS division of the train clock frequency. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx TCsetPeriodicPulseTrain See Also TCfreePeriodicPulseTrain TCchangePeriodicPulseTrainGate TCchangePeriodicPulseTrainCount TCchangePeriodicPulseTrainDuration TCcontrolPeriodicPulseTrain 6.4.8.
AMPDIO DRIVERS generated. SUPPORTED IN VERSION 4.32 ONWARDS. i = TCchangePeriodicPulseTrainDuration (h, hPPT, oneshotTime) where h short: board handle as registerBoardEx function. hPPT short: periodic pulse train generator handle, as issued by the TCsetPeriodicPulseTrain function. oneshotTime double: desired one-shot train duration in seconds.
AMPDIO DRIVERS 0 (stop the pulse channel [if started]) 1 (start the pulse channel [if stopped]) runOneshot short: controls the 'one-shot' channel: 0 (stop the one-shot channel [if started]) 1 (start the one-shot channel [if stopped]) runTrain short: controls the 'train' channel: 0 (stop the train channel [if started]) 1 (start the train channel [if stopped]) Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx TCsetPeriodicPulseTrain See Also TCfreePeriodicPulseTrain TCchangePeriod
AMPDIO DRIVERS 6.4.8.14 Set up a Restricted Periodic Pulse Train Generator — TCsetRestrictedPulseTrain Sets up a restricted periodic pulse train on the specified timer channel (the 'pulse' channel). Each train of pulses is output within a restricted period equal to the clock period of a second timer channel (the 'train' channel). SUPPORTED IN VERSION 4.32 ONWARDS. The 'train' channel is offset by -2 from the specified 'pulse' channel.
AMPDIO DRIVERS pulseShape short: shape of pulses: 0 (negative-going for 1 clock period) 1 (negative-going square pulses) trainClock short: clock source for the train rate generator. One of the following pre-defined constants may be used: CLK_1MHZ = 2 (fixed 1 MHz clock) CLK_100KHZ = 3 (fixed 100 kHz clock) CLK_10KHZ = 4 (fixed 10 kHz clock) CLK_1KHZ = 5 (fixed 1 kHz clock) trainGate short: gate input source for the train rate generator (if the board has gate connection registers).
AMPDIO DRIVERS Has no effect on boards without gate connection registers. i = TCchangeRestrictedPulseTrainGate (h, hRPT, trainGate) where h short: board handle as registerBoardEx function. hRPT short: restricted periodic pulse train generator handle, as issued by the TCsetRestrictedPulseTrain function. trainGate short: gate input source for the train rate generator (if the board has gate connection registers).
AMPDIO DRIVERS division of the train clock frequency. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx TCsetRestrictedPulseTrain See Also TCfreeRestrictedPulseTrain TCchangeRestrictedPulseTrainGate TCchangeRestrictedPulseTrainCount TCcontrolRestrictedPulseTrain 6.4.8.
AMPDIO DRIVERS On setting up the restricted periodic pulse train generator, both channels are started. For pulses to be generated, both channels must be started and the 'train' channel's gate input must be high. SUPPORTED IN VERSION 4.40 ONWARDS. i = TCcontrolRestrictedPulseTrain (h, hRPT, runPulse, runTrain) where h short: board handle as registerBoardEx function. issued by the hPPT short: periodic pulse train generator handle, as issued by the TCsetPeriodicPulseTrain function.
AMPDIO DRIVERS Prior Calls registerBoardEx TCsetRestrictedPulseTrain See Also TCchangeRestrictedPulseTrainGate TCchangeRestrictedPulseTrainFreq TCchangeRestrictedPulseTrainCount TCcontrolRestrictedPulseTrain 6.4.8.20 Set up a Hardware-Triggered One-Shot Pulse Train Generator — TCsetOneShotPulseTrain Sets up a pulse train within a hardware-retriggerable one-shot period. The pulses are generated on the specified 'pulse' chip and channel.
AMPDIO DRIVERS be used, and may be on the previous chip or wrap around to the highest chip. pulseClock short: clock source for the pulse generator.
AMPDIO DRIVERS ERRDATA Prior Calls registerBoardEx See Also TCfreeOneShotPulseTrain TCchangeOneShotPulseTrainTrigger TCchangeOneShotPulseTrainCount TCchangeOneShotPulseTrainDuration TCcontrolOneShotPulseTrain TCsetPeriodicPulseTrain 6.4.8.
AMPDIO DRIVERS 6.4.8.22 Change One-Shot Pulse Train’s Pulse Count — TCchangeOneShotPulseTrainCount Changes the pulse count for the hardware-retriggerable one-shot pulse train generator (as set up by TCsetOneShotPulseTrain) to the specified value by altering the pulse frequency and the one-shot duration. For a one-shot currently in progress, the wrong number of pulses may be generated. SUPPORTED IN VERSION 4.32 ONWARDS.
AMPDIO DRIVERS ERRCHAN ERRDATA Prior Calls registerBoardEx TCsetOneShotPulseTrain See Also TCfreeOneShotPulseTrain TCchangeOneShotPulseTrainTrigger TCchangeOneShotPulseTrainCount TCcontrolOneShotPulseTrain 6.4.8.24 Control a Hardware-Triggered One-Shot Pulse Train Generator's Timer Channels — TCcontrolOneShotPulseTrain Stops or starts the 'pulse' channel and/or the 'one-shot' channel of the hardware retriggerable one-shot pulse train generator.
AMPDIO DRIVERS 6.4.8.25 Free a Hardware-Triggered One-Shot Pulse Train Generator — TCfreeOneShotPulseTrain Frees resources used by a hardware-retriggerable one-shot pulse train generator as set up by TCsetOneShotPulseTrain. SUPPORTED IN VERSION 4.32 ONWARDS. i = TCfreeOneShotPulseTrain (h, hOSPT) where h short: board handle as registerBoardEx function. hOSPT short: one-shot pulse train generator handle, as issued by the TCsetOneShotPulseTrain function.
AMPDIO DRIVERS Z1 = 16 Z2 = 20 chan short: timer/counter channel number within the chip for the pulse generator (0, 1 or 2). clock short: clock source for the pulse generator.
AMPDIO DRIVERS 6.4.8.27 Change Programmable Width Pulse Generator's Duty Cycle — TCchangePWPulseDutyCycle Changes the output low period of the programmable width pulse generator by specifying a new duty cycle. This is the proportion of the previously specified period to spend with the output low when the pulse generator is triggered. This function has no direct control over the output high period. SUPPORTED IN VERSION 4.42 ONWARDS.
AMPDIO DRIVERS This is used to choose the internal clock source when the clock source is chosen automatically. This is just an assumed period. The function has no control over the actual period between triggers. The maximum period is 65536 s divided by the frequency of the clock source, e.g. for CLK_1KHZ the maximum period is 65.356 s. If the clock source is chosen automatically and the card has clock connection registers, the maximum period is as for CLK_1KHZ, i.e. 65.536 s.
AMPDIO DRIVERS TCsetPWPulse See Also 6.4.8.30 TCfreePWPulse TCchangePWPulseDutyCycle TCchangePWPulsePeriod Free a Programmable Width Pulse Generator — TCfreePWPulse Frees the timer counter resources used by a programmable width pulse generator, as previously set up by TCsetPWPulse. SUPPORTED IN VERSION 4.42 ONWARDS. i = TCfreePWPulse (h, hPWP) where h short: board handle as registerBoardEx function. hPWP short: programmable width pulse generator handle, as issued by the TCsetPWPulse function.
AMPDIO DRIVERS the pulse generator. One of the following predefined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 pulseChan short: timer/counter channel number within the chip for the pulse generator (0, 1 or 2). Another timer/counter channel (pulseChan-2) will also be used, and may be on the previous chip or wrap around to the highest chip. pulseClock short: clock source for the pulse generator.
AMPDIO DRIVERS GAT_OUTN_2 = 3 (gate from inverted output of a timer channel offset by -2 from train channel) duty double:.proportion of the specified period to spend with the output low, range 0 to 1. trainFreq double: desired train frequency in Hz. The actual frequency will be rounded to an integral division of the train clock frequency.
AMPDIO DRIVERS where h short: board handle as registerBoardEx function. hPWMT short: pulse width modulated pulse train generator handle, as issued by the TCsetPWMTrain function. trainGate short: gate input source for the train rate generator (if the board has gate connection registers).
AMPDIO DRIVERS The minimum train frequency is the frequency of the train clock source divided by 65536, or the frequency of the pulse clock source divided by 65536, whichever is the greatest. E.g. for CLK_1KHZ the minimum train frequency is about 0.01526 Hz. If both the train clock source and pulse clock source are chosen automatically, the minimum train frequency is as for CLK_1KHZ, i.e. about 0.01526 Hz. The maximum train frequency is the frequency of the train clock source divided by 2, e.g.
AMPDIO DRIVERS Prior Calls registerBoardEx TCsetPWMTrain See Also TCfreePWMTrain TCchangePWMTrainGate TCchangePWMTrainFreq TCcontrolPWMTrain 6.4.8.35 Control a Pulse Width Modulated Pulse Train Generator's Timer Channels — TCcontrolPWMTrain Stops or starts the 'pulse' channel and/or the 'train' channel of the pulse-width modulated pulse train generator. If the 'pulse' channel is stopped, its output will go high immediately.
AMPDIO DRIVERS 6.4.8.36 Free a Pulse Width Modulated Pulse Train Generator — TCfreePWMTrain Frees the timer counter resources used by a pulse width modulated pulse train generator, as previously setup by TCsetPWMTrain. SUPPORTED IN VERSION 4.42 ONWARDS. i = TCfreePWMTrain (h, hPWMT) where h short: board handle as registerBoardEx function. hPWMT short: pulse width modulated pulse train generator handle, as issued by the TCsetPWMTrain function.
AMPDIO DRIVERS This second timer/counter may be on the previous chip. pper Returns short: OK or ERRHANDLE ERRCHAN ERRRANGE ERRDATA Prior Calls registerBoardEx See Also TCgetExtFreq 6.4.9.2 pointer to float: Pointer to a 32-bit floatingpoint variable into which the period result will be placed. Measure Frequency of an External Signal — TCgetExtFreq Returns the frequency of an external signal, in Hertz.
AMPDIO DRIVERS See Also 6.4.9.3 TCgetExtPeriod TCgetExtFreqRestricted Measure Frequency of an External Signal Over a Fixed Period — TCgetExtFreqRestricted Returns the frequency of an external signal, in Hertz, as measured over a specified period. The external signal must be connected to the clock input of the timer specified by the chip and chan arguments. See section 3.1.5 for more details on the Frequency/Period Measurement application. SUPPORTED IN VERSION 4.
AMPDIO DRIVERS Prior Calls registerBoardEx See Also TCgetExtFreq 6.4.9.4 Multiply an External Frequency — TCmultiplyFreq Measures an external signal’s frequency, then generates another signal whose frequency is the external frequency multiplied by a specified number. N.B. this function is not on-going, and must be called at a regular interval to keep the generated frequency tracking the external signal. Note that the output signal will be a square wave. See section 3.1.
AMPDIO DRIVERS Prior Calls registerBoardEx See Also TCdivideFreq 6.4.9.5 Divide an External Frequency — TCdivideFreq Measures an external signal’s frequency, then generates another signal whose frequency is the external frequency divided by a specified number. N.B. this function is not on-going, and must be called at a regular interval to keep the generated frequency tracking the external signal. Note the output signal will be a square wave.
AMPDIO DRIVERS Prior Calls registerBoardEx See Also TCmultiplyFreq 6.4.10 Digitally Controlled Oscillator Functions 6.4.10.1 Prepare a Digitally-Controlled Oscillator — TCsetDCO Implements a digitally controlled oscillator (DCO) which periodically reads a data value from a digital input channel and generates an external frequency based on the value. The digital input channel can be 1, 4, 8, 12, 16, or 24-bits wide, as specified by a previous call to function DIOsetChanWidth.
AMPDIO DRIVERS Z1 = 16 Z2 = 20 MinF float: output frequency corresponding to DI data value 0. MaxF float.: frequency corresponding to the maximum digital input data value, which itself depends on the channel width specified in DIOsetChanWidth. Returns short: DCO handle (>= 0). Use this handle to call TCfreeDCO when finished. or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx See Also TCsetUserCO enableInterrupts TCfreeDCO 6.4.10.
AMPDIO DRIVERS generate the update interrupts. One of the following pre-defined constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 MinF float: output frequency corresponding to user value 0. MaxF float.: output frequency corresponding to user value 2147483647 (7FFFFFFF16). Returns short: User CO handle (>= 0). Use this handle to call TCfreeDCO when finished. or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx See Also TCUserCOCallback enableInterrupts TCfreeDCO 6.4.10.
AMPDIO DRIVERS 6.4.10.4 Set User Controlled Oscillator Output Level — TCsetUserCOLevel This function allows the user to set the frequency of the controlled oscillator declared using TCsetUserCO. Provided so that the output frequency of the controlled oscillator can be set as part of the user callback function; however, it can be called at any time. i = TCsetUserCOLevel (h, hCO, value) where h short: board handle as registerBoardEx function.
AMPDIO DRIVERS 6.4.11 Digital Input/Output Functions 6.4.11.1 Test if Digital I/O Chip is Free — DIOisAvailable Checks if a particular Digital I/O (DIO) chip is available on a board. A DIO chip may not be available for one of two reasons: 1. the DIO chip is not provided by the board specified, or 2. the DIO chip is being used by some other function. i = DIOisAvailable (h, chip) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the DIO chip.
AMPDIO DRIVERS PORTB = 1 PORTC_L = 2 PORTC_U = 3 isInput Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx See Also DIOsetChanWidth DIOsetData DIOgetData DIOgetMode 6.4.11.3 short: non-zero if port is to be set as input, zero if port is to be set as output. Check Digital I/O Port Direction — DIOgetMode Indicates whether a digital I/O port is an input or an output. SUPPORTED IN VERSION 4.40 ONWARDS.
AMPDIO DRIVERS ERRCHAN Prior Calls registerBoardEx See Also DIOsetMode 6.4.11.4 Re-define Channel Width within a Digital I/O Chip — DIOsetChanWidth Redefines the number of bits per DIO channel to be used in subsequent calls to the DIOsetData and DIOgetData functions. The default channel width is 8-bits, and this can be changed to 1, 4, 8, 12, 16, or 24.
AMPDIO DRIVERS 6.4.11.5 Send Digital Output Data — DIOsetData Writes a data value to a DIO channel. It is assumed that the channel has already been set as an output by a call to function DIOsetMode. i = DIOsetData (h, chip, chan, data) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the DIO chip. One of the following pre-defined constants may be used: PPIX = 0 PPIY = 8 PPIZ = 16 chan short: DIO channel.
AMPDIO DRIVERS pdata Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx DIOsetMode DIOsetChanWidth See Also DIOsetData 6.4.11.7 pointer to long: pointer to a long integer variable into which the digital data word will be placed. Configure a Digital I/O Port Mode — DIOsetModeEx Writes directly to the digital I/O port control register. The value written may be a mode-setting command (bit 7 = 1) or a single bit set/reset command (bit 7 = 0). SUPPORTED IN VERSION 2.
AMPDIO DRIVERS SUPPORTED IN VERSION 4.40 ONWARDS. Note: if this is used with a hardware device driver prior to version 4.40, the function will get the last mode-setting command or single bit set/reset command sent to the digital I/O port's control register. To be on the safe side, the application should check that bit 7 of the returned data is set to 1 before interpreting it as a mode value. i = DIOgetModeEx (h, chip, pdata) where h short: board handle as registerBoardEx function.
AMPDIO DRIVERS or ERRHANDLE ERRCHAN Prior Calls registerBoardEx DIOsetMode DIOsetModeEx See Also DIOgetDataEx 6.4.11.10 Read Digital Input Data Port — DIOgetDataEx Reads a data value from a DIO port. SUPPORTED IN VERSION 2.00 ONWARDS. i = DIOgetDataEx (h, chip, port, pdata) where h short: board handle as registerBoardEx function. issued by the chip short: address offset of the DIO chip. One of the following pre-defined constants may be used: PPIX = 0 PPIY = 8 PPIZ = 16 port short.
AMPDIO DRIVERS array is wired correctly with suitable diodes and resistors, otherwise the board could get damaged. See section 3.2.2 for details. Only one switch matrix implementation is available per board. i = DIOsetSwitchMatrix (h, order) where h order short: board handle as issued by registerBoardEx function . short: order of the matrix (12, 24 or 36). Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx See Also DIOgetSwitchStatus DIOfreeSwitchMatrix 6.4.12.
AMPDIO DRIVERS i = DIOfreeSwitchMatrix (h) where h short: board handle as registerBoardEx function. Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx DIOsetSwitchMatrix issued by the See Also 6.4.13 Basic User Interrupt Callbacks 6.4.13.1 Prepare a Basic User Interrupt — TCsetUserInterrupt Used to register a callback function that will be called when a particular interrupt event occurs. This does not support write events due to the interface to the user callback function.
AMPDIO DRIVERS constants may be used: X1 = 0 X2 = 4 Y1 = 8 Y2 = 12 Z1 = 16 Z2 = 20 PPIX = 0 PPIY = 8 PPIZ = 16 ISRDATA PPIXC0 = 0 PPIXC3 = 4 PPIYC0 = 8 PPIYC3 = 12 PPIZC0 = 16 PPIZC3 = 20 PPIYC7 = 8 EXT0 = 0 ADC0 = 0 ADC2 = 8 DAC2 = 8 DAC4 = 16 SATRIG = 12 short: type of data to fetch on interrupt.
AMPDIO DRIVERS TCfreeUserInterrupt TCsetUserInterruptAIO TCsetUserInterrupt2 TCsetBufferUserInterrupt TCsetNCBufferUserInterrupt enableInterrupts disableInterrupts 6.4.13.2 Prepare a Basic User Interrupt for Analogue Input — TCsetUserInterruptAIO Used to register a callback function that will be called when a particular interrupt event occurs. This variant is used to support reading from analogue channels. SUPPORTED IN VERSION 4.00 ONWARDS.
AMPDIO DRIVERS Z2 = 20 PPIX = 0 PPIY = 8 PPIZ = 16 ISRDATA PPIZC3 = 20 PPIYC7 = 8 EXT0 = 0 ADC0 = 0 ADC2 = 8 DAC2 = 8 DAC4 = 16 SATRIG = 12 short: type of data to fetch on interrupt. The following pre-defined constants may be used: ISR_READ_ADCS = 10 ISR_READ_ADCSNOFIFO = 11 ISR_READ_ADCSFIFO = 12 ISR_READ_ADCSASAP = 15 Group short: channel group of ADC channels to read.
AMPDIO DRIVERS automatically enabled by this interrupt set-up function. In versions of the DLL from 4.40 onwards, all valid interrupt sources are initially enabled at the second level but are no longer automatically enabled by this interrupt set-up function. In either case, if interrupt sources have not been explicitly disabled at the second level, there is no need to explicitly enable them.
AMPDIO DRIVERS Returns short: User Interrupt handle (>= 0). Use this to free the user interrupt with TCfreeUserInterrupt when finished. or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx See Also TCUserCCallback TCfreeUserInterrupt TCsetUserInterrupt TCsetUserInterruptAIO TCsetBufferUserInterrupt2 TCsetNCBufferUserInterrupt2 enableInterrupts disableInterrupts 6.4.13.4 Basic User Interrupt Callback — TCUserCCallback Function to be implemented in the user’s code.
AMPDIO DRIVERS hUsrInt short: user interrupt handle as issued by user interrupt set-up function. Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx TCsetUserInterrupt TCsetUserInterruptAIO TCsetUserInterrupt2 TCsetBufferUserInterrupt TCsetBufferUserInterruptAIO TCsetBufferUserInterrupt2 TCsetNCBufferUserInterrupt TCsetNCBufferUserInterruptAIO TCsetNCBufferUserInterrupt2 See Also 6.4.14 Buffered User Interrupt Callbacks 6.4.14.
AMPDIO DRIVERS interrupt or first interrupt line on a PPI chip it is the address offset of the chip. For second interrupt line on a PPI chip it is the address offset of the PPI chip plus 4. Corresponds to bit positions in interrupt enable register if the card has one, otherwise use the address offset of the interrupting chip.
AMPDIO DRIVERS Chan1 short: first timer/counter channel or PPI port to read or write (0, 1, 2). Chip2 short: address offset of the second timer/counter or PPI chip to be read or written: X1 = 0 Y1 = 8 Z1 = 16 Chan2 X2 = 4 Y2 = 12 Z2 = 20 PPIX = 0 PPIY = 8 PPIZ = 16 short: second timer/counter channel or PPI port to read or write (0, 1, 2) Returns short: User Interrupt handle (>= 0). Use this to free the user interrupt with TCfreeUserInterrupt when finished.
AMPDIO DRIVERS format of a TCUserCBCallback as defined below. wParam unsigned integer: user-supplied value passed to the user’s callback function. Chip short: determines interrupt source. The interrupt source number from 0 to 5 multiplied by 4 (0, 4, 8, 12, 16, 20). For timer/counter interrupt or first interrupt line on a PPI chip it is the address offset of the chip. For second interrupt line on a PPI chip it is the address offset of the PPI chip plus 4.
AMPDIO DRIVERS N.B. ADC channels will be read cyclically, one channel each time; DAC channels will be written a whole frame (all selected channels) at a time. Returns short: User Interrupt handle (>= 0). Use this to free the user interrupt with TCfreeUserInterrupt when finished.
AMPDIO DRIVERS by 4 (0, 4, 8, 12, 16, 20). For timer/counter interrupt or first interrupt line on a PPI chip it is the address offset of the chip. For second interrupt line on a PPI chip it is the address offset of the PPI chip plus 4. Corresponds to bit positions in interrupt enable register if the card has one, otherwise use the address offset of the interrupting chip.
AMPDIO DRIVERS to. Returns short: User Interrupt handle (>= 0). Use this to free the user interrupt with TCfreeUserInterrupt when finished. or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx See Also TCUserCBCallback TCfreeUserInterrupt TCsetBufferUserInterrupt TCsetBufferUserInterruptAIO TCsetUserInterrupt2 TCsetNCBufferUserInterrupt2 enableInterrupts disableInterrupts 6.4.14.4 Buffered User Interrupt Callback — TCUserCBCallback Function to be implemented in the user’s code.
AMPDIO DRIVERS 6.4.15 Non-Callback Buffered User Interrupts 6.4.15.1 Prepare a Non-Callback Buffered User Interrupt — TCsetNCBufferUserInterrupt Called to set up buffered user interrupts without callbacks and without creating any new threads. Instead of callbacks, data is transferred by the application calling the TCdriveNCBufferUserInterrupt function. This function may be used by a HP VEE application. SUPPORTED IN VERSION 4.00 ONWARDS. N.B.
AMPDIO DRIVERS ISR_READ_16COUNTSTAT = 16 ISR_READ_32COUNT = 1 ISR_READ_32COUNTSTAT = 17 ISR_READ_PPIABC = 5 ISR_READ_PPIC = 6 ISR_PC27 = 7 ISR_READ_DATA8 = 8 ISR_READ_DATA16 = 9 ISR_READ_2PPIABC = 13 ISR_READ_3PPIABC = 14 ISR_WRITE_DATA8 = 32 ISR_WRITE_DATA16 = 33 ISR_WRITE_PPIABC = 34 ISR_WRITE_16COUNT = 39 ISR_WRITE_32COUNT = 40 ISR_WRITE_2PPIABC = 41 ISR_WRITE_3PPIABC = 42 SizeReq unsigned long: number of data values in each buffer.
AMPDIO DRIVERS TCsetUserInterrupt TCsetBufferUserInterrupt enableInterrupts disableInterrupts 6.4.15.2 Prepare a Non-Callback Buffered User Interrupt for Analogue I/O — TCsetNCBufferUserInterruptAIO Called to set up buffered user interrupts without callbacks and without creating any new threads. Instead of callbacks, data is transferred by the application calling the TCdriveNCBufferUserInterrupt function. This function may be used by a HP VEE application.
AMPDIO DRIVERS buffer. fContin short: use single buffer if zero, use double buffering (continuous mode) if non-zero. ISRDATA short: type of data transfer to be performed on interrupt. The following pre-defined constants may be used: ISR_READ_ADCS = 10 ISR_READ_ADCSNOFIFO = 11 ISR_READ_ADCSFIFO = 12 ISR_READ_ADCSASAP = 15 ISR_WRITE_DACS = 35 ISR_WRITE_DACSNOFIFO = 37 ISR_WRITE_DACSFIFO = 38 Group short: channel group of ADC channels to read or DAC channels to be written.
AMPDIO DRIVERS TCsetNCBufferUserInterrupt or TCsetNCBufferUserInterruptAIO. SUPPORTED IN VERSION 4.00 ONWARDS. If the interrupt source is enabled at the first and second levels, it will be activated. Interrupts are initially disabled at the first level; use enableInterrupts to enable them. In versions of the DLL up to version 4.39, all interrupt sources are initially disabled at the second level but are automatically enabled by this interrupt set-up function. In versions of the DLL from 4.
AMPDIO DRIVERS For ISR_WRITE_2DACS: the channel group number of the first DAC to write to. Port1 unsigned long: usage depends on ISRDATA value. For ISR_WRITE_2DACS: the channel number (within the group) of the first DAC to write to. Block2 unsigned long: usage depends on ISRDATA value. For ISR_WRITE_2DACS: the channel group number of the second DAC to write to. Port2 unsigned long: usage depends on ISRDATA value. For ISR_WRITE_2DACS: the channel number (within the group) of the second DAC to write to.
AMPDIO DRIVERS registerBoardEx function. hUsrInt short: user interrupt handle as issued by the TCsetNCBufferUserInterrupt function. pBuffer pointer to unsigned long: pointer to the start of user’s buffer with which to transfer data to or from one of the interrupt data buffers. The amount of data to be transferred is given by the value of the SizeReq parameter which was passed to the user interrupt set-up function.
AMPDIO DRIVERS milliseconds to wait for an interrupt data buffer to become available for transfer. Can be set to 0 for a poll or to INFINITE (FFFFFFFF16) to wait indefinitely. Returns short: 0 if timed out; 1 if ready for data transfer. or ERRHANDLE ERRCHAN Prior Calls registerBoardEx TCsetNCBufferUserInterrupt TCsetNCBufferUserInterruptAIO TCsetNCBufferUserInterrupt2 enableInterrupts See Also TCdriveNCBufferUserInterrupt TCwaitMultiNCBufferReady 6.4.15.
AMPDIO DRIVERS phUIOut pointer to short: pointer to short integer variable which will be set to –1 on timeout, or to the user interrupt handle of the first user interrupt which is ready for data transfer. TOutMs unsigned long: maximum amount of time in milliseconds to wait for an interrupt data buffer to become available for transfer on any of the user interrupts being checked. Can be set to 0 for a poll or to INFINITE (FFFFFFFF16) to wait indefinitely.
AMPDIO DRIVERS Returns short: 0 = overflow or under-run NOT detected; 1 = overflow or under-run detected and cleared. or ERRHANDLE ERRCHAN Prior Calls registerBoardEx TCsetUserInterrupt TCsetUserInterruptAIO TCsetUserInterrupt2 TCsetBufferUserInterrupt TCsetBufferUserInterruptAIO TCsetBufferUserInterrupt2 TCsetNCBufferUserInterrupt TCsetNCBufferUserInterruptAIO TCsetNCBufferUserInterrupt2 enableInterrupts See Also 6.4.16.
AMPDIO DRIVERS TCsetUserInterrupt TCsetUserInterruptAIO TCsetUserInterrupt2 TCsetBufferUserInterrupt TCsetBufferUserInterruptAIO TCsetBufferUserInterrupt2 TCsetNCBufferUserInterrupt TCsetNCBufferUserInterruptAIO TCsetNCBufferUserInterrupt2 enableInterrupts See Also 6.4.16.3 Expedite Read User Interrupt — TCexpediteReadUserInterrupt Cause current or following user interrupt data buffer to complete as soon as possible with as much data as possible without waiting for the buffer to fill.
AMPDIO DRIVERS 6.4.16.4 Check User Interrupt Data Available — TCcheckUserInterruptDataAvailable Check the amount of user interrupt data available to be read. SUPPORTED IN VERSION 5.02 ONWARDS. Counts the amount of data in the current user interrupt data buffer and the amount of data int the driver's small, internal buffer. It also tries to count the amount of data available in hardware FIFOs.
AMPDIO DRIVERS source has been explicitly disabled. i = TCenableUserInterrupt (h, hUsrInt) where h short: board handle as registerBoardEx function. hUsrInt short: user interrupt handle as issued by user interrupt set-up function.
AMPDIO DRIVERS TCsetBufferUserInterrupt TCsetBufferUserInterruptAIO TCsetBufferUserInterrupt2 TCsetNCBufferUserInterrupt TCsetNCBufferUserInterruptAIO TCsetNCBufferUserInterrupt2 See Also TCenableUserInterrupt setIntMask getIntMask TCdisableInterruptChip 6.4.17 Analogue I/O Resource Management 6.4.17.1 Test if ADC Interrupt Source is Free — AIOADCisAvailable Called to determine whether an ADC chip is available at a particular base address offset for use as an interrupt source.
AMPDIO DRIVERS ADC channel groups they are numbered from 0 to number of groups–1. N.B. all currently supported cards have at most one ADC channel group. SUPPORTED IN VERSION 4.00 ONWARDS. i = AIOcountADCgroups (h) where h Returns short: number of ADC channel groups on the card. Prior Calls registerBoardEx See Also AIOcountADCchans AIOADCgroupIntChip AIOADCgroupHasFIFO 6.4.17.3 short: board handle as registerBoardEx function.
AMPDIO DRIVERS or ERRHANDLE ERRCHAN Prior Calls registerBoardEx AIOcountADCgroups See Also AIOADCisAvailable 6.4.17.5 Determine whether ADC Channel Group has a FIFO — AIOADCgroupHasFIFO Called to determine whether an ADC channel group has a FIFO. SUPPORTED IN VERSION 4.10 ONWARDS. i = AIOADCgroupHasFIFO (h, Group) where h short: board handle as registerBoardEx function. Group short: ADC channel group.
AMPDIO DRIVERS See Also 6.4.17.7 AIOADCgroupHasFIFO Test if DAC Interrupt Source is Free — AIODACisAvailable Called to determine whether a DAC chip is available at a particular base address offset for use as an interrupt source. For some cards, the base address offset is just a placeholder for the DAC chip. Generally, only cards with DAC FIFOs have an interrupt source. SUPPORTED IN VERSION 4.20 ONWARDS. i = AIODACisAvailable (h, Chip) where h short: board handle as registerBoardEx function.
AMPDIO DRIVERS Returns short: number of DAC channel groups on the card. Prior Calls registerBoardEx See Also AIOcountDACchans AIODACgroupIntChip AIODACgroupHasFIFO 6.4.17.9 Determine Number of DAC Channels in a Group — AIOcountDACchans Called to determine the number of DAC channels in a particular channel group on a card. If the specified group exists, channels are numbered from 0 to number of channels–1. SUPPORTED IN VERSION 4.00 ONWARDS.
AMPDIO DRIVERS See Also AIODACisAvailable 6.4.17.11 Determine whether DAC Channel Group has a FIFO — AIODACgroupHasFIFO Called to determine whether a DAC channel group has a FIFO. SUPPORTED IN VERSION 4.10 ONWARDS. i = AIODACgroupHasFIFO (h, Group) where h short: board handle as registerBoardEx function. Group short: DAC channel group.
AMPDIO DRIVERS 6.4.18 Analogue I/O Configuration 6.4.18.1 Query ADC Software Bipolar/Unipolar Settings — AIOgetADCchanMode Gets the software bipolar/unipolar mode of each ADC channel in a group. This indicates the way raw data from each ADC channel is cooked, but does not reflect the actual settings in the hardware. SUPPORTED IN VERSION 4.00 ONWARDS. i = AIOgetADCchanMode (h, Group, pModes) where h short: board handle as registerBoardEx function. Group short: ADC channel group.
AMPDIO DRIVERS ERRCHAN ERRDATA Prior Calls registerBoardEx AIOcountADCgroups See Also AIOgetADCchanMode AIOsetHWADCchanMode 6.4.18.3 Configure ADC Software Bipolar/Unipolar Settings — AIOsetADCchanMode Sets the software bipolar/unipolar mode of each ADC channel in a group. This affects the way raw data from each ADC channel is cooked, but has no effect on the underlying hardware settings. SUPPORTED IN VERSION 4.00 ONWARDS.
AMPDIO DRIVERS ModeVal unsigned long: bipolar/unipolar mode value may depend on card type. In general: 0 = set all channels to bipolar in hardware; FFFFFFFF16 = set all channels to unipolar in hardware. For PCI230 and PCI260: all non-zero values set all channels to unipolar in hardware. Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx AIOcountADCgroups See Also AIOsetADCchanMode AIOgetHWADCchanMode AIOsetAllADCchanMode 6.4.18.
AMPDIO DRIVERS i = AIOgetHWADCchanDiff (h, Group, pDiffs) where h short: board handle as registerBoardEx function. Group short: ADC channel group. pDiffs pointer to unsigned long: pointer to unsigned long variable which will be set to bit vector value set with 1’s for differential channels and 0’s for single-ended channels or unsupported channels. Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx AIOcountADCgroups See Also AIOsetHWADCchanDiff 6.4.18.
AMPDIO DRIVERS See Also 6.4.18.8 AIOgetHWADCchanDiff Query ADC Hardware Gain Settings — AIOgetHWADCchanGain Gets the hardware gain settings for a group of ADC channels. This is only supported on certain cards. SUPPORTED IN VERSION 4.10 ONWARDS. i = AIOgetHWADCchanGain (h, Group, pGains) where h short: board handle as registerBoardEx function. issued by the Group short: ADC channel group.
AMPDIO DRIVERS where h short: board handle as registerBoardEx function. issued by the Group short: ADC channel group. ChMask unsigned long: bit vector with 1’s for channels to change and 0’s for channels to leave alone. Gains unsigned long: channel gains value which depends on the card type.
AMPDIO DRIVERS pModes pointer to unsigned long: pointer to unsigned long variable which will be set to bit vector value with 1’s for unipolar channels and 0’s for bipolar or unsupported channels. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx AIOcountDACgroups See Also AIOsetDACchanMode AIOgetHWDACchanMode 6.4.18.11 Query DAC Hardware Bipolar/Unipolar Settings — AIOgetHWDACchanMode Gets the hardware bipolar/unipolar mode of each DAC channel in a group.
AMPDIO DRIVERS i = AIOsetDACchanMode (h, Group, ChMask, Modes) where h short: board handle as registerBoardEx function. Group short: DAC channel group. ChMask unsigned long: bit vector with 1’s for channels to change and 0’s for channels to leave alone. Modes unsigned long: bit vector with 1’s for unipolar channels and 0’s for bipolar channels.
AMPDIO DRIVERS or ERRHANDLE ERRCHAN Prior Calls registerBoardEx AIOcountDACgroups See Also AIOsetDACchanMode AIOgetHWDACchanMode AIOsetAllDACchanMode 6.4.18.14 Configure DAC All Channels Bipolar or Unipolar — AIOsetAllDACchanMode Sets the software bipolar/unipolar mode of all DAC channels in a group to all bipolar or all unipolar. This affects the way cooked data is converted to raw data for each DAC channel. Also sets the hardware bipolar/unipolar mode on cards that support this.
AMPDIO DRIVERS card type. For PCI224: Value applies to all channels. Value 0 1 2 3 Unipolar range 0 – 1.25V 0 – 2.5V 0 – 5V 0 – 10V Bipolar range ±1.25V ±2.5V ±5V ±10V For PCI234: Value applies to all channels. 0 = use range selected by jumpers. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx AIOcountDACgroups See Also AIOsetHWDACchanRange 6.4.18.
AMPDIO DRIVERS or ERRHANDLE ERRCHAN Prior Calls registerBoardEx AIOcountDACgroups See Also AIOgetHWDACchanRange 6.4.19 Analogue Input 6.4.19.1 Set ADC Conversion Trigger Source — AIOsetADCconvSource Sets the ADC conversion trigger source for an ADC channel group. Depending on the card, certain settings may require jumpers to be set, be unsupported or ignored. SUPPORTED IN VERSION 4.00 ONWARDS. i = AIOsetADCconvSource (h, Group, Cnv) where h short: board handle as registerBoardEx function.
AMPDIO DRIVERS registerBoardEx function. Group short: ADC channel group. Chan short: selected channel. Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx AIOcountADCgroups AIOcountADCchans See Also AIOsetADCconvSource AIOstartADCconversion AIOgetADCdata 6.4.19.3 Software-trigger ADC Conversion — AIOstartADCconversion Starts software-triggered A-to-D conversion for the currently multiplexed channel on a specified channel group. SUPPORTED IN VERSION 4.00 ONWARDS.
AMPDIO DRIVERS where h short: board handle as registerBoardEx function. Group short: ADC channel group. pData pointer to long: pointer to long integer variable which will be set to the cooked ADC data value. Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx AIOcountADCgroups AIOsetADCconvSource AIOsetADCmultiplexer AIOstartADCconversion issued by the See Also 6.4.19.
AMPDIO DRIVERS registerBoardEx function. Group short: ADC channel group.
AMPDIO DRIVERS AIOcountADCgroups See Also 6.4.19.6 AIOgetADCpretriggerCount AIOsetADCconvSource Get ADC Pre-trigger Count — AIOgetADCpretriggerCount Gets the pre-trigger count for the ADC start acquisition trigger when the start type has been set to START_NOW. This gives the number of samples that were acquired before the trigger occurred, or the number of samples that have been acquired so far if the trigger has not occurred yet. The function return value indicates whether the trigger has occurred.
AMPDIO DRIVERS 6.4.20 Analogue Output 6.4.20.1 Write DAC Data — AIOsetDACchanData Writes a set of data to a corresponding to a set of DAC channels, all belonging to a specified channel group. SUPPORTED IN VERSION 4.00 ONWARDS. i = AIOsetDACchanData (h, Group, ChMask, pData) where h short: board handle as registerBoardEx function. issued by the Group short: DAC channel group. ChMask unsigned long: bit vector with 1’s for channels to write and 0’s for channels to leave alone.
AMPDIO DRIVERS triggering the DAC with the next data, and only applies to card types that have specific support for these operations. Depending on the card, certain settings may be unsupported or ignored.
AMPDIO DRIVERS i = AIOsetDACchanWaveform (h, Group, ChMask, pData, DLen) where h short: board handle as registerBoardEx function. issued by the Group short: DAC channel group. ChMask unsigned long: bit vector with 1’s for channels to write and 0’s for channels to leave alone. pData pointer to unsigned long: pointer to first element of array of data to be written to the DAC channels enabled by setting bits to ‘1’ in ChMask.
AMPDIO DRIVERS See Also 6.4.20.4 AIOsetDACconvSource AIOstartDACconversion Software-trigger DAC Conversion — AIOstartDACconversion Provides a tick of the software clock for a DAC channel group. This is only effective when the DAC group’s conversion trigger source has been set to CNV_SW and the DAC is being operated in certain modes. It applies when an interrupt has been set up to drive the DAC in FIFO mode.
AMPDIO DRIVERS 6.4.22 Legacy Analogue I/O Functions 6.4.22.1 Set PC27 Multiplexer Register — PC27SetMultiplexer Outputs a byte to the PC27 multiplexer register. SUPPORTED IN COMPATIBILITY. VERSION 2.01 ONWARDS. RETAINED FOR BACKWARD i = PC27SetMultiplexer (h, Data) where h short: board handle as registerBoardEx function. Data short: data to write. Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx See Also PC27StartConversion PC27getData 6.4.22.
AMPDIO DRIVERS registerBoardEx function. pData pointer to short: pointer to short integer variable which will be set to the raw data value from the PC27 ADC port. Returns short: OK or ERRHANDLE ERRCHAN ERRDATA Prior Calls registerBoardEx PC27SetMultiplexer PC27StartConversion See Also 6.4.22.4 Write PC27 DAC Data — PC24setData Outputs a sample to a PC24 DAC channel. SUPPORTED IN VERSION 2.0 ONWARDS. RETAINED FOR BACKWARD COMPATIBILITY.
AMPDIO DRIVERS pIOBuffer pointer to unsigned long: pointer to IOCTL data packet cast as pointer to unsigned long. Content depends on IOCTL code used. (See ADIOCTL.RTF for more information.) It may be one of the following types: ULONG TDIO_PORTIO TDIO_2PORTIO TDIO_BLKPORTIO TDIO_IRQSETUP Array of ULONG SizeOfBuffer Returns short: OK or ERRHANDLE ERRCHAN Prior Calls registerBoardEx unsigned long: size of IOCTL buffer pointed to by pIOBuffer in bytes. See Also 6.
AMPDIO DRIVERS 7 7.1 IOCTL INTERFACE About this Chapter This chapter gives a brief outline of the low-level interface to the Amplicon DIO driver. See the AMPIOCTL.RTF file (installed in the DIO_CODE subdirectory) for a full description. See the C source code for DIO_TC.DLL for examples of usage. 7.2 About the Driver The Amplicon Windows DIO Driver is a kernel mode driver providing and IO control (IOCTL) interface to the hardware. Different drivers are provided for different versions of Windows.
AMPDIO DRIVERS 4.42 onwards.) IOCTL_QUERY_REALHWVERSION Determine card’s real (Version 5.02 onwards.) IOCTL_GET_DEVICE Windows 95 only — allow support for more than one card. IOCTL_GET_NEXT_DEVICE Windows 95 only — allow support for more than one card. Windows 95 only — allow support for more than one card. (Version 4.20 onwards.) IOCTL_GET_NTH_DEVICE hardware version. IOCTL_SET_CTDATA Write byte data to counter timer data port. IOCTL_GET_CTDATA Read byte data from counter timer data port.
AMPDIO DRIVERS IOCTL_GET_IODATA Read a block of data from any I/O address within card I/O space. (Version 2.00 onwards.) IOCTL_SET_IODATA Write a block of data to any I/O address within card I/O space. (Version 2.00 onwards.) IOCTL_QUERY_ADCNUMGROUPS Determine number of ADC channel groups on a card. (Version 4.02 onwards.) IOCTL_QUERY_DACNUMGROUPS Determine number of DAC channel groups on a card. (Version 4.02 onwards.
AMPDIO DRIVERS IOCTL_SET_HWADCDIFFMODE Set hardware ADC single-ended/ differential settings for channels within an ADC channel group. (Version 4.10 onwards.) IOCTL_SET_HWADCCHANGAIN Set hardware gain settings for channels within an ADC channel group. (Version 4.10 onwards.) IOCTL_SET_HWDACCHANRANGE Set hardware output range settings for channels within a DAC channel group. (Version 4.20 onwards.) IOCTL_SET_ADCCONVSRCE Set conversion trigger source for an ADC channel group. (Version 4.02 onwards.
AMPDIO DRIVERS IOCTL_WAIT_INTEVENT_2 Waits for interrupt event 2 to occur. (Version 4.02 onwards.) IOCTL_WAIT_INTEVENT_3 Waits for interrupt event 3 to occur. (Version 4.02 onwards.) IOCTL_WAIT_INTEVENT_4 Waits for interrupt event 4 to occur. (Version 4.02 onwards.) IOCTL_WAIT_INTEVENT_5 Waits for interrupt event 5 to occur. (Version 4.02 onwards.) IOCTL_WAIT_INTEVENT_READ_DIRECT Wait for an interrupt event to occur using “direct I/O” method for buffer transfer. (Version 4.43 onwards.
AMPDIO DRIVERS Page 239 ISR_WRITE_DATA16 — writes data to 2 DIO ports (Version 3.00 onwards) ISR_WRITE_PPIABC — writes data to all 3 PPI ports (Version 3.00 onwards) ISR_WRITE_DACS — writes DAC channels (Version 4.00 onwards) ISR_WRITE_2DACS — writes 2 DAC channels (Version 4.00 onwards) ISR_WRITE_DACSNOFIFO — writes DAC channels (Version 4.02 onwards) ISR_WRITE_DACSFIFO — writes DAC channels (Version 4.
AMPDIO DRIVERS APPENDIX A GLOSSARY OF TERMS The following glossary explains some terms used in this manual and in data acquisition and control applications. Active Filter: An electronic filter that combines active circuit devices with passive circuit elements such as resistors and capacitors. Active filters typically have characteristics that closely match ideal filters. ADC (A/D): Analog to Digital converter. q.v.
AMPDIO DRIVERS Common Mode Voltage: In a differential measurement system, the common mode voltage usually represents an interfering signal. The common mode voltage is the average of the voltages on the two input signal lines with respect to ground level of the measuring system. Comparator: An electronic circuit used to compare two values and set an indicator that identifies which value is greater.
AMPDIO DRIVERS I/O Address: A method that allows the CPU to distinguish between different boards and I/O functions in a system. See Base Address. Latch: A device to store the state of a digital signal until it is changed by another external command signal. The action of storing this signal. Least Significant Bit (LSB): In a system in which a numerical magnitude is represented by a series of digits, the least significant bit (binary digit) is the digit that carries the smallest value or weight.
AMPDIO DRIVERS Successive Approximation: An analog to digital conversion method that sequentially compares a series of binary weighted values with the analog input signal to produce an output digital word in ‘n’ steps where ‘n’ is the number of bits of the A/D Converter. q.v. Symbol: The graphical representation of some idea. Letters and numerals are symbols. Syntax: Syntax is the set of rules used for forming statements in a particular programming language.
AMPDIO DRIVERS INDEX OF FUNCTIONS AIOADCgroupHasFIFO, 208 AIOADCgroupIntChip, 207 AIOADCisAvailable, 206 AIOcountADCchans, 207 AIOcountADCgroups, 206 AIOcountDACchans, 210 AIOcountDACgroups, 209 AIODACgroupHasFIFO, 211 AIODACgroupIntChip, 210 AIODACisAvailable, 209 AIOgetADCchanMode, 212 AIOgetADCdata, 223 AIOgetADCgroupFIFOsize, 208 AIOgetADCpretriggerCount, 226 AIOgetDACchanMode, 217 AIOgetDACgroupFIFOsize, 211 AIOgetHWADCchanDiff, 214 AIOgetHWADCchanGain, 216 AIOgetHWADCchanMode, 212 AIOgetHWDACchanMode
AMPDIO DRIVERS TCfreeAstable, 133 TCfreeDCO, 171 TCfreeDiffCounters, 124 TCfreeEventCounter, 130 TCfreeEventRecorder, 127 TCfreeOneShotPulseTrain, 153 TCfreePeriodicPulseTrain, 142 TCfreePWMTrain, 163 TCfreePWPulse, 157 TCfreeResource, 108 TCfreeRestrictedPulseTrain, 147 TCfreeStopwatch, 128 TCfreeUserInterrupt, 185 TCgenerateAccFreq, 134 TCgenerateFreq, 133 TCgeneratePulse, 135 TCgetClock, 110 TCgetCount, 118 TCgetCounts, 119 TCgetDiffCount, 123 TCgetElapsedTime, 126 TCgetEventCount, 130 TCgetExtFreq, 164