02-20-2013 03:24 PM
I would like to have a control system that reads one analog input, and updates another piece of hardware: a spacial light modulator(SLM). The SLM can update at about 10kHz, and I would like this to be the limiting piece of equipment, but right now I am limited by reading data from my analog input source. Would using a digitizer let me increase the speed of this control system?
I am currently working with a PCI-6250 DAQ card. The problem is that even writing in C with the NIDAQmx library, there is still a long delay when calling the DAQmxReadAnalogF64() command against the card. Calling this command repeatedly shows about a 5kHz maximum loop rate using a good PC. I understand that I will not be able to get 1MS/s with this method, but there must be a way to do better than 5kS/s.
Would a low end digitizer give me a better solution?
The program must:
1) read 1 analog value
2) update the SLM based on that value
3) repeat 1,2
It is important that I know the value came after the update, so I would be open to either a software triggered acquisition, or a memory address that is constantly updated that I could check.
Thank you for your help on this,
Chris
02-21-2013 03:17 PM
Hi Chris,
I would like to see the code, however it appears that you may currently be using a software timed acquisition. When running a hardware timed acquisition you will be able to acquire at a much higher rate. Something similar to this example may be useful to you, however you would need to change the digital input task to a digital output task.
https://decibel.ni.com/content/docs/DOC-12185
Please let me know if you have any questions over this and I will be happy to help.
Regards,
02-22-2013 07:24 AM
I appreciate the help, but can you please check the link?
I get a "system error" when I try to view the document you recommended.
Thanks,
Chris
02-22-2013 09:59 AM
The link works for me but it won't do you much good since it uses LabVIEW. Kaitlin does make a good point about your data acquisition method. Single point/software timed acquisition is slow and subject to a great deal of jitter. To acquire single points at a higher and more deterministic rate, you would probably have to use a real time OS.
03-06-2013 08:00 AM
I am looking for better performance, but I don't need a real-time system. I can tolerate some jitter, I would just like to improve the average iteration time of taking a measurement, and updating some output based on that measurement.
I am sure I am not the first person who has just wanted to increase performance of a loop like this. The problem is that everyone suggests moving to a real-time system, but it is not obvious to me that this would help. Have you seen a significant performance improvement from a real time system?
03-07-2013 08:11 PM
Hi Chris,
I didn't realize that you were using C. Here is an example in C that does hardware timed synchronization. You may take a look at this to compare with your current code. What are you using for the sample clock for your current tasks?
http://zone.ni.com/devzone/cda/epd/p/id/4488
Regards,