Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How generate real pulses in myRIO from pulse train function

Solved!
Go to solution

Hi,

 I need to generate modulated pulses for an experiment. I should be able to select the number of pulse for second and their frequency, variate the amplitude among then and produce them in myRIO. To build those pulses I used the tool pulse train; however, I am stuck about how to generate those pulse from the pulse train function in real pulses in myRIO. The PWM tool, aparently, doesn't allow to select and change the amplitude between the pulses. Does anyone knows how to produce them from pulse train or even another way to do so? Thanks.

Message 1 of 13
(8,469 Views)

Hi gdblombardi,

 

Is there a reason you want to change the amplitude of the PWM signal? PWM is a digital function, meaning the amplitude is inherently constant (a digital high). If you want to change the amplitude, you will need to use analog output functions. 

0 Kudos
Message 2 of 13
(8,452 Views)

Hi,

 I need to change te amplitude because the pulse I need to generate is to produce electrical neurostimulation, which means that I need to test different amplitudes in time. Using the tool pulse train I can simulate the pulse the way I need, however this simulation tool do no generate the pules in time. I need to find a way to create the pulses configurated in pulse train and send them to the analog output. I tried to save the result as an array in text format to open with 'generate arbitrary wave', so I would be able to genetare and repeat the pulses, thoug the 'write meas file' is not saving this specific array as a test file. Is there a better way t do it or some form to transform the pulse train in analog output?

0 Kudos
Message 3 of 13
(8,433 Views)

gdblombardi,

 

The pulse train VI is difficult to use in a real-time system. It outputs a static array of data that corresponds to a set signal. I think you might be more interested in using the Waveform Generation VIs. These output a Y value in whichever signal you specify. You could connect the output of these VIs directly into the Analog Output myRIO express VI. What type of signal do you need? The square waveform VI, for instance, will generate an analog square wave at the amplitude and duty cycle you desire.  

0 Kudos
Message 4 of 13
(8,423 Views)

Hi,

I need to generate squarewaves. However, I need to control the number of pulses per second and be able to produce few pulses in high frequency followed by stand by period to complete a cicle. I trying to use the wavegenerator and somehow control its working period inside a loop.

0 Kudos
Message 5 of 13
(8,417 Views)

Hi
How could I build a squarewave in an array in a way that I can change for aleatory amplitude in each pulse. I also should be able to set nule the value of amplitude in patr of the array to simulate the delay between pulses. I tried to build the array but beside that I have to reconfigure the array which has until 1000 lines I also should be able to control the timing of this lines since the whole array runs in 1 second and I have to make available options to set other periods. I also tried to build my own array to use them `build waaveform` and select dt between the lines, but apparently LabView does not create waves from a simple digital array.

0 Kudos
Message 6 of 13
(8,275 Views)

Are you looking for the pulses to be a 50% duty cycle?  If so, just set the period of your timed loop to that duty cycle duration and use a shift register with a not to flip the value each iteration.  With an analog wave, you can set the amplitude. by using a select with your high value and your zero to flip between the values you want to run.

 

With digital, you're going to either have a high or a low.  The amplitude is, relatively, meaningless.  Anything higher than 3.3V is a 1.  Anything less than 0.5V(I believe) is a 0.  Anything in between those values can be a great deal of things.  This is why it was suggested you get away from digital.

0 Kudos
Message 7 of 13
(8,270 Views)

I need that each pulse have the same amplitude in the same pulse train, but just in case I want to change to each pulse different I made this draft code where I can manipulate everything that I need and change with few adjusts to the second option. I can control also the gap time. The program is running fine so far, but I still have one more task to do that is struggling me. I need to generate numbers inside the range (max-min) according to the steps with no repeatition. In case of lack of option the number does not need to to follow the rule of 2up1down. After run all the numbers between the range I need to start all over again. This code should be attached probably after restrict the number to the steps.  Any idea? The code is still not clean, which may cause confusion in some aspects. However, all I need to change is the beginning of the code to attach the non repeatition cicle. Thanks.

0 Kudos
Message 8 of 13
(8,243 Views)

I did it. Now I am able to manipulate the pulses the way I want. The only problem is that I am having an error to play the waveform. I am trying to send 100000 samples for loop to the wave generator; however, it still giving me an error about sample reading capacity. Each loop in the first squere creates 30000 sample being 10000 per second of the signal. I just need to set it to play correctly before start the interface. Does anyone have an idea about how to fix it? It is only the second loop that I need to adjust.

0 Kudos
Message 9 of 13
(8,205 Views)

gdblombardi,

 

What kind of error is it giving you? 100,000 samples is quite a bit. You might be getting a buffer overflow.

0 Kudos
Message 10 of 13
(8,192 Views)