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: 

sync to external ttl

Solved!
Go to solution

I need to sync a sine wave output to a ttl input (1kHz).  I basically need to turn a ttl input into a sinusoidal output operating at the same frequency (or a sub harmonic) with adjustable phase and amplitude.  I have a pci6221 DAQ board and a bnc breakout box but I haven't been able to get a sinusoidal output synced to the ttl input.  Does someone have a simple way of doing this before I get pissed and break all the electronics?

 

Thanks

0 Kudos
Message 1 of 6
(2,837 Views)

Aricks,

 

When you are referencing that you want to sync the TTL digital input (at 1kHz) to the sinusoidal output, do you mean that you are trying to drive the sine output with the digital TTL signal such that if you get a 1kHz TTL input, you would turn that in to a 1kHz sinusoidal output, and a 2kHz TTL signal to a 2kHz sinusoidal output? If this is the case, have you tried using the TTL signal as the sample clock for sinusoidal output? Generally to synchronize two signals, we want to share a common clock and a common trigger signal. What I am thinking is using the TTL input as an external sample clock and as a trigger signal to begin the output generation. Let me know if I've misunderstood your application so we can get you the best way to approach this.

Timothy S.
Senior Technical Support Engineer
0 Kudos
Message 2 of 6
(2,812 Views)

Yes, that is exactly what I am trying to do.  I couldn't figure out how to get the sine wave to sync off the ttl input. Any help (little diagrams, whatever) would be appreciated.

0 Kudos
Message 3 of 6
(2,800 Views)

Using the reference ttl as an external clock(in DAQMX) I can only get data points output at the rate of the ttl.  i.e. if I have the external ttl (which I want to sync to) running at 1kz and a sine wave generated by a1 out I get a sine wave of a much longer frequency with steps (or digitization) every 1ms (the rate of the external ttl).  I want a whole sine wave generated between one ttl pulse and the next, so I would want the clock to run at a multiple of the external clock.  Is there a way to do this? 

0 Kudos
Message 4 of 6
(2,792 Views)

When you had done this before and they weren't synchronized, was the issue that the two signals were out of phase with one another? How closely synchronized do we need these two sets of signals to be to one another?

Have you tried simply using an internal sample clock for the analog output at the same rate as the TTL pulse and tried to trigger the sine-wave generation on the TTL input?

Timothy S.
Senior Technical Support Engineer
0 Kudos
Message 5 of 6
(2,765 Views)
Solution
Accepted by topic author aricks

I found a VI that did what I needed it to do

ftp://ftp.ni.com/pub/devzone/epd/retriggerable_ao_0001.zip

 

 

0 Kudos
Message 6 of 6
(2,730 Views)