01-29-2015 01:23 PM
I was looking at a LabVIEW example found under: Hardware Input and Output -> DAQmx -> Analog Output -> Voltage - Continuous Output. I am using a NI USB-6229. I connected the output to a transistor circuit that is driving a DC motor and I got it to run.
When running this program, I am wondering how to modify the VI to give the user access to change the duty cycle of the (square) wave, and how to be able to adjust the offset, so that the ouput wave does not necessarily have to be negative (in the example, the output wave always switches between positive and negative).
Also, when I stop the VI when the output wave is high, the motor will keep running. Is there a way to have it stop running? This might not be LabVIEW related, and can be controlled by my external circuit - if that's the case, please let me know.
Thank you very much
01-29-2015 01:50 PM
Manipulation of the output waveform is just in how you create the waveform. There should be inputs to the waveform generators for offset, frequency, etc.
And when your application stops, be sure to just write a 0V to your Analog outputs before closing out the task.
01-29-2015 02:51 PM
There are inputs, but that example only let's you pick frequency, amplitude, and waveform type. I was wondering what it takes to add duty cycle, and offset.
At which point/where in the program would I write a 0V to the output?
Thank you for your answer!
01-29-2015 03:10 PM
@tuyenhoang7 wrote:
There are inputs, but that example only let's you pick frequency, amplitude, and waveform type. I was wondering what it takes to add duty cycle, and offset.
There is a FOR loop that is generating the waveform. That Basic Function Generator VI has the inputs you are asking for. You just need to add controls to your front panel and wire them into that function.
tuyenhoang7 wrote:
At which point/where in the program would I write a 0V to the output?
Right after the DAQmx Stop Task.
01-29-2015 03:33 PM