D/A interrupt operations are affected by only one parameter: recycle vs. one-shot. No Diamond Systems boards currently contain a FIFO or other hardware buffer for D/A operations. Each interrupt will output a single point to each specified channel. The application program simply builds a buffer containing the output waveform and then passes it to the function. In one-shot mode, the buffer is output a single time and then the function terminates. In recycle mode, the buffer is output repeatedly until the user calls
dscCancelOp().
The D/A interrupts are actually ran on timer interrupts. The calling application needs to specify the rate at which the timer interrupt is generated and the ISR for the D/A ( timer ) interrupt will output the dacodes supplied by the user application in sample_values buffer as described above.
The calling application needs to fill up the DSCAIOINT structure with the following parameters...
- num_conversions = Specify the number of da outputs you want to generate.
- conversion_rate = The frequency at which the interrupt needs to be generated so that the ISR will send one set of values to the specified channels before returning.
- low_channel, high_channel = The channels on which the DA outputs will be sent. For all the current DSC boards, there are maximum of 4 DA channels available.
- sample_values = A buffer which the calling application needs to fill up with the dacodes for upto num_conversion number of samples. Each value will be a 2 byte number which will represent the dacode to be output on the channel.