LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fgen by duration, am I missing something

Hello all,
  First time posting but have found many good solutions here.  Anyway, I have been wrestling with the Fgen by Duration vi and have seen many discussions about this.  I opened the vi added a graph to the front panel and ran it after looking at the diagram.  When looking for a ramping solution, duration has nothing to do with the ramp on this vi other than change the output ramp rate.  Am I missing something in my code?  Best I can tell, duration only pertains to the number of COMPLETE cycles of a wave given as an output for a given sample amount.  IE  Sample rate=100 duration=1 gives one complete cycle of a wave with 100 pts in that cycle,  keeping the samples the same, increasing duration to 2, gives 2 complete cycles with 50 pts per cycle and so on.
  I have tried to find an simple way around this problem by I think using the ramp.vi in combination with slope calcs and loop may be an easier solution.
 
  Basically I am needing a vi to go from a min (n) to some max (n+#) in x seconds.
 
Any thoughts,
M. P.
0 Kudos
Message 1 of 3
(2,651 Views)
Hi,
 
It's sounds like what you want is to be able to specify a number of points per cycle, rather than the number of points for the entire signal.  If you have code which allows you to specify the number of cycles and a total number of point, all you have to do is compute a new total number of points, which in this case is just your current number of cycles*your current number of points.  That way you get your current number of points for EACH cycle.
 
Does this answer your question?
AG
0 Kudos
Message 2 of 3
(2,626 Views)

Thanks for the tip, I have worked out a different solution.  I needed code to ramp from 0 to some variable amplitude over a variable time base, and then hold at a peak level.  Ramping needed to be a function of the slope and total number of Samples/Sec of the desired signal.  I wrote the code last night, I just did not want to re-invent the wheel.  I used some bits of other code solutions on this forum and tailored to my needs.  Thanks again for your info.

MP

0 Kudos
Message 3 of 3
(2,610 Views)