LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing two signals simultaneously

Hello all, I am trying to update a very old spectrometer to a digital interface. The signals coming from the instrument consist of two signals. One, is a constant analog pulse--which starts at a reference frequency (0) and then every pulse counts as another nanometer or wavenumber. The other signal varies from 0 to 100mV and represents the intensity (of the y-axis) at each respective wavenumber. I am trying to couple the two signals. The pulse signal (input PFI 0 / AI START) should tell the program when to sample the other, varying signal (currently not varying for testing purposes .22V) in input AI0 . So the first pulse should represent wavenumber 0 and sample the other signal (at whatever variation it is in the respective range). The next pulse should represent wavenumber 1, and sample the other signal (at whatever variation it is in the respective range).....and so on. I have both PCI-6251 and PCI-6220 boards. The Raman Spectrometer is an old 70's SPEX model. I have attached my current program in progress. When I hook up a function generator on a burst pulse sequence to the PFI 0 / AI START input in the Trigger / Counter section (100Hz) and a 9V battery with a resistor (.22V) to the AI 0 Input on my board,.....I get analog data starting to appear in my array, yet no graphing and no accompanying data in the Counter data 2 array. What am I doing wrong? I am new to labview and am a chemist by trade. Am I hooking up the signals correctly to the proper inputs? Is my software code flawed? Help please.
0 Kudos
Message 1 of 2
(2,585 Views)

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:

 

Trigger Pulse for AI.jpg

 

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

0 Kudos
Message 2 of 2
(2,552 Views)