LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating function in for loop

I am generating a function sin[2*pi(24MHz + f)] - sin[24MHz]. The 'f' has to vary from -2MHz to 2MHz. I have to add the output of this loop with another 24MHz sine wave input. I have attached the code, please let me know whether what has been done is right or no.
0 Kudos
Message 1 of 6
(2,834 Views)

No, you code makes no sense. You simply get an array of 10 identical values, because nothing changes as a function if iteration count.


PKBombay wrote:
I am generating a function sin[2*pi(24MHz + f)] - sin[24MHz]. The 'f' has to vary from -2MHz to 2MHz. I have to add the output of this loop with another 24MHz sine wave input. I have attached the code, please let me know whether what has been done is right or no.

 

I don't understand your formula, e.g. what is "sin[24MHz]"? Just a constant?

 

Is the solution 1D (y vs. f) or 2D (e.g. y vs. (f,t))?

 

Can you point to a web site that describes the math?

0 Kudos
Message 2 of 6
(2,828 Views)

Sorry, it was a typo. It is actually, sin(2*pi*24*10^6). What I have to actually do is, add a function (which is in the for loop) to a 24 MHz sine input that will vary the input between 26Mhz and 22MHz. So I want to add the output of the for loop with the 24MHz input. The code which I have attached is just a subvi . This is a laser based project and when i vary this signal, I should see the changes in the laser beams.

 

Thanks

0 Kudos
Message 3 of 6
(2,825 Views)
Even "sin(2*pi*24*10^6)" is just a constant, right?
0 Kudos
Message 4 of 6
(2,808 Views)
sin[2*pi(2*10^6 + f)] - sin[2*pi*2*10^6]...this is the equation.
0 Kudos
Message 5 of 6
(2,800 Views)

PKBombay,

 

I'm not really sure what you are doing in your code, but you have stated in one of your 4 new threads that you have made about this problem that it WORKS, but you just wanted to make sure it was correct. It seems like you should be able to see expected values if it is working and not throwing you errors, is this correct?

 

We can try to help you, but it is difficult when we have trouble understanding your vi.

Chris Van Horn
Applications Engineer
0 Kudos
Message 6 of 6
(2,724 Views)