Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronize PCI 6602 and USB 6251

Hi all,

 

Is there any way to synchronize a PCI6602 and a USB6251? If there is, how to do that? The setup is like this: a light source is splitted into two beams, the minor part is detected by an avalanche photodiode which outputs a TTL signal collected by the PCI6602 in an edge counting mode or frequency measurement mode, the major part goes to another photodiode which gives a photovoltage output detected by the USB6251. To correlate these two signals we need a good synchronization. 

 

Thanks a lot!

 

Best regards,

/L

0 Kudos
Message 1 of 10
(4,077 Views)

Hi L

 

One way to do this is to use a counter from the PCI cards to output a signal that you then use to synch the other device with. The USB device then reads it as a external clock signal. Is that a feasible solution for you?

 

Best Regards

 

David NISW

0 Kudos
Message 2 of 10
(4,057 Views)

Thank you, David!

 

I don't have the device with me for the moment but I can try it tomorrow. A question to the output of the PCI card:  do you mean the output pin of the counter which counts the TTL signal or of a separate counter which generates a separate pulse train? Anyway, I'll try it tomorrow and come back here with what I'll find out.

 

Best regards,

/L

0 Kudos
Message 3 of 10
(4,055 Views)

Hi L

 

A seperate one would be best.

 

 

Best Regards

David

 

0 Kudos
Message 4 of 10
(4,053 Views)

Hi David,

 

I tried your suggestion but it didn't work. I used counter2 on the PCI 6602 to generate a pulse train generation and chose the source of the sample clock of the USB 6251 analog input PFI0. A wire connects the output pin of crt2 of 6602 and the PFI0 pin of USB625. Howeve, I got error 200284, some or all of the samples requested have not been acuqired. It seems the USB6251 doesn't see the source of the external sample clock. I also tried to add a DAQmx trigger node and set the Start.DigEdge.src as PFI0 which is wired to the output of counter2 of 6602, but got the same error. What could be the problem?

 

Best regards,

/L

0 Kudos
Message 5 of 10
(4,033 Views)

Hi L

 

The explanation for error -200284 is:

 

"Measurements: Some or all of the samples requested have not yet been acquired.To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger,  make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock."

 

How have you configured the timing nodes in your code? What rates are you using?

 

Best Regards

 

David

0 Kudos
Message 6 of 10
(4,021 Views)

Hi David,

 

I managed to make this work: ctr2 on PCI6602 generates a pulse train with 1ms high and 1ms low time, which is 500Hz, using 20MHz internal timebase, the output pin of ctr2 is wired to PFI0 of USB6251, which is used as external clock for the analog measurement with 10000 sampling rate. The mistake I made was that it wasn't set as continuous mode. 

 

So everything works so far. The coming question is how to merge it in the frequency measurement with PCI6602. I'd like to start this pulse generation while ctr0 of PCI6602 receives the first edge of the TTL signal to 'trigger' the analog measurement by USB6251, hence to synchronize these two measurements. I couldn't set a trigger node for the pulse generation because it is hardware timed according to the error I got. Please see the attached VI. Please don't mind the mess in the front panel, I didn't organize it.Thanks a lot!

 

Best regards,

L.

0 Kudos
Message 7 of 10
(4,007 Views)

Hi L

 

There are some examples for this in the Example Finder under "Hardware Input and Output->Synchronization->Multi Device". They are not for counter measurments, but you can get a good idea on how it works and how to code it from these examples. Have a look at them first.

 

Best Regards

 

David

0 Kudos
Message 8 of 10
(4,001 Views)

Hi David,

 

The problem is solved by setting the sample clock of the pulse generation task as Implicit instead of hardware timing. So this task accepts a digital trigger of which the source is the same as input pin of the TTL signal. In this case, when the counter (lets say, ctr0) on PCI 6602 receives a TTL signal, another counter (ctr2) is triggered and generates a pulse train. The task of analog measurement of USB 6251 also uses a start trigger with the source from PFI0 which is wired to the output pin of ctr2 on PCI 6602. I didn't use it as the source of the sample clock of the AI task since I could change the sampling rate.

 

I took a look at the examples, it's good to know the ways there.

 

Thank you very much for you help, David!

 

Best regards,

L. 

Message 9 of 10
(3,988 Views)

Hi L

 

Good work! Hope everything works out for you.

 

Best Regards

 

David

0 Kudos
Message 10 of 10
(3,973 Views)