I am attempting to simultaneously acquire multiple analog inputs (@ 1kHz) and control digital outputs. I am having trouble getting these two operations synchronized, and could use some feedback. A few details about my application requirements:
1) I must have a calibration loop (left while loop in my VI) for calibrating transducers attached to the analog inputs. The refresh rate on this does not have to be extremely fast.
2) Upon depression of the "Fire" button, the DAS needs to begin acquisition for a user-specified amount of time at a high rate (1kHz). This may include up to 12 analog channels (which creates a throughput bottleneck at the USB protocol level for realtime stuff -- buffering is required, I think).
3) During the acquisition process, the VI also needs to be able to control digital outputs for controlling events. The timing of these events is handled in the left-hand loop in my VI.
I have had problems getting the two channels synchronized (I think that's been fixed for the version I'm posting here). Now, I am having problems getting the digital output to write to the hardware port. I can display the data being sent to the write block within the timed loop (chart output on frontpage), but an oscilloscope reveals, alas, no actual outputs on the digital port. When I run the VI, I get the following error message:
>Error -200462 occurred at DAQmx Start Task.vi:1
Measurements: Generation cannot be started, because the output buffer is empty.
Before starting a buffered generation, write data. Unreserving a task empties the buffer. Changing the size of the buffer or setting the Regeneration Mode property will result in the buffer being unreserved and emptied.
Task Name: _unnamedTask<7>
Any feedback on this topic would be greatly appreciated. Thank you!
Thanks for your post! So I see you are having an error using your digital tasks. (Error -200462 occurred at DAQmx Start Task.vi). It looks to me from your program that you really understand how to use the analog input tasks. However when writting AO or DO lines using DaqMX you have to tell the task what to write before you "start" the tasks. So in your program you have the start vi before you tell the buffer what to write. So in this case the program has nothing in the buffer to output so it throws an error. What I would recommend is take a look at the following link
Also using the example finder (go to help >> find examples) and then navigate in the browse tab to Hardware Input and Output >> DaqMX >> Digital Generation and take a look at some of the example programs here that deal with digital output tasks. Let me know if any of this information helps you and please post back if you have any further questions.