Discussion:
creating a step function
(too old to reply)
suni
2008-07-30 19:40:11 UTC
Permalink
Hi
 
I want to create step function like the this one that is done in control simulation loop. how can generate signal like this without the control simulation loop?
Thanks


Step.vi:
http://forums.ni.com/attachments/ni/170/345259/1/Step.vi
GerdW
2008-07-30 20:10:06 UTC
Permalink
Hi suni, don't have simulation toolkit installed, but from description the attachment may help..


Stepping_LV82.vi:
http://forums.ni.com/attachments/ni/170/345265/1/Stepping_LV82.vi
suni
2008-07-30 21:10:06 UTC
Permalink
Thanks for the reply. But i want to create step function. not just a value. Thanks
suni
2008-08-05 22:10:06 UTC
Permalink
Hi
Thanks for the reply. Could you please expain how to do this lilttle more? I could not find digital pulse pattern. Basically i need to write a labview code generate step function. This function is avilable in control design moduale under step.vi. But I could not use it because it uses simulation loop to run the step function. I think the data this simulation loop generates is only avilable inside that loop. Can somebody please help? Thanks
johnsold
2008-08-06 00:40:05 UTC
Permalink
What is your input to the step function? A single numeric value? If so, the step function output is 1 if the input is greater than to equal to 0 and zero otherwise. If you want an array or waveform, create an input array and apply the function above to each point. Lynn
suni
2008-08-06 16:40:08 UTC
Permalink
Hi
Thanks for the reply. That was helpfull. I wanted to add a sine wave to this pulse and i wanted to generate sine wave continously. I tried to do that using while loop. But i got output waveform with pulse added reflected continously on the signal. Here is what i have in my VI. How do i avoid that? i think pulse is always there to get added to sine wave after samples amount. i want to have start time and stop time for the impulse.


pulse and sine.vi:
http://forums.ni.com/attachments/ni/170/347168/1/pulse and sine.vi
suni
2008-08-06 19:40:07 UTC
Permalink
Thanks for the reply. i want to add single pulse which have start time and end time to sine wave.( I tne real vi i have daqmx to aquire 3 signals then i have to add a pulse to each of thease signals. i am using a sine wave as my aquired signal). i want to add this based on the time. i am generating sine wave contiously. i have to have a single pulse with certain duration. then i want to add thease two. With the pulse pattern there is no end time to pulse function. it has only a delay. therefore pulse keep adding to sine wave. that is what i think.
smercurio_fc
2008-07-30 21:40:07 UTC
Permalink
You could use the Pulse Pattern function and just chop off what you need.
smercurio_fc
2008-08-06 14:40:10 UTC
Permalink
Here is a simple example using the Pulse Pattern function:<img src="Loading Image..."> Message Edited by smercurio_fc on 08-06-2008 09:26 AM


Example_VI.png:
http://forums.ni.com/attachments/ni/170/347074/1/Example_VI.png
smercurio_fc
2008-08-06 18:10:07 UTC
Permalink
I'm sorry, but I didn't understand what you're trying to do. The pulse generation creates an array of 128 elements. The sine wave is 100 elements. Thus, when you add the 2 signals together only the first 100 elements of the pulse get added to the sine wave. The first 100 elements are zero based on your input parameters, so the addition gives you the original sine wave. If you're continuously generating the sine wave, then how is the pulse supposed to be added to the sine wave in terms of time? Are you applying the pulse as a mask for each chunk that you get out of the sine wave generator, or are you supposed to apply it based on the time? In other words, if you're generating the chunk of the sine wave that occurs after the pulse turns on in time then the sine wave gets passed through, otherwise not.
Loading...