01-19-2010 03:42 PM
01-20-2010 01:16 PM
Hello,
First of all, I would like to say your code is pretty good for a chemist that's new to LabVIEW. Now, on to my questions.
There are a couple of things that I would like to verify with regards to how your signals correlate. First of all, is the pulse signal simply supposed to be a trigger for the AI channel to say "now read X values?" I was thinking something similar to the followinng image:
If this is the case there are a couple of things that you can do to clean up your code. First of all, since your AI channel is clocked with the AI sample clock, your X axis on your graph is going to continue to be set based on the data you read from the DAQmx read VI of the AI channel. This should be ok, since each DAQmx read should return a new set of data that corresponds to a new wavenumber.
In order to perform this task effectively with higher frequency pulses, you'll have to model your appilcation after an example program we ship called Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock.vi which can be found in the NI Example Finder at the folder location Hardware Input and Output»DAQmx»Synchronization»Multi-Function. The reason this is going to be necessary is because the counter can re-arm its trigger in hardware time, whereas the AI task has to stop and start again for the trigger to be reset. Another thing you'll have to remember for this VI is that the AI task is continuous, so you will have to set your "number of samples to acquire" input on your AI task to be some finite amount, if you want to keep a consistent number of acquired samples for each trigger (similar to my picture above).
Now, I certainly may be misunderstanding what exactly you want, so if I am incorrect please let me know and we can observe other possibilities. Thanks for posting!
Chris W