Manual Number: 00650-010-6
Page 23
Appendix A: Sample Programs
Sample programs are provided on diskette with the AOBx/16. Sample Program #1 demonstrates
general use of the card. This program prompts you for a voltage, calculates the closest actual
voltage based on the 16-bit resolution of the DAC, and then programs the card to output this volt-
age. Sample Program #1 is provided in QuickBASIC, C, and Pascal.
Sample Program #2 will generate a sine, triangle, or sawtooth output waveform. This program is
provided in QuickBASIC, C, and Pascal. A sample commented listing of the C language version is
as follows (but refer to disk copies for the latest examples):
SAMPLE 2.C
This sample program will generate three different waveforms; sine, triangle, and sawtooth. You
have the choice of base address, DAC number, and the number of points per cycle.
The base address entered during program execution should correspond to that set up on the card.
#include <math.h>
#include <conio.h>
#include <stdio.h>
#include <dos.h>
#define PI 3.1415927
unsigned counts;
/* number of points per cycle */
unsigned baseadrs;
/* card base address */
unsigned dacnum;
/* DAC used for output */
unsigned progstruct[20000]; /* buffer to hold points */
Function:
setparams() - local routine
Purpose:
Prompts the user for DAC number, base address, and number of points per cycle.
Input :
None
Calls:
None
Output:
None
void setparms()
{
clrscr();
printf(“Enter the base address of your card (in hex)\n”);
printf(“(Example: 300 : “);
scanf(“%x”,&baseadrs);
printf(“Enter the DAC number you wish to output to (0 or 1):”);
scanf(“%u”,&dacnum);
dacnum% = 2;
printf(“Enter the number of points that you wish to calculate per cycle,\n”);
Содержание AOB8/16
Страница 1: ...Model AOB8 16 AOB16 16 Product Manual MANUAL NUMBER 00650 010 6C...
Страница 3: ...Page iv This page intentionally left blank...
Страница 7: ...Page viii This page intentionally left blank...
Страница 15: ...Manual Number 00650 010 6 Page 6 AOB8 16 AOB16 16 Manual Figure 3 1 Option Selection Map...
Страница 21: ...Manual Number 00650 010 6 Page 12 AOB8 16 AOB16 16 Manual This page intentionally left blank...
Страница 25: ...Manual Number 00650 010 6 Page 16 AOB8 16 AOB16 16 Manual This page intentionally left blank...
Страница 27: ...Manual Number 00650 010 6 Page 18 AOB8 16 AOB16 16 Manual This page intentionally left blank...
Страница 31: ...Manual Number 00650 010 6 Page 22 AOB8 16 AOB16 16 Manual This page intentionally left blank...
Страница 37: ...Manual Number 00650 010 6 Page 28 AOB8 16 AOB16 16 Manual This page intentionally left blank...