03-19-2008 11:30 PM
03-21-2008 05:50 PM
Hello Keith,
How fast would you like to read and write your values? From your post, it looks like you would like different processes to be able to read and write analog and digital values at varying times. But it also looks like you are only writing or reading one sample at a time. Let me know if this is not your desired outcome.
You could try creating a task that includes all of your digital output lines. Then, you could pass your digital output task name and current output values around to the different processes without closing the task. This way you do not have to reinitialize your task each time you would like to update a single digital value. Each time you would like to update a single line, you could modify the current output set and then call the write function. Grouping your task name and your current output into a single object/class could simplify the code expansion. A similar class could be used for your input tasks as well. By calling the DAQmxBaseReadAnalogF64 several times, you will retrieve several measurements.
As for the continuous acquire, whenever you perform a continuous input task, the DAQ device will constantly be acquiring data to its onboard FIFO. This data is then transferred to the PC buffer. If this data is not transferred fast enough, error -200361 can result. At this point, reducing the sample rate or reducing the number of programs running concurrently can help improve this measurement.
04-10-2008 08:11 PM
My point is that we don't WANT to do continuous acquire. All we need is to sample the CURRENT AI channel values asynchronously with minimal latency. Surely there is a way to do this without starting/stopping a task every time we poll for the channel values, or worse creating a separate thread that does a continuous acquire just so we have the latest value on-hand when asked for it. Are we the only folks asking for the latest AI channel values without caring about a FIFO full of past samples?
As for the continuous acquire, whenever you perform a continuous input task, the DAQ device will constantly be acquiring data to its onboard FIFO. This data is then transferred to the PC buffer. If this data is not transferred fast enough, error -200361 can result. At this point, reducing the sample rate or reducing the number of programs running concurrently can help improve this measurement.
04-11-2008 03:29 PM
04-11-2008 04:00 PM