Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ vs. Digitizer for high-speed control?

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

 

0 Kudos
Message 1 of 6
(3,623 Views)

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. 

 

Synchronize Analog Input and Digital Input Channels Using DAQmx

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,

Kaitlin N.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(3,603 Views)

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

0 Kudos
Message 3 of 6
(3,591 Views)

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.

0 Kudos
Message 4 of 6
(3,585 Views)

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?

0 Kudos
Message 5 of 6
(3,544 Views)

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?

 

M Series Correlated Digital Input with Analog Input Sample Clock in ANSI C

http://zone.ni.com/devzone/cda/epd/p/id/4488

 

Regards,

Kaitlin N.
National Instruments
Applications Engineer
0 Kudos
Message 6 of 6
(3,528 Views)