From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire signal with constant phase in daqmx with external source

Thanks, Kevin P

 

For your clarity,

Iterations - My application has to run continuously. This loop can be stopped either by the time limit (in seconds) or user input (Stop). Consider my application approximately runs for 5minutes with loop iteration time will be less than 20ms. 

 

I have to run and display the result online. So the post-processing option was not available in my application.

0 Kudos
Message 11 of 28
(952 Views)

Thanks Henrik

 

Let me clear you that my final source will not be an AO channel from my multifunctional DAQ card or any external AWG. This is a trial to achieve the user requirement with actual DUT.

 

I faced an issue with DUT. So I started working with a simulated signal(same as DUT output) with either AO or AWG. And I don't have any reference signal/CLK to start triggering my acquisition from my DUT. 

 

As you mentioned about the driver issues of DAQ, I'll update my DAQmx driver >19.5 version.

 

I am using 1.5m RG316 from DUT to SCB68. As you said about the delay, I'll check even mine to get a clear time delay.

 

Thanks,

Boopathy Raja S

0 Kudos
Message 12 of 28
(948 Views)

Hi Mcduff

 

Thanks for sharing your ideas with the reference document. I'll look into it to get solutions. 

0 Kudos
Message 13 of 28
(948 Views)

Hello Kevin

 

Thanks for your suggestions. I'll try to find some solution where your suggestions are useful in a crisis situation. 

 

Post-Processing: I understood your idea in this reply. In previous, I replied about processing the value after completion of the test. 

 

Thanks,

Boopathy Raja S

0 Kudos
Message 14 of 28
(944 Views)

Hi mcduff

 

Thanks for your reply.

 

FWIW, I'll follow up on the reference document brought here.

 

How come will it help me to acquire the signal in a constant phase repeatedly? Is there any provoke available after measuring phase using Phase Sensitive Detection to acquire the signal in the constant Phase?

0 Kudos
Message 15 of 28
(940 Views)

Way back in the first post, you said you were:

"trying to acquire the signal with a constant phase in every iteration"

 

I personally don't have a clear understanding of what you *mean* by that.  As mcduff previously emphasized, phase is a relative measurement.  The only thing I'm aware of that you've mentioned that it *could* be relative to is each iteration.

 

As I read back through the thread, I think maybe I have a better guess of what you mean.  Is your goal to basically "sync up" your DAQmx Reads each iteration to the external waveform such that each each iteration's chunk of data starts at the same phase? 

 

If so, I'd first want to try to do this with a finite sampling task configured to use a retriggerable analog start trigger.   But if you can't count on using prior system knowledge to configure an appropriate set of triggering criteria, you could approach the overall app a little differently, as outlined below:

1. Start in a state where you run a continuous AI task and live stream its data to a chart for the user to see. 

2. Let the user then define the triggering criteria based on this new knowledge of the incoming waveform.

3. Once satisfied, the user clicks some kind of "start" button and the program goes into a state where it runs a finite AI task that's retriggerable with the user-defined triggering criteria.

 

It may help if you can show us a few examples of what this DUT signal might look like.  And if you get stuck with the coding part of things, post your code as well.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 16 of 28
(933 Views)

hello Kevin

 

Thanks for your suggestions

 

I have not used a retriggerable analog start trigger. So I have not modified the program after your suggestion.

 

My DUT signal is exactly a modulated signal with parameters of 10kHz, >0.1Vp-p, and >1% modulation index. 

On the first try, I started with a sine wave signal which I used to get after demodulation.

 

Here I have attached the program which I have used for acquiring and extract the signal tone.

 

பூபதிராஜா_0-1603973964687.png

 

The above program was used as a final before posting this query. Let me know for suggestions.

 

Note: The program is developed for Trial & Error. Kept Start & Stop function inside the loop is a try to get data every time since tried using finite samples mode. 

 

Thanks 

Boopathy Raja S

0 Kudos
Message 17 of 28
(926 Views)

@பூபதிராஜா wrote:

hello Kevin

 

Thanks for your suggestions

 

I have not used a retriggerable analog start trigger. So I have not modified the program after your suggestion.

 

My DUT signal is exactly a modulated signal with parameters of 10kHz, >0.1Vp-p, and >1% modulation index. 

On the first try, I started with a sine wave signal which I used to get after demodulation.

 

Here I have attached the program which I have used for acquiring and extract the signal tone.

 

பூபதிராஜா_0-1603973964687.png

 

The above program was used as a final before posting this query. Let me know for suggestions.

 

Note: The program is developed for Trial & Error. Kept Start & Stop function inside the loop is a try to get data every time since tried using finite samples mode. 

 

Thanks 

Boopathy Raja S


