02-03-2011 04:15 PM
02-04-2011 02:11 PM
Zhoulmnk,
It sounds like you are having a problem with the analog out, and it is not outputting the proper data. It would be best if we were able to see your code so I can diagnose this further and find out where the problem is. You can do a test with like a continuous acquire and graph - int clock on dev 1 (AI), and a test panel output on dev 2 (AO) to determine if you are actually sending the correct data as well as if you can read the correct data. This will take your code out of the equation so we decide if its the AO that is the problem or the code that is giving us the issue. You can also use the Multi-Function-Synch-AI-AO.vi from the example finder to use as the basis for you code, and then you can add the DO with the sample clock and have the PFI0 line pipe into a DAQmx timing property node called "Sample Clock -> Source" .
02-04-2011 03:23 PM
02-07-2011 06:11 PM
Zhoulmnk,
I would ensure that the AO channel is properly outputting data before we try to synchronize the two devices. I would check the data output using a digitizer or scope to determine if the AO is actually putting out data. Also, when you say that the Analog In channel didn't read do you mean that there is an error, or you are reading zero values?
Just a warning, when using .m code we cannot necessarily guarantee that our daq cards will function 100% as expected as we would see in Labview, CVI , or .NET. The code is similar to C language code which we are able to provide examples for, but we do not guarantee that this will work as expected since they are using their own drivers to operate with .m code. Listed below is the tutorial for using NI-DAQmx in .m code.
An Introduction to NI-DAQmx Tools for Data Acquisition with The Mathworks, Inc. MATLAB® Software
Frank L.
02-08-2011 08:52 AM
02-08-2011 04:23 PM
02-09-2011 04:39 PM
This delay could be based on the amount of samples that you are reading. If for example you are reading at 10,000 Hz and are pulling 120 samples per iteration then the AI data would not come in until all 120 samples have been read for a total delay of 12ms after the data has been output on the AO channel. How are you measuring this 12 ms delay between the AO and AI? What device is taking in the trigger and what device is giving out the trigger?