To output (e.g. with the d/a converter) via the digitize routines, one must first load the
instruNet data buffers for the output channels with output data before telling instruNet
to start digitizing. And if you are using a DRIVER RAM buffer (i.e., you are passing 0L
as the buffer address to AddToChannelList_32or64()) then you must tell instruNet to create that
buffer before loading it with data.
For an example of how to simultaneously input and output, continuously, at high
speeds, using the digitize system, please see
HighSpeedSimultaneousInputAndOutput() in file Inet_Ex1.c . Here,
GetOutputSegmentBuffer_32or64() and SubmitOutputSegment_32or64() are used to continuously feed
the output buffers. In this case, the output stream can be a function of the input stream
(e.g. a PID feedback loop), and one could run indefinitely with constantly updated
output data.
For an example of how to preset the output buffer, and then tell the system to output
that data and digitize at the same time (yet not reload the output buffer during
digitization), please see the example in file iNet_Ex3.c, where Ch3 Vout, an output
channel, is preloaded with data, and then output while Ch1 Vin and Ch4 Vin are
digitized. In this example, the output data is not a function of the input data, and the
same output data is presented at each scan.
Another technique is to use the simple scalar Read/Write channel routines (not the
Digitize routines) to input and/or output data. Here, one value is transferred per
subroutine call. These r/w routines can be placed into a subroutine that is driven by an
interrupt that fires at a constant rate. The instruNet read/write routines consume approx
100μs for each read/write (unless there is input channel integration, in which case, the
return time is the time of the integration), therefore; interrupt rates of once every ≥
10ms (i.e. <= 100s/sec/ch sample rate) are reasonable.
For more information on the differences between high speed digitize and single value
read/write, please see I/O Modes.
For information on inputting and outputting with DasyLab, please click here.