_8112Initial (card_number(), type, base_dedress): It must be called first, and the type parameter distinguishes versions (such as A8112BHG, A81122C-DG, etc.). Only two cards (CARD_1/CARD_2) are supported due to limited ISA DMA channels.
_811_2Switch_Card_no (card_number): In a multi card system, switch the current operating card, and subsequent functions apply to that card.
5.2 Simulated Input Functions
_811_2AD_Set_Channel (ch): Select the A/D channel (0-15 single ended, 0-7 differential).
_811_2AD_Set_Sange (range): Set the gain and polarity (such as AD_S_5_V, AD-U_10-V, etc., specific constants can be found in the manual table).
_8111_AD_Set_made (mode): Select the triggering and transmission mode (ADtmoDE_1 software triggering+polling, ADtmoDE-6 timer triggering+interrupt, etc.).
_811_2AD_Soft_Trig(): The software triggers a conversion once.
_811_2AD_Squire (&data): Polling waits for conversion to complete, returns 12 bit data.
_811_2AD_Timer (c1, c2): Set the timer frequency division coefficient, sampling rate=2MHz/(c1 * c2).
_8112AD_DMA_Start (ch, range, dma_ch, irq, count, buffer, c1, c2): Start the timer to trigger+DMA batch collection (running in the background), and allocate sufficient memory in advance.
_8112AD_DMA_Status (&status,&count): Check the DMA progress (whether it is completed and the number of points transferred).
_8112AD_DMA_Stop (&count): Stop DMA and return the actual number of transfer points.
Typical continuous collection code snippets:
_8112_Initial(CARD_1, A8112C_DG, 0x220);
_8112_AD_Set_Channel(0);
_8112_AD_Set_Range(AD_B_5_V);
_8112_AD_Timer(100, 10); //2MHz/(1000)=2kHz sampling rate
_8112_AD_DMA_Start(0, AD_B_5_V, DMA_CH_1, IRQ15, 4096, buffer, 100, 10);
while(1) {_8112_AD_DMA_Status(&status, &count);if(status) break;}
_8112_AD_DMA_Stop(&count);
5.3 Analog Output
_811_2DA (ch, data): Output 0~4095 to the specified DA channel (DA_C_1 or DA_C_2). Low byte data is written first, high byte data is written later (double buffering order has been processed internally in the library).
5.4 Digital I/O
_8111_DI (port,&data): Read low byte (DI_LO-BYTE) or high byte (DI-HI-BYTE).
_8111_DI_Channel (ch,&data): Read the status of the pointing position (0~15).
_8111_DO (port, data): Write low or high bytes to the DO port.
5.5 Timer User Mode
_8111_TIMER_Start (mode, c0): Start counter 0 (mode 0~5), clock source determined by hardware jumper.
_8111_TIMER_Read (&value): Read the current count value.
_8111_TIMER_Stop (&value): Stop the counter.

Calibration process and accuracy maintenance
It is recommended to perform calibration annually or after significant changes in ambient temperature. Required tools: 5 and a half digit digital voltmeter, precision voltage calibration source (or low-noise DC source), and accompanying 8112utilit.exe calibration program.
VR adjustment points (DG/HG version has 6, PG version has 5):
VR1: A/D Full Scale
VR2: A/D Bipolar Offset
VR3: D/A Channel 1 Full Scale
VR4: D/A Channel 2 Full Scale
VR5: PGA offset (reduces amplifier drift)
VR6: A/D unipolar offset (DG/HG only)
Bipolar calibration steps (taking ± 5V as an example):
Input -4.9987V to AI0 (for AGND), adjust VR2 to make the reading jump between 0 and 1;
Input+4.9963V, adjust VR1 to make the reading jump between 4094 and 4095;
Repeat checks and iterate if necessary.
Unipolar calibration (0~10V):
Input+1.22mV, adjust VR6 to make the reading jump between 0 and 1;
Input+9.9963V and adjust VR1 to make the reading jump between 4094 and 4095.
After calibration is completed, records should be saved and the calibration date should be marked in the application. If an external reference voltage is used, additional calibration of the reference source's own accuracy is required.
Common troubleshooting
Fault 1: The A/D reading is always 0 or at full scale
Check if the channel selection register is written correctly (BASE+10);
Confirm whether the polarity of the input signal is consistent with the setting (unipolar input negative voltage will cause truncation);
Check if JP3 matches the actual wiring mode (differential/single ended);
Measure the voltage between AGND and AI0 to confirm that the signal has indeed reached the board.
Fault 2: D/A has no output or fixed output
Check the D/A reference voltage setting (internal/external) and measure the voltage at the VR1/VR2 output terminals;
Confirm the double buffer write order (low first, high later), and if using library functions, there is no need to worry;
Check if the contact of pin CN3 is good (pin AO1 is 30, pin AO2 is 32).
Fault 3: DMA data transfer disorder or system crash
Confirm that the DMA channel is not occupied by other devices (such as disabling DMA3 for onboard LPT in BIOS);
Check if the buffer array is located in regular memory (<1MB) and has sufficient size (ISA DMA only supports low 16MB address space, use _fmalloc or malloc under DOS to ensure physical address continuity);
Confirm that the initial value product of the timer is ≥ 20 (i.e. sampling rate ≤ 100kHz), otherwise it may exceed the ADC capability.
Fault 4: Interrupt not triggered or service program not executed
Confirm that the IRQ jumper is consistent with the software settings (corresponding to BASE+11 mode);