HP manual 15 9112ADDMAStatus, Return Code

Page 61

ad_ch_no : A/D channel number

ad_range : A/D analog input range, the possible values are shown in section 4.3.8.

count : the number of A/D conversion

ad_buffer(DOS) :the start address of the memory buffer to store the AD data, the buffer size must large than the number of AD conversion.

In DOS environment, please make sure this memory is double -word alignment. Every 16-bit unsigned integer data in ad_buffer:

D11 D10 D9

D1 D0

C3 C2

C1 C0

D11, D10, ..., D1, D0 : A/D converted data

 

C3, C2, C1, C0

: converted channel no.

memID(Windows-95) :the memory ID of the allocated system DMA

memory. In Windows 95 environment, before calling W_9112_AD_DMA_Start, W_9112_Alloc_DMA_Mem must be called to allocate a contiguous DMA memory. W_9112_Alloc_DMA_Mem will return a memory ID for identify the allocated DMA memory, as well as the linear address of the DMA memory for user to access the data. The format of the A/D data is the same as DOS buffer (ad_buffer argument). c1 : the 16-bit timer frequency divider of timer channel #1

c2 : the 16-bit timer frequency divider of timer channel #2

uReturn Code

ERR_NoError, ERR_BoardNoInit, ERR_InvalidADChannel, ERR_AD_InvalidRange, ERR_InvalidTimerValue

uExample

See Demo Program 'AD_DEMO3.C' , 'AD_DEMO6.C'

5.15 _9112_AD_DMA_Status

uDescription

Since the _9112_AD_DMA_Start function executs in background, you can issue the function _9112_AD_DMA_Status to check its operation status.

uSyntax

Visual C++ (Windows-95)

int W_9112_AD_DMA_Status (int card_number, int *status, int * count)

Visual Basic (Windows-95)

W_9112_AD_Status (ByVal card_number As Long, status As Long, count As Long) As Long

C/C++ Library 53

Image 61
Contents Page Trademarks ALL Rights ReservedDetailed Company Information Adlink Technology IncQuestions Page Contents Conversion Digital Input and Output Conversion9112DO 9112DA 9112ADSetChannel 9112ADSetRange 9112DblBufferTransfer 9112GetOverrunStatusWhat do you need VR Assignment Adjustment Appendix A. Demo. Programs Product Warranty/ServiceSoftware Utilities PCI Scan UtilityHow to Use This Guide T r o d u c t i o n FeaturesIntroduction ∙ Applications SpecificationsAnalog Input A/D Analog Output D/ADigital I/O DIO General SpecificationsProgrammable Counter Programming Library Software SupportingPCIS-LVIEW LabVIEW Driver DAQBenchTM ActiveX Controls PCIS-VEE HP-VEE DriverDASYLabTM PRO PCIS-DDE DDE Server and InTouchTM∙ Installation InstallationWhat You Have Installation ∙ Device Installation for Windows SystemsUnpacking PCI-9112 Layout PCB LayoutConverter PCI -Bus ControllerPCB Layout of the PCI-9112 CPCI-9112 LayoutAnalog Input Channel Configuration Jumper Settings10 ∙ Installation D/A Reference Voltage Setting Clock Source Setting12 ∙ Installation Internal Reference Voltage SettingCN 3 Analog Input / Output & Counter/Timer Connectors Pin AssignmentsPin Assignments of PCI-9112 CN 2 Digital Signal Output do 0 CN 1 Digital Signal Input DI 014 ∙ Installation Pin Assignments of cPCI-9112 16 ∙ Installation Hardware Installation OutlineConnect with ACLD-8125 Daughter Board ConnectionConnect with ACLD-9137 Connect with ACLD-9182Connect with ACLD-9185 18 ∙ InstallationConnect with ACLD-9138 and ACLD-9188 I/O Registers Map G i s t e r s F o r m a tRegisters Format ∙ 20 ∙ Registers Format A/D Data RegistersD/A Output Register Mode A/D control Register22 ∙ Registers Format MUX Register Bit8 ~ Bit5 Auto-Scan Bit24 ∙ Registers Format Software Trigger Register A/D Status Register26 ∙ Registers Format Digital I/O registerHigh Level Programming Internal Timer/Counter RegisterLow Level Programming E r a t i o n T h e o r e m Analog Input Signal ConnectionA/D Conversion 28 ∙ Operation TheoremDifferential input mode Single-ended ModeOperation Theorem ∙ 30 ∙ Operation Theorem 4 Floating source and differential inputTimer Pacer Trigger 1 A/D Conversion Procedure2 A/D Trigger Modes Software triggerExternal Trigger 3 A/D Data Transfer ModesSoftware Data Transfer Drdy Interrupt Transfer IntxDMA Transfer Dmax D/A Conversion34 ∙ Operation Theorem Digital Input and OutputCounter Timer/Counter OperationPacer Trigger Source General Purpose Timer/ CounterAddress 36 ∙ Operation TheoremControl Byte 38 ∙ Operation Theorem Mode Definitions+ + L i b r a r y Libraries Installation++ Library ∙ Naming Convention Programming GuideData Types 40 ∙ C/C++ LibrarySyntax 9112InitialArgument Return Code9112DI Channel 9112DIDescription 42 ∙ C/C++ Library9112DO 44 ∙ C/C++ Library 9112DA9112ADSetChannel 46 ∙ C/C++ Library 9112ADSetRangeCardnumber the card number of PCI-9112 10 9112ADSetMode48 ∙ C/C++ Library 11 9112ADSetAutoscan12 9112ADSoftTrig 50 ∙ C/C++ Library 13 9112ADAquire14 9112ADDMAStart 52 ∙ C/C++ Library 15 9112ADDMAStatus 54 ∙ C/C++ Library 16 9112ADDMAStop17 9112ContDmaStart 56 ∙ C/C++ Library 18 9112CheckHalfReady20 9112GetOverrunStatus 19 9112DblBufferTransfer58 ∙ C/C++ Library 21 9112ContDmaStop22 9112ADINTStart 60 ∙ C/C++ Library 23 9112ADINTStatus24 9112ADINTStop 25 9112ADTimer62 ∙ C/C++ Library 2MHz / c1 * c227 9112TIMERRead 26 9112TIMERStart29 9112AllocDMAMem 28 9112TIMERStopArgument cardnumber countervalue 64 ∙ C/C++ Library32 9112GetSample 30 9112FreeDMAMem66 ∙ C/C++ Library What do you need CalibrationCalibration ∙ VR Assignment A/D AdjustmentBipolar Calibration Unipolar CalibrationReference Voltage Calibration D/A Adjustment2 D/A Channel Calibration Software Utility Software Utilities70 ∙ Software Utility Running the Utility System ConfigurationCalibration Software Utility ∙PCI Scan Utility Functional Testing72 ∙ Software Utility DOS Software P e n d i x a . D e m o O g r a m sWindows 95 DLL Appendix a Demo Programs ∙74 ∙ Appendix a Demo Programs Product Warranty/Service ∙ Product Warranty/Service