02-28-2007 12:10 PM
03-01-2007 10:25 AM
03-01-2007 12:52 PM
Hi Gilberto,
Thank you for posting to the NI forums. Are you receiving an error during the while loop – if so, what is the error number?
There is a great NI Developer Zone article with examples programs written in C that perform very similar functionality to what you need. Download the 3022.zip file, and check out the ANSI C files.
DAQmx - Simultaneously Started AI/AO - LabVIEW - CVI - ANSI C - VB.NET
From your code, I can see a couple of changes that should probably be made to your program.
I hope this helps – please post back if you have further questions.
Ed W.
Applications Engineer
National Instruments
03-01-2007 02:28 PM
03-05-2007 10:19 AM
03-07-2007 07:25 AM
Hi,
I’m sorry to hear that you’re getting frustrated. Losing samples between iterations of your while loop is expected behavior for finite acquisition. There is no way around losing samples in finite mode if you are using a loop to capture them. If you do continuous acquisition, you shouldn’t lose any samples.
If you do need finite mode, try to capture all of your samples in a single buffer rather than looping to acquire them.
To synchronize the inputs and outputs, route the AI Start Trigger (“Dev1/ai/StartTrigger”) to the trigger source to configure a digital start trigger for your analog output.
int32 DAQmxCfgDigEdgeStartTrig (TaskHandle taskHandle, const char triggerSource[], int32 triggerEdge);
Lastly, it is important to perform proper error handling when writing your code. Unless I’m missing something, it appears that you’re storing the error code in a variable, but never actually checking that variable to see if an error occurred.
Ed W.
Applications Engineer
National Instruments
03-07-2007 10:54 AM
03-08-2007 10:20 AM
Hi,
What is the error number associated with that message – is it -200288? If so, there is actually a Knowledge Base entry that addresses this issue. I’ve placed a link to the article below.
Why Am I Getting Error -200288?
Ed W.
Applications Engineer
National Instruments