LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Example VI -> Hardware Input and Output -> DAQmx -> Analog Output -> Voltage - Continuous Output

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

0 Kudos
Message 1 of 5
(3,378 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,359 Views)

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!

0 Kudos
Message 3 of 5
(3,345 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(3,333 Views)
In your original post, you said you wanted a pwm signal and a counter was recommended. Why not use that? Why do you not respond in the original thread?
0 Kudos
Message 5 of 5
(3,322 Views)