LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generating TTL signal to sync another device with Labview

Solved!
Go to solution

Hello everyone,

 

I am using NI-6071E and trying to generate and send a TTL signal out so I can sync another device with my Labview code. My code (the attached code) generates a sine wave, and I want to send a TTL singal out at a certain phase angle on the sine wave. Currently, the code sends out a sine wave and a square wave using to analoge outputs on the BNC card. I thought I could just use a square wave and send it out as an analoge output to the other device, but apprantly it only works with a TTL signal.

Could you please take a look at my code and advice me how to generate a TTL signal while being able to send it out at certain phase angle?

 

Thank you in davance

Pooya

0 Kudos
Message 1 of 4
(5,696 Views)

You need to use one of the digital output (line) of your board (look into the DIO palette for the corresponding VIs).

Now, as far as synchronizing the two tasks (AO and DIO), the easiest would be to trigger the start of your AO task with the DIO task, with its outpur rerouted and used as a sync signal for instance. To get it to start at the right phase value, you could choose the correct phase offset for the first point of the waveform...

If that is not an option (say, your waveform itself is triggered by some other process), then this is a bit more tricky, as your first need to evaluate the phase of your waveform.

HTH.

0 Kudos
Message 2 of 4
(5,689 Views)

Thank you for the note. Since I never used the DIO pallete, it seems a little bit diffucult to get it to work. Is it similar to creat an analog output?

I tried to make a digital output using the DIO pallete, but I kept getting error from the DIO clear VI. I am not sure if I did it write or not. Could you please give me some advice on using the DIO pallete to creat a TTL signal?

 

Thanks,

Pooya

0 Kudos
Message 3 of 4
(5,682 Views)
Solution
Accepted by topic author Pooya

There are examples for pretty much everything in the Help>>Find Examples... menu

but here is one that simply sends a single pulse:

ScreenHunter_001.jpg

 

Note that I expect the line to have been predefined in MAX (it's always a good idea to check that your DIO line behaves as expected by trying it in MAX).

Message 4 of 4
(5,677 Views)