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: 

redpitaya sampling in labview for phase shift measurement

Hey guys,

 

Im new to labview and am programming for a few weeks. i got a red pitaya with 2 fast  inputs signals.

When i connect the red pitaya via labview i get a set of samples in an array.

because i have 2 sets of samples (1 set for each channel).

They come after each other.

But i need to have them in sync.

I want to do a phase shift measurement. i need that for a calculation.

The signals are stable but because of the arrayscome behind each other  i got a time shift problem each time an array comes in. how can i solve that so they are seen in sinc?

i was thinking about giving it a timestamp or so and then synchronise them but dont know how to.

 

hope you guys can help me out.

0 Kudos
Message 1 of 2
(3,045 Views)

Hello Dennie334,

 

Have you checked the LV example "Waveform - Align Timestamps.vi"?

There you can find a subVI "Simple sine waveform" which also shows how you can build a waveform/signal with a timestamp into a cluster element.

 

In LabVIEW when you wish to combine timestamp and signal array information like in your case you should use data type called cluster to do this.

Then to use the different variables inside the cluster you can use function "unbundle" or "unbundle by name" to separate them.

Then use the function "Align waveform timestamps" to sync your signals. The "Align waveform timestamps.vi" can take 1D array as an input data type so you would need to build your signal data to a waveform(double) you'll also see how this is done (if your signals are in 1D array form).

 

Let me know if this helped out!

 

Regards,

Jarmo Levo

Applications Engineer

National Instruments

0 Kudos
Message 2 of 2
(2,999 Views)