From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-02-2016 08:20 AM
I've very little experience with labview, and trying to design a program which generate a signal inside a for loop and each iteration the frequency of the signal is increased, basically I need to be able to use the for loop iteration number (i.e whether it's iteration 1, 2, 3 etc.) to multiply with a step size to add to the initial start frequency. I've tried shift registers etc. but can't seem to get it too work, any help would be greatly appreciated.
02-02-2016 08:32 AM
Do you see the little "index" terminal, blue square with "i" inside it on the lower left? This is the For loop index, starts at 0 and increments by 1 for every loop. Just wire it ... This generates an array of even numbers, 0 .. 18.
Bob Schor
02-02-2016 08:34 AM
I think that code (or very similar) is already placed in at least a dozen of posts, so only a screenshot:
Norbert
02-02-2016 08:48 AM
02-02-2016 08:50 AM
Thanks for both replies, Norbert your solution was perfect, I had the logic located outside the loop and was getting different kinds of errors etc. but it's working perfect now thanks again.
02-02-2016 08:50 AM
There is also the simple Ramp Pattern VI that you could use to generate your points of interest.
02-02-2016 08:55 AM
I'll have a look at this and try implement it, thanks
02-02-2016 08:57 AM
One final question, I've searched the forums but can't seem to find an answer for a for loop, for testing I'm viewing the generated signal on an oscilliscope, but the loops execute far too quicky to see it, is there any way to hold a loop for a desired amount of time before beginning the next iteration. I've found lots of solutions for while loops.
02-02-2016 09:04 AM
Put a wait function inside of the For Loop.
02-02-2016 09:22 AM