LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to output at least 2 TTL pulses, one delayed WRT the other

I am learning LabVIEW and have run into a problem which I think should have an easy fix but can't seem to figure it out. I am using a PCI-6036E Daq board with a BNC-2110.

I need to output two analog TTL pulses and be able to delay them with respect to one another as they are triggering two separate pieces of hardware (a laser and a flashlamp). I have tried using a counter, but can only get a pulse out of the CTR 0 OUT port. The only other counter port the DAQ assistant knows about is the CTR 1 OUT port, which is digital so I can't use it. I assume there is only one analog counter on my hardware. Perhaps I am wrong and this would fix my problem.

The other way I have been able to generate TTL pulses is by simulating a square wave signal and then having it output to one of the two analog outputs. This successfully triggers my hardware, but my routine takes too long so my pulses can't be close enough together in time (I'd like to have microsecond separation capability, but millisecond may do). I have also tried using a combination of the counter and my simulated analog output pulse, but the analog output is still way too slow. I have tried using separate For Loops to make the routines run at the same time, and then trying to delay the counter pulse, but this still does not yield small enough time separation.

It seems to me that this must be a common type of program that people would use so there must be a quick solution. Please advise. Thanks.
0 Kudos
Message 1 of 7
(2,803 Views)
I do not understand the terminology "analog TTL". TTL is a digital logic level format. CTR0 and CTR1 are digital signals.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 7
(2,797 Views)
So I guess the issue is that I want to be able to use a BNC cable (which is what all of my analog outputs are)...and the CTR 1 OUT isn't that.
0 Kudos
Message 3 of 7
(2,795 Views)
snidjer,

I tried to look up the BNC-2110 on the site here but the picture is way too coarse to show details. Anyway, I *think* I remember that there are a couple of "user-configurable" BNC connectors on the unit. You would just run the needed wire(s) from the screw/spring terminals for that BNC to the screw/spring terminal for CTR1 Out. Then you can send CTR1 Out to your equipment using your BNC cable.

As stated earlier though, CTR0 and CTR1 both generate digital TTL outputs. Post back if you're not sure how to get CTR1 timed properly relative to CTR0.

-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 4 of 7
(2,790 Views)
Hi snidjer and all-

Kevin is correct- the "User-Defined Signals" BNC connectors are referenced to DGND and will work well for your counter output. You will need to wire (via the spring terminals) CTR1OUT to USER 1 in order to route this signal appropriately.

In order to generate your two out of phase pulse trains you will need to consider the following: E Series devices do not support this functionality directly for pulse trains. One method to accomplish this is to generate a pulse train on one counter and then generate single pulses on the second counter with initial delays to be triggered by the pulse train on the first counter.

This will be particularly easy with your BNC-2110 because you can wire your CTR1OUT directly to a trigger line (in addition to the user-specified line) via the spring terminals. This means you will want to generate your pulse train on CTR1 and the triggered pulse on CTR0.

So the final step will be to determine the appropriate values for 'initial delay,' 'high time,' and 'low time' in a single pulse generation example. The initial delay be the origin of the phase shift between your signals. The high time will need to coincide with an appropriate pulse width in the pulse train at frequency (i.e. high time = period/2). The low time should be the remaining time in one cycle of the pulse train on CTR1 so that the generation on CTR0 will be complete in time for the next rising edge of the original pulse train.

Please let us know if you have any additional questions-
Tom W
National Instruments
0 Kudos
Message 5 of 7
(2,774 Views)
Hi guys-

I decided to test this out and came up with the attached VI for the single triggered pulses to be generated on CTR0.

In order to generate a pulse train on CTR1 you should check out the LabVIEW example "Gen Dig Pulse Train-Continuous.vi" that can be found in LabVIEW at Help>Find Examples and then browsing to Hardware Input and Output>DAQmx>Generating Digital Pulses>Gen Dig Pulse Train-Continuous.vi

Regards-
Tom W
National Instruments
0 Kudos
Message 6 of 7
(2,770 Views)
Thanks for your help, all. I fixed my problem successfully yesterday.
0 Kudos
Message 7 of 7
(2,766 Views)