LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize 2 USB-DAQ devices, Analog IN, Frequency IN, Digitally triggered

Hello,

I want to perform the following measurement on two USB-6211 devices, LV 2012:

 

I need to

1) read (cont.) all 16 analog input channels of Dev1

2)  read( cont.) 2 analog input channels of Dev2

3)  perform a frequency measurement with Dev2

4) synchronize 1-3

5) start the Measurements with a trigger (light barrier)

 

1) and 2) are not the problem. Also synchronizing them is fine. But I am not sure if my attempt to synchronize all this with the freq measurement, as this is done over a certain period of time. So, as I understand, when I select the method "high frequency with 2 counters" I can specify the measuring time. So I think I need to tell labview somehow which point of time of this span shall be synchronized with the analog input.

 

I attached a first try and am thankful for any hints.

 

Thanks, Jack

 

0 Kudos
Message 1 of 4
(2,496 Views)
The basic problem here is conceptual. What does it mean to "synchronize" a time domain measurement with a frequency domain measurement? You can certainly can (and should) identify the set of time domain measurements that went into the calculation of the frequency measurement, but that's about the thinnest you will be able to slice this bologna.

Having said that, I can't look at your code right now but I assume you are reading data in blocks from the DAQ. You could perform the measurement for each block you read. That would naturally associate the measurement with the data it was based on.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,483 Views)

Thank you.

I understand the problem, so I think I just can get "as close as possible" so sync. measurements. I like your idea, at the same time, I dont know how I would program that.

I attached a fist attempt. NOT synchronizing the freq measurement, everything works fine. Both devices are synchronized and triggered by a digital signal.

 

So, now its on to geht the frequency data, "as sync as possibile", again, I dont really know how to implement this.

 

Thanks for any help.

0 Kudos
Message 3 of 4
(2,467 Views)

Hi Jack,

I found another Forum thread regarding your problem:
http://forums.ni.com/t5/NI-Applications-Engineers/Synchronize-analog-input-and-digital-frequency-mea...

Their approach is to divide the aiSampleClock to whatever frequency you need. Afterwards it can be declared as the sample clock for the frequency measurement.
Following the above link you can also find an example showing how to divide the sample clock using DAQmx.
I haven't had the chance yet to test this approach, but once I have more information I will let you know.

Best Regards
Christian

Christian
CLA, CTA, CLED
0 Kudos
Message 4 of 4
(2,368 Views)