09-24-2006 09:38 PM
09-25-2006 02:50 PM
Greetings Dick,
The NI PCI-6143 only supports On Demand DIO acquisitions. To perform simultaneous sampling on this card, the NI PCI-6143 generates two sample clocks for each digital acquisition. Refer to this KB for more information. Basically, the ADC must use two sample clocks to grab each DIO point. The actual data that is returned is always the correct DIO data because the extra samples are discarded internally...this is handled by NI-DAQmx. The additional sample clocks do not affect single task timing (again it is handled internally by the device's driver), but when you synchronize this task with others, additional considerations must be taken.
To synchronize your DIO and Counter tasks, you will need to perform the Counter task on every other sample clock to sync up with the DIO task.
Hope that helps,
Nicholas B, National Instruments
09-26-2006 07:58 PM
@Nicholas_B wrote:
To synchronize your DIO and Counter tasks, you will need to perform the Counter task on every other sample clock to sync up with the DIO task.
How do I actually synchronize the both of them together? Is there an example that shows this function? My labview version is 7.1.
Thank you very much!
09-27-2006 11:59 AM
Hi Dick,
If you open the NI Example Finder by choosing Help >> Find Examples... you can perform a search for the VI entitled "Multi-Function-Synch AI-Read Dig Chan.vi" Even though this VI does not exactly perform the functions your application requires, it showcases how to perform synchronization between two tasks. The key is that the ai/SampleClock is sent from the AI task to the DI task, so that they share a clock and thus perform actions simultaneously on the same rising (or falling) edge.
Now, to incorporate the nuance of the PCI-6143 noted in my previous post, you will need to perform your Counter task on every other sample clock pulse. One way to do this would be to share the sample clock but specify different rates for each task. For example use 10Hz for the DIO task but 5Hz for the Counter task (you might have to test frequency combinations that are almost a 2:1 ratio to incorporate any additional clock ticks). Another possible solution would be to discard every other data point acquired by the counter task. You can use the iteration terminal of the while loop to monitor odd and even iterations, and only capture data from the counter on even iterations, while you DIO task captures data on every iteration.
Let me know if you have any other questions...
Nicholas B, National Instruments
09-27-2006 09:20 PM
09-28-2006 08:30 AM
09-28-2006 07:50 PM
Hi Nicholas,
Thanks for your time and advice. I will look at the trigger samples.
Thanks again!
Regards,
Dick