Jump to content
  • 0

USB-CTR04 two-edge separation


HJLEE

Question

Hello, I am trying to calculate the time difference between signals using a USB-CTR04 with LABVIEW. First, Signal 1 uses an A-B TTL pulse (100KHz), and Signal 2 uses a random signal (TTL pulse). I want to measure the time between the rising edge of Signal 1's A and the rising edge of Signal 2. I have connected Signal 1 to C0Input and Signal 2 to C0GT for two-edge separation in the USB-CTR04. Both C0Input and C0GT are set to rising edge. The time interval I want to measure between Signal 1 and Signal 2 is approximately between 20 to 100 ns. However, the measured values are too large.

My question is whether it is possible to connect Signal 1 to the TRG terminal inside the USB-CTR04 and use it to start the two-edge separation task at the moment Signal 1 is detected. It seems the measurement lacks a reference due to the randomness of Signal 2, so I want to try using the TRG for start declaration. I know that NI DAQ has an "Arm Start Trigger" function. Does the USB-CTR04 support this feature?

How can I use the start and stop triggers in the USB-CTR04? I have tried using Basic None and Gate None, but I cannot determine if this is working correctly.

111.JPG

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

A two-edge (timing mode) example exists in ..\LabVIEW 202x\Examples\ULx\Measure 2 Edge Separation LLB library. The first edge is applied to the counter input, and the second edge is applied to the counter gate. It will return time in seconds. The counter starts counting when the first edge is detected and stops counting when the gate detects the second edge. Internally, it counts the edges of a 48MHz clock (20.83 ns). If your signal is perfect, 100 ns will have 4-5 counts (20% error).  20 ns is not possible. Any ringing and/or jitter will cause additional errors or lousy reading. 

The TRG input terminal starts a scan of the input channels, which will not be beneficial.  I'm afraid the period you're trying to detect is just too short for the USB-CTR04.

Link to comment
Share on other sites

  • 0

Thank you for your response. I have verified that Signal2 (random pulse) is recognized when connected to C0GT. However, another issue has arisen. Specifically, my Signal1 pulse has a repetition rate of 100kHz, and I created a code using example code to measure the time between Signal1 and Signal2 over 1 second. Given that Signal1 has a repetition rate of 100kHz, the task should execute 100,000 times in 1 second. However, when I run the code and check the indicator within the while loop, it only executes 500 times. To resolve this issue, I used No clock instead of Onboard clock in the sample clock settings, which increased the task executions to about 5000, but this is still insufficient. Could you please provide a solution to this problem?

Link to comment
Share on other sites

  • 0

The rate parameter on the Timing VI sets the sample rate, not the frequency of Signal1. Set the rate to 100 and the loop variable 'Number of Samples per Channel' to 100, and it should return 100 values each second. If you desire a measurement for each cycle of Signal1, set the rate to 100,000 and set the 'Number of Samples per Channel' to at least 1000 so that you keep up with the incoming data. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...