Sorry for the confusion but still not sure of your final application.

 

Looking at your VI, it seems you want to measure/record Amplitude, Phase, and Frequency. This indicates that your frequency is not static, it seems like you want a frequency-response curve similar to one shown for a filter plot, like below.

Snap45.png

 

Is that the type of curve you want?

 

If your signal is stationary, that is, the frequency is not changing, do you just want to monitor the change in amplitude phase over time? If so not sure why you are measuring the frequency of your signal.

 

If you are doing a frequency sweep, the method I suggested would work, but, it would be impossible without a frequency reference unless you can control the sweep rate from LabVIEW.

 

The other issue is your signal. You state, My DUT signal is exactly a modulated signal with parameters of 10kHz, >0.1Vp-p, and >1% modulation index. 

 

Modulation index implies to me AC/DC, so do you have a small sinusoidal riding on top of a large DC offset? You say exactly 10kHz, so I assume it is stationary.

 

The method I suggested determines the instantaneous magnitude and phase of your signal. You can think of it as a narrowband FFT centered around the frequency of interest. A FFT means you are multiply by all the frequencies in your signal, here we are multiplying only by ONE frequency. The width of the band is determined by your LP filter, a 1kHz LP filter implies a 1 kHz bandwidth with a response time of 3-5ms. (Five time constants are better but three could suffice.) The advantage of the method I proposed is that you can synthesize your own reference and measure relative to that reference. Since you control the reference it should be steady.

 

This link, https://forums.ni.com/t5/Example-Code/Lock-in-amplifier-with-DAQmx/ta-p/3698819 ,

uses an external reference I believe, but you can make your own internal one. I did the same thing for a FPGA where I made my own 40kHz signal and multiplied my input by it.

 

mcduff

 

0 Kudos
Message 18 of 28
(919 Views)

Let me tell you what I *see* in the code you posted, then you can figure out if what's there is actually what you *want*.

 

1.  You have a finite sampling AI task, sample rate of 10 MHz, buffer size of 10 Mega-samples which will be 1 second worth of data.  Note that in the case of a finite sampling task, you should wire up the # samples input of DAQmx Timing to define the total # samples you want to capture.  Once you do, you'll no longer need to call DAQmx Buffer explicitly.  (Things work differently for continuous sampling tasks.  I consider this to be unnecessarily confusing and posted a complaint and partial suggestion on the Idea Exchange.  Please feel free to add to the discussion or add a Kudo to the idea.)

 

2.  You're configured for a one-time analog edge start trigger.  You could make the task retriggerable (assuming your device supports it) by following up your general trigger config with the corresponding DAQmx Trigger property node.

 retriggerable.png

 

3. Each loop iteration, you start the task and request an unknown-to-me # of 'Samples to Read' from DAQmx Read.  You didn't wire the timeout value, so the 10 sec default is probably being used.

   When the trigger conditions are met, the task will start moving data into your task buffer.  Once you've accumulated 'Samples to Read', the function call will return with your data.  But if the trigger conditions are *not* met, the function call will get stuck waiting until the 10 second timeout expires.  It will then return with no data and a timeout error.

 

4. After the read, you stop the task, which sets you up to be able to iterate again.

 

5. Your first post mentioned something about "consuming more time than usual."  There are 2 places for time to be consumed once you call DAQmx Read.

- acquisition won't start until the triggering condition is met

- after that you'll wait until 'Samples to Read' have been transferred to your task buffer.  The longest additional time this can be is 1 second if you're asking for the entire buffer full of 10 Mega-samples.

 

6. Note that the DAQmx Read property node set to 'Most Recent Sample' is not helping you here and may possibly be hurting.  Remove it.

 

7. To try retriggering, you would need to move the task start and stop outside your loop.  You may run into issues with hardware-based retriggering though.  The task wants to rearm the trigger as soon as it captures the total # samples defined in DAQmx Timing.  But unless your software has already read those samples from the buffer, there will be no place to put new samples after the next triggering event.

    Since you trigger on a regular characteristic of your waveform, that's gonna happen really fast and I kinda suspect you might start getting buffer overflow errors.  These basically kill your task,  which would require you to stop and restart it.  At which point, there may be no great advantage to hardware-based retriggering over the software-based repetitive triggering you posted.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 19 of 28
(905 Views)

Hello mcduff

 

Sorry, I am into any kind of response curve. You are into different tracks which I am not looking exactly. 

 

I am not using any frequency Sweep.

 

I have not noticed any DC offset as you mentioned from my DUT.

 

The guess the link which you have shared might be useful. Let you once thought-out completely. 

 

- Boopathy Raja S

0 Kudos
Message 20 of 28
(897 Views)