From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

How to synchronize analog waveform with digital signal

Solved!
Go to solution

Hi,

I recently created a program to create an analog waveform (a square pulse wave with a linear ramp-down). The entire wave lasts for 3 seconds, and I want to align it with another digital output signal. What is the best way to achieve this?

 

Thanks!

0 Kudos
Message 1 of 5
(2,111 Views)
Solution
Accepted by topic author moyashi1

Depending on your specific case, you probably want either

  • a shared sample clock, or
  • a shared start trigger (or one triggered by the other's start)

Do you just want them to start at the same time, or is there some other requirement.

 

These can both be carried out with the use of the DAQmx nodes if you're using DAQmx.

Take a look at the Timing (sample clock input) and Triggering VIs.


GCentral
0 Kudos
Message 2 of 5
(2,092 Views)

Thanks, that helps a lot since I didn't know how to look up the solution for my problem.

Yes I want them to both start at the same time, though my analog signal will end up longer than my digital. My analog output looks something like the attached file (source: https://forums.ni.com/t5/LabVIEW/Generate-analog-waveform-based-on-data-file/td-p/1791840). My digital signal is just a square pulse wave.

0 Kudos
Message 3 of 5
(2,081 Views)
Solution
Accepted by topic author moyashi1

Ok, so you should set the digital task as the (start) trigger for the analog task.

 

You might need to use the matching "PFI<n>" name rather than the physical channel, which is something like /port0/line1 etc.

You can see which is the PFI value on the module, or I think via MAX.

 

Don't use a shared sample clock if the outputs are of different durations 🙂


GCentral
0 Kudos
Message 4 of 5
(2,068 Views)

Okay thanks!

0 Kudos
Message 5 of 5
(2,063 Views)