LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI A0 Synchronization

Solved!
Go to solution

Good morning,

I am using LabView DAQ assistant with NI PXIe-1082 to measure voltage signal from two channels (AI0 and AI1) on NI BNC-2110 board. AI1 is connected to the "input" actuator (via T-connection) and AI0 is connected to the "output" sensor. I send a Gaussian modulated pulse as the "input". I want to measure the delay (time shift) between the input and the output signal peaks (center line of each signal packet). I need to measure delays of the order of 10 microseconds. I send signals using DAQ Assistant, and write AI0, AI1 measurements using "Write to measurement file." (See attached VI, picture of my interface, and excel file of data).

I have the following questions:

1. I want to send only one Gaussian modulated pulse. Why do I see multiple signals sent by the actuator? (Red lines in the picture)

2. Do data measurements from AI0 and AI1 start at the same time (within, say, 1 microsecond of each other)? That is, do the first entries for AI0, AI1 voltage written in my excel file correspond to the same wall clock time (difference less than 1 microsecond)?  The time stamp provided by the WriteToMeasurement function gives accuracy only up to 1 millisecond. My sampling frequency is 3MHz, and I see the same "time" for multiple samples.

Thanks in advance for your help.

0 Kudos
Message 1 of 9
(4,130 Views)

Without some code to have a look at how you are approaching this in code, trying to answer the question is almost certainly futile.

0 Kudos
Message 2 of 9
(4,128 Views)

1. You've named your chassis (PXI-1082) and terminal block (BNC-2110), but not your data acquisition device.  We'll need to know that.  

 

2. We'll need you to post your code and supply further info about any other "code substitutes" like all the DAQ Assistant config information.

 

3. Your test and analysis sound like they deserve better treatment than the "training wheels" of the DAQ Assistant and Write to Measurement File.  Training wheels have their place, but they're meant to be grown *out* of before you hit the road for real.

   I have almost no familiarity whatsoever with most of those kinds of functions.  It's possible they can be configured in ways that get you the results you need today.  But in the longer run, it'll be worthwhile to learn to use the regular DAQmx functions.

 

4. All that being said, if both AI0 and AI1 are in a 3 MHz sampling task on the same DAQ device, then both will be sampled every 1/3 microsec.  The time skew between them can't be more than 1/6 microsec.  

 

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 3 of 9
(4,096 Views)

Good morning, 

 

I have attached the code below along with and excel spreadsheet of the output from the write to measurements file. 

 

I will address the other comments in a bit. 

 

-Mike

Download All
0 Kudos
Message 4 of 9
(4,078 Views)

Good afternoon, 

 

I have tried to reconfigure my vi (vi2) with a DAQmx set of functions in hopes that I could reproduce the same waveform graph in the front panel of the vi (vi1) that uses DAQ Assistant. However, I am not able to get the same signal in the front panel. (See vi1_Front_Panel and vi2_Front_Panel attached below). I have attached both vi1 and vi2 below. Could someone tell me what I have configured wrong that is causing me to get two different signals? 

 

NOTE: I am only trying to reproduce the 'white line' (ai0) in the bottom left figure from vi1_Front_Panel in vi2_Front_Panel. Please ignore the other lines in the bottom left figure in the vi1_Front_Panel.

 

Best, 

Mike

0 Kudos
Message 5 of 9
(4,070 Views)
Solution
Accepted by topic author Michael.D

Looking over the code & pics from msg #5:

 

1. vi1 using DAQ Assistants sets both AO and AI sample rates at 3 MHz.  Dunno your device, I'm assuming for the time being that it's capable of this rate.  It also sets both AO and AI for finite sampling with 6000 samples.

 

2. vi2 using DAQmx functions seems to set both AO and AI sample rates at 1 kHz.   At least those are the default values on the front panel controls for the sample rates.  It also sets both AO and AI for finite sampling with 1000 samples.

 

3. vi2 doesn't wire up as many of the inputs to the Gaussian Modified Sine Wave function.  It appears that the extra ones wired in vi1 are wired with default values anyway, so this is not the immediate problem.

 

4. "Write to Measurement File" has an "Advanced..." button that may let you specify greater precision in the timestamps.  Just add extra 0's to the right of the decimal in the format specifier.

 

5. Nothing syncs your AO and AI tasks in either vi1 or vi2.  I *think* you're using one of your AI channels to measure the AO signal though, is that right?   If so, then the important thing is that AI will be ready to sample before AO starts to generate.

   vi2 starts the AO task before starting the AI task.  In vi1, there's no telling what the order is.

 

I made some minimal mods to your vi2 and kept using standard DAQmx functions.  I changed default values to 3 MHz sample rate and 6000 samples, sequenced the AI task to start first, and configured the AI task to sample by sharing the AO sample clock signal.  That's about it.  Give it a try and see what you get.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 6 of 9
(4,052 Views)

Thank you so much for your help. I am now getting the desired signals from the output (measured signals). I have marked the response in msg #6 as the solution. 

 

Now to address/answer your questions: 

 

1. The DAQ device is the NI PXIe-6124 with a NI PXIe-1082 as the DAQ chassis. 

 

2. In vi2, I had to manually change the default settings because I did not know how to change them permanently.   

 

3. The inputs to the Gaussian Modified Sine Wave function were not placed intentionally. They are not really necessary in this case because they are not being changed. 

 

4. The "Write to Measurement File" will be added to vi2 in the near future. I will try to adjust the time format in the way you suggested. 

 

5. For my synchronization, I have a trigger hardwired into my DAQ board. This ensures that the tasks in vi1 start at the same time. The AI channels are indeed being used to measure the AO signal. 

 

I have some additional questions about how to further modify this vi but I will post them on a different thread. 

Thank you again for your help. 

 

Best, 

Mike

0 Kudos
Message 7 of 9
(4,041 Views)

3 quick points:

 

- you mention having a trigger wired in, but I don't recall the code showing any sign of tasks being configured to *use* a trigger.  (Not at a LV machine to double check right now)

 

- you probably won't *need* a trigger anyway.  My mod will already sync via sample clock alone.  By far that's my preferred way to sync tasks.  It's been a while since I investigated but as I recall, the timing delay from trigger to A/D or D/A conversion varied more from device to device than the timing delay from sample clock signal to conversion.

 

- your device is capable of simultaneous sampling.  The nominal time skew between them will be 0.  Some tiny amount of +/- timing jitter probably exists in the nanosec realm, but the best estimate for it will be 0.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 8 of 9
(4,025 Views)

- From my understanding, DAQ assistant automatically triggers the signal. 

 

- With this new vi, a trigger was not needed. I was able to use the modifications that you suggested. 

 

- I have noted the capabilities of our device. 

 

Thank you again for your help. 

-Mike

0 Kudos
Message 9 of 9
(3,995 Views)