10-05-2020 03:27 PM
Thank you so much for your help. You are absolutely right I should not do it but I can't do anything as they want task now it is my duty to make the system working whether I know about it or not. But I am learning about it now as I have realized I have to face LabVIEW in the future too working in this field. I am much thankful to all of you, specially to Altenbach, very quick and elaborate answers from the members.
10-05-2020 04:24 PM
As I said, you could do a ptbypt VI that divides the frequency in half for a well-formed input sequence, e.g. read from a repetitive single point DAQ reading. Here's a simple example. Use it twice to divide by four (It's reentrant, so make sure to keep separate instances).
10-06-2020 06:10 AM
Thank you so much.
I am acquiring data using NI 6212 DAQ, I want to delay the signal using a counter. Attached is the figure input/ and desired output.
Can you please in this?
10-06-2020 07:56 AM - edited 10-06-2020 07:57 AM
Dear members,
I am new to the software, theoretically, I know how to divide the signal frequency but software implementation is difficult for me at this stage.
I am applying a digital signal from an arbitrary waveform generator to NI USB 6212 and acquire the data. In software how I can get a digital signal with f/4. I can pick a single sample and store it for 4 pulses and then store 0v sample to store and in this way, I can get delayed, or frequency-divided signal. Can you please guide how to acquire it in software? Real-time input signal and the desired output is attached.
10-06-2020 07:59 AM - edited 10-06-2020 07:59 AM
Hi photonick,
please don't create double threads for the very same question!
What's the problem with this excellent solution from Christian (Altenbach)?
10-06-2020 08:09 AM - edited 10-06-2020 08:14 AM
Dear, that was a software simulation in which Altenbach helped me and he did excellent work for the simulation, I am thankful for him.
But the question I have posted today is real-time digital signal acquired by NI USB 6212 device. So I am seeking for real time data acquire problem.
10-06-2020 10:40 AM - edited 10-06-2020 10:41 AM
While several of my earlier guesses were wrong at first, it now sounds like we're circling back to where more of them might be relevant.
It's getting back to where it sounds like you want a hardware signal divider but are mistakenly thinking that the way to get there is via a trip through application software between acquisition and re-generation. Not the case.
Counter tasks are great for things like clock dividing. Try this, assuming LabVIEW. Freq division happens entirely in hardware:
-Kevin P
10-07-2020 04:34 AM
Thanks, I tried to understand it but that figure is quite complicated. My teacher told me you can easily divide the incoming signal frequency through counter no need to make complicated code. But I am still not cleared how to do it. He hinted at each rising edge take the sample. Below is the figure. I am acquiring a square wave signal using NI USB 6212 from a function generator.
10-07-2020 07:07 AM
The code I posted IS the way to use a counter to divide down a clock frequency. Here's a step-by-step walkthrough of it:
1. Define the counter function (pulse based on incoming "ticks", a.k.a. active edges) and create the task. I set defaults to make the counter output High for 2 ticks and Low for 2 ticks. That means it'll take 4 total incoming cycles to produce 1 output cycle, i.e., it divides by 4.
2. Set up DAQmx Timing to tell it to generate pulses continuously. "Implicit" timing is used for many counter tasks because of the way many counter tasks have their timing set by things that aren't really sample clocks.
3. Call a DAQmx Channel property node to choose where to physically send the divided-down output frequency signal.
4. Start the task.
5. Iterate a loop until the user stops it or there's been an task error. While you wait in this loop, the counter task continues to generate the divided-down frequency.
6. Stop and Clear the counter task to stop your output signal.
7. Indicate any error that may have occurred.
-Kevin P
10-07-2020 08:25 AM
Where can I define my input channel, there are ctrl 0,1 ... I need to select ai0.