LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FREQUENCY DIVISION ONLY IN SIMULATION

Solved!
Go to solution

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.

 

0 Kudos
Message 11 of 32
(1,236 Views)
Solution
Accepted by topic author photonick

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).

 

 

altenbach_1-1601933004447.png

 

Download All
0 Kudos
Message 12 of 32
(1,223 Views)

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?20201006_130519.jpg

0 Kudos
Message 13 of 32
(1,203 Views)

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.20201006_130519.jpg

0 Kudos
Message 14 of 32
(1,200 Views)

Hi photonick,

 

please don't create double threads for the very same question!

 

What's the problem with this excellent solution from Christian (Altenbach)?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 32
(1,191 Views)

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.

0 Kudos
Message 16 of 32
(1,184 Views)

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:

 

clock divider example.png

 

 

-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 17 of 32
(1,171 Views)

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. 

photonick_0-1602063231802.png

 

0 Kudos
Message 18 of 32
(1,150 Views)

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

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 19 of 32
(1,145 Views)

Where can I define my input channel, there are ctrl 0,1 ... I need to select ai0.

photonick_0-1602077111494.png

 

0 Kudos
Message 20 of 32
(1,141 Views)