Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i synchronize Counter with AI

Hi, Im trying to acquire analog signals and generate a TTL pulse at the same time. The acquisition should be when the pulse is in the logic state1”. Im having problems synchronizing this, can anyone help me in this, please? I attached my code. LV 7.0 and board PCI-6024E.
0 Kudos
Message 1 of 8
(6,515 Views)

Hi,

 

Let me know if I'm wrong, but if I look to your code, I think your acquisition is done with one point for every rising edge of your TTL signal. Am I right?

 

Then, it seems that you want to generate a 50kHZ TTL signal with 0.1 duty cycle. Which is a 1µs pulse at high.

This is extremely short for an acquisition. What do you want to acquire in this short period?

 

What you want to do will not be really easy to achieve.

A solution I'm thinking about is to use a Reference Digital edge Trigger. Knowing the speed of your acquisition rate and the length of your pulse, you can define the number of points to acquire before the trigger, and setting the trigger to falling edge. in that way, you will have the points measured during the High level of your TTL signal.

 

An issue is that this functionality is not retriggerable. So you will have to play with the DAQmx Control Task VI to stop and restart the acquisition for the next pulse, and it will not be easy if you go too fast.

 

Would it be a potential solution?

Please, answer with more details on signals parameters.

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 2 of 8
(6,497 Views)

Hi Olivier L,

 

"Let me know if I'm wrong, but if I look to your code, I think your acquisition is done with one point for every rising edge of your TTL signal. Am I right?"

 

Yes, that’s it.

 

"Then, it seems that you want to generate a 50kHZ TTL signal with 0.1 duty cycle. Which is a 1µs pulse at high.

This is extremely short for an acquisition. What do you want to acquire in this short period?"

 

Just a single point from a 1khz sine wave.My acquisition rate  is set to work at full board capacity, at 50k for the 4 input channels, because the board has a max sampling rate of 200 kS/s for 1 channel. 

I have changed my VI to use a trigger. But why do I need the DAQmx ControlTask VI, if I’m generating a continuous pulse?

 

Thanks

0 Kudos
Message 3 of 8
(6,484 Views)

Hi,

 

I'm not sure to have understood exactly what is your need.

You said :"Just a single point from a 1khz sine wave"

If I undertsand correctly, you want to acquire 1 single point during the High part of your Counter signal.

In that way, I don't understand what is the problem with your first exemple, because you were acquiring at the rising edge of your signal.

Do you mean that in your application, there is a difference between acquiring at the rising edge and during the high level?

 

My explanation in my last post was to do a complete acquisition (several points) only during the high level of your TTL signal, like a windowed acquisition.

So it's probably not what you thought.

 

Regards,

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 4 of 8
(6,477 Views)
Hi,  

I’m sorry for my confusing explanation. But you already said it correctly. I want to acquire one single point during the high level, in at least for example 10 pulses from my TTL signal. That means 10 measurements.

 

Thanks
0 Kudos
Message 5 of 8
(6,470 Views)

That's why I ask again:

What finally was the problem with your first example? I think it measures a single point for each rising edge of your TTL signal, which is for me, the same as for the High level of your signal.

 

Is there something not working in your first example?

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 6 of 8
(6,468 Views)

I wasn’t really sure that the code was right. The measured values should be continually increasing or decreasing and they weren’t. So that’s why I asked for someone to see my example code. I needed a second opinion. I already figured out my problem and part was from my circuit board.

 

Olivier L, Thank you for your help and time. Smiley Happy

 

Regards

0 Kudos
Message 7 of 8
(6,458 Views)

Ok,

 

I'm glad to here that everything is working as expected now.

 

Cheers,

Olivier L. | Certified LabVIEW Developer


0 Kudos
Message 8 of 8
(6,454 Views)