typedef struct tagPT_FAOScale
{
INT16U chan;
INT32U count;
FP32 *VoltArray;
INT16U *BinArray;
} PT_FAOScale, * LPT_FAOScale;
PT_FAOScale is used in function DRV_FAOScale.
| Name | Direction | Range | Description |
| chan | input | 0-(N-1) (N is the maximum channel number and depends on the hardware) | Number of the channel being sampled. From a minimum of zero for the first AO channel to the maximum AO channel number minus one. For example, the range is from 0 to (N-1) on a device with N AO channels. |
| count | input | 1-65536 | The sampling data count. It must be above zero, an even number (because of memory alignment and performance), or a multiple of half the FIFO size if FIFO is used. |
| VoltArray | input | The output range of the hardware | The pointer to the float-point input data buffer. |
| BinArray | output | default | The pointer to the binary data converted from voltage
values. If the buffer pointed by the VoltArray stores the float voltage value OutputValue, and the buffer pointed by the BinArray stores the binary data BinData, then BinData = MaxCount * (OutputValue-MinVolt) / (MaxVolt-MinVolt). The MaxCount is the maximum count. If 12 bits are used to store the float value OutputValue, then MaxCount = 2^12 = 4096. The value of MaxVolt and MinVolt depend on the hardware and GainCode. For example, if the voltage range is from -5V~+5V, MaxVol=5v and MinVolt=-5v, should the user want to output data of -2.5v, then BinData = 4096 * (-2.5-(-5))/ (5-(-5) = (10000000000)bin. This function makes it possible to convert the float value -2.5 into the binary value (10000000000)bin. |