LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FREQUENCY DIVISION ONLY IN SIMULATION

Solved!
Go to solution

I want to simulate a frequency divider that divides the input signal by 4. I am using a signal generator with a square wave output and feeding this as a clock to the D flip flop circuit (using logic gate). I don't know whether I am doing it right or not. Can you please help me with the frequency division circuit? to check whether the output signal frequency is divided 04 times to the input signal or not. It is urgent, kindly help in this simulation as I am new to Labview.

0 Kudos
Message 1 of 32
(2,523 Views)

I can't tell what you really need here.  My best guess at interpreting goes something like this:

 

- you have a physical signal generator that makes a square wave

- you have a physical D flip flop circuit you feed it to

- you want to evaluate whether the circuit does the frequency division you desire

- somehow LabVIEW is supposed to be involved?   It isn't clear why, I would think a scope or any decent multimeter would let you do this measurement.

- there's no mention of any DAQ hardware which would be needed for LabVIEW to interact with real physical signals.  It'd be most natural to do this with a counter task, provided you're working with 5V logic.  (Many counters are also compatible with 3.3V logic, but I'm not sure *all* are.)

 

 

-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 2 of 32
(2,506 Views)

Dear Kevin,

Thanks for the answer, sorry I think you misunderstood it, function generator means the generator in Labview.

Actually, I want to simulate the program in Labview having a signal generator and counter to divide the frequency of the counter. Kindly find the attached figure. I am trying here.

photonickhan_0-1601916995068.png

 

0 Kudos
Message 3 of 32
(2,480 Views)

@photonick wrote:

Kindly find the attached figure. I am trying here.


You are running your signal generator once before the loop and turn it onto a single boolean, basically turning a square wave into a single bit of information. This means that the square wave and all timing information is irreversibly lost. I don't think you even have a basic understanding of LabVIEW and dataflow, so please start with the tutorials listed at the top of the forum. LabVIEW is a programming language, not a circuit simulator, but you can of course program anything you want.

 

Also, pictures of diagrams are pretty useless. In this particular case there is no way to tell how the express VI is configured. Please attach the actual VI. Maybe add a graph to show how the input signal looks like and what kid of output you are trying to get out of it.

 

 

0 Kudos
Message 4 of 32
(2,457 Views)

See if this can give you some ideas....

 

altenbach_0-1601923567541.png

 

0 Kudos
Message 5 of 32
(2,441 Views)

Thank you Altenbach!

Indeed you understood it correctly what I wan to say. Kindly find VI and the circuit of frequency divider attached below.

Yes, I am totally new to Labview, there are a lot of things I need to understand that´s why I am making a lot of mistakes. Trying to learn it from youtube videos. But as I have an urgent task to do this that´s why I need help with that task (submitting by tomorrow). First I want to simulate it in VI and then I will acquire a signal from the signal generator using NI DAQ and then I will divide that acquired signal frequency in Labview.

But the first task is Labview simulation, and you have attached the exact output. Can you please provide VI for this too? the frequency division should be by 4. i.e. f/4

photonickhan_0-1601925716696.png

 

0 Kudos
Message 6 of 32
(2,432 Views)
Solution
Accepted by topic author photonick

As we said, LabVIEW is a programming language, not a circuit simulator (such as e.g. multisim).

 

My VI is very simple flat code with everything visible. If you have trouble recreating it, you probably shouldn't even be on this project. Why would they ask you to submit this???

 


@photonick wrote:

the frequency division should be by 4. i.e. f/4


Then divide by two several times, just use another FOR loop!

 

 

altenbach_0-1601927587279.png

 

0 Kudos
Message 7 of 32
(2,414 Views)

I am working on a project, I am new to Labview but as part of the project, I have to do this... I am from an optical communication background but this the first time I have to work on Labview too. So I have to do it for the project. 

Yes, I am understanding the things you have used , when I calculate the values then next time I would have an idea how things go in Labview, as I think they are not that complex but because of the lack of components used here, I am facing a problem.  I am quite sure by doing such exercises a few more, I will be able to do it by myself next time as in each task or problem the same components are used most of the time.

Thanks for the help, highly appreciated. 

0 Kudos
Message 8 of 32
(2,402 Views)

One more question, If I need to use an external signal from NI DAQ and then use this code to divide it, what changes I would need for this and to read back that output divided signal too.

0 Kudos
Message 9 of 32
(2,390 Views)
Solution
Accepted by topic author photonick

Here's the code. Modify as needed. Never submit anything that you don't understand in the smallest details!

 

(Of course it would be interesting to rewrite it as a ptbypt VI that takes a scalar boolean input and outputs a scalar boolean at 1/4 of the frequency when called repeatedly with new values. Not shown.)

0 Kudos
Message 10 of 32
(2,386 Views)