Manual PCI-DA12-8/16
25
Chapter 7: Software
These cards are straightforward to program. The following example is in C, but sample code is also
provided on the CD in Pascal and four Windows languages: C++Builder, Delphi, VisualBASIC, and Visual
C++.
To output an analog value with 12-bit resolution, a corresponding decimal number N between 0 and 4095
is calculated (2
12
= 4096).
N/4096 = V(out)/V(full scale)
Next the data are written to the selected analog output channel. (See the preceding I/O Address Map.) In
this example, we will assume analog output on channel zero (AO 0).
outport (BASE + 0, N)
For simplicity, it was assumed that the simultaneous-update capability was not used.
Examples of this routine are found on the sample disk along with examples in other languages.