Manual PCI-DA12-2/4/6
18
Chapter 6: Software
These cards are straightforward to program. The following example is in C, but sample code is also
provided for use in DOS in C, and Pascal, and four Windows languages: C#, Delphi, VBasic, and
VisualC.
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.