Converting A Voltage To A Twos Complement Code; Error Conditions - Data Translation DT9812 Series User Manual

Table of Contents

Advertisement

Converting a Voltage to a Twos Complement Code

To convert a voltage into a twos complement code on the DT9812-10V, DT9812-10V-OEM,
DT9812A, DT9813-10V, DT9813A, DT9814-10V, or DT9814A module, use the following
formula:
Code = Voltage (20 / 4096)
where,
• 20 is the full-scale range of the module (-10V to +10V)
• 4096 is the resolution (12 bits)
• Voltage is the analog output voltage
• Code is the raw count used by the software to represent the voltage in binary notation
For example, if you want to output a voltage of 5 V, determine the code as follows:
Code = 5/ (20 / 4096)

Error Conditions

The modules can report an underrun error if the data for the analog output channels is not
sent fast enough from the host computer. It is up to the host application to handle this error
either by ignoring it or by stopping the output operation.
To avoid this error, try slowing down the clock rate, increasing the output buffer size, or
allocating more output buffers.
Note: If no new data is available to be output by the analog output channels, the last value
that was written to the analog output channels continues to be output.
=
1024
Principles of Operation
69

Advertisement

Table of Contents
loading

Table of Contents