Advantech PCI-1718 Series user manual Example Code

Page 48

Example Code:

/********This code supports TurboC 3.0 or later versions********/ #include <stdio.h>

#include <DOS.h>

#define AD_NO 4096; // Number of Samples int base_addr;

void main(void)

{

int ad_lb,ad_hb; //Declaration int i;

int eoc;

/****** Access your base address ******/

//Add your code here /*******************************************/

outportb(base_addr+0x02,0x00); //Set Channel 0 outportb(base_addr+0x01,0x00); //Set A/D range outportb(base_addr+0x02,0x11); //Set Channel 1 outportb(base_addr+0x01,0x01); //Set A/D range outportb(base_addr+0x02,0x10); //Scan Channel 0-1 outportb(base_addr+0x09,0x00);

while(i<AD_NO){

 

outportb(base_addr+0x00,0);

//Software Trigger

do {eoc=inportb(base_addr+0x08);

 

eoc=eoc&0x01;//Get EOC}

 

while(eoc!=0); //Check EOC ad_lb=inportb(base_addr+0x00);// A/D LowByte

ad_hb=inportb(base_addr+0x01);// A/D HighByte i++;

}

}

PCI-1718 Series User Manual

40

Image 48
Contents PCI-1718 Series Bit Multifunction Cards with Universal PCI BusCopyright Acknowledgements Product Warranty 2 years Safety Precaution Static Electricity Technical Support and AssistancePacking List Contents Appendix Specifications Appendix D Calibration Viii Introduction PCI-1718HDU/HGU is register-level- pro Features PCI-Bus Plug & PlayAutomatic Channel/Gain Scanning Onboard Programmable Timer/Counter BoardID SwitchApplications Onboard FifoInstallation Guide Installation Flow Chart Software Overview Programming choices for DA&C cardsDevice Drivers Register-level ProgrammingDevice Driver Programming Roadmap Programming ToolsTroubleshooting Device Drivers Error Programming with Device Drivers Function LibraryAccessories Wiring Cables PCL-10120Wiring Boards PCL-10137Installation Unpacking Driver Installation SETUP.EXE on the companion CD-ROMSetup Screen of Advantech Automation Software Hardware Installation InstallationDevice Setup & Configuration Setting Up the DeviceConfiguring the Device Device Setting Dialog BoxTest Utility Dialog Box Signal Connections Switch and Jumper Settings OverviewSetting the BoardID Switch SW1 Board ID Setting SW1Channel Configuration, S/E or Diff SW2 Summary of Switch SW2 SettingsSummary of Jumper JP11 Settings 3 D/A Reference Voltage, int./ext. JP11Summary of Jumper JP10 Settings Internal Voltage Reference, -10 V or -5 V JP10Timer Clock Selection JP8 Summary of Jumper JP8 SettingsDigital Output, 20-pin or 37-pin Connector JP1 Summary of Jumper Settings6 Ext. trigger and Counter Gate 0 Control JP5 JP1 first Setting the Time to Reset Digital Outputs JP21 Jumper SettingsSignal Connections Pin Assignment1 I/O Connector Signal Description I/O Connector Signal DescriptionsAnalog Input Connections Single-ended Channel ConnectionsDifferential Channel Connections Correct Connection Incorrect ConnectionExpanding Analog Inputs Analog Output Connection Analog Output ConnectionsDigital Signal Connections GND D.GNDField Wiring Considerations Page Programming Guide Programming with the Driver Register ProgrammingSoftware Trigger and Polling EOC=0Example Code Pacer Trigger Mode with Interrupt ISRExample Code Page Enable Pacer Trigger Mode with Interrupt and Fifo Add you code here Clear System Interrupt*****/ Add you code here Add your code here Programming with LabVIEW and ActiveDAQ LabViewActiveDAQ Page Specifications Appendix a Specifications Analog InputAnalog Output Digital InputCounter/Timer Digital OutputGeneral Page Block Diagrams Appendix B Block Diagrams Register Structure & Format Appendix C Register Structure & Format I/O Port Address MapTable C.1 PCI-1718HDU/HGU Register Format Part Table C.2 PCI-1718HDU/HGU Register Format Part Table C.3 PCI-1718HDU/HGU Register Format Part A/D Data and Channels BASE+00H~01H Software A/D Trigger BASE+00HTable C.5 Register for Software A/D Trigger A/D Range Control BASE+01H PCI-1718HDUG3 and G2 are not used for PCL-818L MUX Scan Channel Control BASE+02H Table C.7 Register for MUX Scan Channel ControlProgramming example for PCI-1718HDU MUX Scan Channel Status BASE+02H Digital I/O Registers Base + 03/0BHTable C.8 Register for MUX Scan Channel Status Table C.9 Register for Digital OutputD/A Output BASE+04/05H Table C.10 Register for Digital OutputTable C.11 Register for D/A Output Fifo Interrupt Control BASE+06H Table C.12 Register for Fifo Interrupt ControlClear Interrupt Request BASE+08H 12 A/D Status BASE+08HTable C.13 Register for Clear Interrupt Request Table C.14 Register for A/D StatusMUX 13 A/D Control BASE+09H Table C.15 Register for A/D ControlTimer/Counter Enable BASE+0AH Programmable Timer/Counter BASE+0C~0FHTable C.16 Register for Timer/Counter Enable Clear Fifo Interrupt Request BASE+14H 17 A/D Data and Channel from Fifo Base + 17/18HTable C.17 Register for Clear Fifo Interrupt Request Table C.18 Register for A/D Data and Channel from FifoFifo Status BASE+19H Fifo Clear BASE+19HTable C.19 Register for Fifo Status Table C.20 Register for Fifo ClearRegister Programming Flow Chart Software Trigger Mode with PollingPacer Trigger Mode with Interrupt Pacer Trigger Mode with Interrupt Fifo Used Page Calibration Appendix D Calibration VR Assignment Figure D.1 PCI-1718 VR AssignmentA/D Calibration Outputs is recommendedD/A Calibration

PCI-1718 Series specifications

The Advantech PCI-1718 Series represents a robust solution in the realm of data acquisition and control, designed to meet the demands of various industrial applications. This series is a prominent choice for engineers and system integrators looking to implement effective data monitoring and analysis in real-time conditions.

One of the notable features of the PCI-1718 series is its ability to handle multi-channel data acquisition, supporting up to 16 analog input channels. This capability allows for the simultaneous recording of multiple signals, which is critical in applications requiring comprehensive data analysis and monitoring. The device presents a sampling rate of up to 200 kHz, ensuring that even fast-changing signals are recorded with high fidelity.

The PCI-1718 Series also integrates 16-bit resolution for analog inputs, delivering precision that is essential for high-quality measurements. This level of resolution is particularly beneficial in industries such as medical instrumentation and scientific research, where the accuracy of data can significantly impact outcomes. Additionally, the device supports various input types, including voltage and current signals, making it adaptable to multiple sensing solutions.

In terms of connectivity, the PCI-1718 series is compatible with an array of I/O modules, enhancing its versatility. It supports both differential and single-ended input configurations, allowing users to select the most suitable measurement technique for their applications.

The series boasts built-in support for digital I/O and counters, facilitating the integration of control signals alongside data acquisition tasks. With 8 digital input lines and 8 digital output lines, the device allows for straightforward control over peripheral devices.

Advantech equipped the PCI-1718 with comprehensive software support, including drivers for popular programming environments, such as Visual Studio, LabVIEW, and MATLAB. This broad compatibility ensures that users can easily implement the hardware in their preferred software environments.

Another critical characteristic of the PCI-1718 Series is its robust design, featuring a low-profile PCI form factor that makes it suitable for various computer systems without compromising on performance. Its stable operation under fluctuating environmental conditions is facilitated through advanced engineering and high-quality components.

In conclusion, the Advantech PCI-1718 Series stands out with its multi-channel capabilities, high precision, extensive connectivity options, and solid software support. These features make it an exceptional choice for professionals in need of a reliable data acquisition system that can handle diverse and demanding applications efficiently.