HP manual 9112ADSetChannel

Page 53

u Example

#include

“9112.h”

 

main()

 

 

{

 

 

Int

baseAddr, irqNo;

 

_9112_Initial( CARD_1, &baseAddr, &irqNo);

 

/* Assume NoError when Initialize PCI-9112

*/

/* if the hardware setting for DA output range is 0~5V */

_9112_DA(CARD_1, DA_CH_1 , 0x800 );

printf( "The output voltage of CH1 is 2.5V \n" );

_9112_DA(CARD_1, DA_CH_2 , 0xFFF );

printf( "The output voltage of CH2 is 5V \n" );

}

A more complete program is specified in Appendix A Demo. Program 'DA_DEMO.C'

5.8_9112_AD_Set_Channel

uDescription

This function is used to set AD channel by means of writing data to the multiplexed scan channel register. There are 16 single-ended or 8 differential analog input channels in PCI-9112, so the channel number should be set between 0 to 15 for signled-end analog input mode, and 0 to 7 for differnetial analog input mode. The initial state is channel 0 which is a default setting by the PCI-9112 hardware configuration.

uSyntax

Visual C++ (Windows-95)

int W_9112_ AD_Set_Channel (int card_number, int ad_ch_no)

Visual Basic (Windows-95)

W_9112_AD_Set_Channel (ByVal card_number As Long, ByVal da_ch_no As Long) As Long

C/C++ ( DOS)

int _9112_AD_Set_Channel (int card_number, int ad_ch_no )

uArgument

card_number : the card number of PCI-9112

ad_ch_no : channel number to perform AD conversion

for single-ended mode : channel no. is from 0-15; for

differential mode : channel no. is from 0-7

C/C++ Library 45

Image 53
Contents Page Trademarks ALL Rights ReservedQuestions Adlink Technology IncDetailed Company Information 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 Introduction ∙ FeaturesT r o d u c t i o n Applications SpecificationsAnalog Input A/D Analog Output D/AProgrammable Counter General SpecificationsDigital I/O DIO PCIS-LVIEW LabVIEW Driver Software SupportingProgramming Library DAQBenchTM ActiveX Controls PCIS-VEE HP-VEE DriverDASYLabTM PRO PCIS-DDE DDE Server and InTouchTMWhat You Have Installation∙ Installation Unpacking Device Installation for Windows SystemsInstallation ∙ PCI-9112 Layout PCB LayoutConverter PCI -Bus ControllerPCB Layout of the PCI-9112 CPCI-9112 Layout10 ∙ Installation Jumper SettingsAnalog Input Channel Configuration D/A Reference Voltage Setting Clock Source Setting12 ∙ Installation Internal Reference Voltage SettingPin Assignments of PCI-9112 Connectors Pin AssignmentsCN 3 Analog Input / Output & Counter/Timer 14 ∙ Installation CN 1 Digital Signal Input DI 0CN 2 Digital Signal Output do 0 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-9138 and ACLD-9188 18 ∙ InstallationConnect with ACLD-9185 Registers Format ∙ G i s t e r s F o r m a tI/O Registers Map 20 ∙ Registers Format A/D Data RegistersD/A Output Register 22 ∙ Registers Format A/D control RegisterMode MUX Register Bit8 ~ Bit5 Auto-Scan Bit24 ∙ Registers Format Software Trigger Register A/D Status Register26 ∙ Registers Format Digital I/O registerLow Level Programming Internal Timer/Counter RegisterHigh Level Programming E r a t i o n T h e o r e m Analog Input Signal ConnectionA/D Conversion 28 ∙ Operation TheoremOperation Theorem ∙ Single-ended ModeDifferential input mode 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++ Library ∙ Libraries Installation+ + L i b r a r y 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 Calibration ∙ CalibrationWhat do you need VR Assignment A/D AdjustmentBipolar Calibration Unipolar Calibration2 D/A Channel Calibration D/A AdjustmentReference Voltage Calibration 70 ∙ Software Utility Software UtilitiesSoftware Utility Running the Utility System ConfigurationCalibration Software Utility ∙72 ∙ Software Utility Functional TestingPCI Scan 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