LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing counter and an analog input

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 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.

 

The Raman Spectrometer is a Ramalog 3 or 4 model.

 

The DAQ boards I'm using are PCI-6251 and PCI-6220.

 

I am attempting to synchronize a counter function and the variable analog input. I need my counter function to sample the variable analog input signal at a rate determined by the constant analog pulse. Here is what I have so far, but I know the wiring and user inputs are off---since I am a very new to labview.

 

Would someone perhaps offer suggestions--specifically with the wiring of the sample clock and synchronization of the two signals?

 

Much appreciated.  

0 Kudos
Message 1 of 7
(4,309 Views)

Hello ProgChem,

I am not clear on "I need my counter function to sample the variable analog input signal at a rate determined by the constant analog pulse." Can you please elaborate  more on this.  I did look at the code and I see you are using two different driver the Counter task is configured in NI-DAQmx driver and the AI is on the Legacy NI-DAQ driver. Since you are using two M-Series DAQ card they support only NI-DAQmx. I have few questions for you

1. Do you want to count edges of the analog signal (I assume that the input signal is TTL compatible) and synchronize analog input on other AI channel?

2. You want to generate pulse using counter which can be used as the AI Sample clock for AI task?

3. Or you want to count egdes of the analog signal and perform analog input, but the sampling rate for that AI channel is determined by the analog pulse period or amplitude?

 

There are built in example for multifunction synchronization in LabVIEW example finder. You can find them at Hardware Input and Output>> DAQmx>> Synchronization>>Multi-Function.

 

Thanks

nAyer

Message 2 of 7
(4,272 Views)

Did I understood you well?

1)      The first signal gives a pulse of x V, y ms (what amplitude, what period?) on every wavenumber. So you get a first pulse on the ref frequency of for example 1000Hz, then another on 1001Hz another on 1002Hz and so on. Is that it? I call this signal the “trigger line” further on.

2)      The second channel is an analogue signal ranging from 0 to 100mV. That signal holds valuable information at the time of each pulse, right? One question here: What voltage do you have on this line between two pulses. I call this signal the “data line” further on

3)      You want to record the value of the “data line” on each pulse of the “trigger line”. The value of the “data line” between two pulses of the trigger line doesn’t interest you.

Is that it? 

 

Then we need to know what the trigger line is. Is it digital 5V TTL line like nAyer supposed or not?

If that is the case you need something like the “Acq&Graph Voltage-Int Clk-Dig Start.vi” from the examples. This examples acquire a finite number of samples on every digital edge. 

 

If the trigger line isn’t a digital one you have several options that can be discussed once we know what type of signal it is. 

 

Either way I don’t see why you nee two cards to this.

All of this can be handled by the 6251, depending on the speed of the signals even the 6220 can do the job. 

So try to do it with the 6220 and send me the 6251 Smiley Very Happy

Message 3 of 7
(4,264 Views)

Ok, so I modified my code, but am still not there yet.

 

Here is a better description of what I am trying to accomplish:

 

The spectrometer is giving off two signals. One is a constant analog pulse (where I receive my x-axis info). The # of pulses per unit time may change. But, the actual frequency of the wave-like signal will not change.  So, from this signal, I need to determine at what frequency I am sampling (my other AI voltage) at any given time.  I will start at a reference frequency (eg. 0 cm-1) and then every (lets say 2 pulses), I then sample my AI voltage. This would mean that every 2 pulses would correspond to 1 x-axis unit (cm-1), and I would then sample the variable AI voltage input every cm-1 (or every 2 pulses). I am not measuring the frequency of the constant analog pulse signal. I am determing the frequency of the AI variable voltage I am sampling (from the # of pulses that have occured), at any given time. I need no info from the constant analog pulse other than: 1. Determining how many pulses correlate with a single unit on my x-axis (wavenumbers or cm-1) (This will probably be done by me, through experimenting with the final program). 2. Writing a program which can correlate (for example every 1 or 2) pulses with a single x-axis increment. 3. Taking a sample of the other AI variable volatage at every x-axis increment. 4. Plotting the corresponding x and y points in an x/y graph, as well as an output array of X (wavenumber) and Y (intensity) values.

 

Thanks in advance for all of your help. I am using Labview 7.1.

 

Regards,

 

John

 

My latest code:

 

 

0 Kudos
Message 4 of 7
(4,233 Views)

Hello Alain S,

 

Thank you for your interpretation and advice.

 

To answer your questions:

 

1) Yes, just make sure you understand that the analog pulse signal yields no inherent frequency information. It is only used to determine the frequency of the other AI variable voltage at the time it is sampled. The AI varibable voltage starts at a reference frequency and then moves up in frequency which can be characterized by the constant AI pulse.

 

2)Yes, you are correct about the data line. I do not think the voltage I have on this line between pulses is of high importance. For now, I am just trying to yield a resolution which corresponds to one y-axis point determined at every x-axis (pulse).

 

3) Yes. This is exactly what I want to do.

 

From what I have empirically measured, the trigger line consists of an on or off analog signal (pulse). There are two pins on the serial port I have measured with a voltmeter, which correspond to the trigger line signal. One is 100mV. The other is -60mV. I don't understand why a -60mV is needed. I'm assuming that the 100mV pin is what used to drive the motor on the old strip chart recorder that was used back in the 70's (each 100mV pulse would move the knob on the chart recorder one turn and therefore correspond to moving 1 unit on the x-axis (wavenumber). 

 

The data line ranges from 0 to 250 mV.

 

Does this help in the concept?

 

Would you still suggest the same examples or any other code?

 

Oh, and I wasn't going to use both boards, I was just letting you all know what I have available.

 

Thanks,

 

John

 

Oh, and here is my most updated VI. 

0 Kudos
Message 5 of 7
(4,231 Views)

I think that "Acq&Graph Voltage-Int Clk-Analog Start w Hyst.Vi" from the examples is a good point to start.

Analogue trigger is of course your "Trigger line" and should be connected to APFIO line of the board.

 

This way ALL pulses of the trigger line will be recorded, if you want only 1 pulse every x pulses, you have to skip those in code.

But, first try the above mentioned vi then modify it so that it fits you needs 🙂

 

One thing bothers me 😞

You wrote : "There are two pins on the serial port I have measured ..."

What do you mean by "serial port" I hope it isn't a serial RS232 port?!?

 

 

You planned to use only 1 board, so you can send me the 6251 Smiley Very Happy Smiley Tongue

0 Kudos
Message 6 of 7
(4,219 Views)

Instead of trying to explain both signals to us, can you capture, let say 50.000 points of both signals that represents a complete measurements? I think that those points in a graph, will explain more than 1000 words 🙂

0 Kudos
Message 7 of 7
(4,212 Views)