LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Single Square Wave - Analog Output

Using LabVIEW, I would like to generate and output a single analog square wave which has certain characteristics:
 
1. Pre-set base offset voltage (i.e. I want the analog channel to "rest" at a user-defined voltage, such as 0.2Volts)
 
2. On/Off time (user-defined duty cycle and length of pulse)
 
3. Output voltage (user-defined output voltage for high signal)
 
I would like to be able to define all these characteristics and then output a SINGLE square wave with the characteristics from one of the analog channels of the NI DAQ board. Are there any example VIs that already perform this? Also, should the waveform be stored and then output from an array of some kind?
 
Thank you,
 
Justin
0 Kudos
Message 1 of 6
(4,539 Views)
Have you looked at the examples, because you would have found an example to output a square wave.

Daqmx->Analog generation->Voltage.

If an offset is not present extract the Y part of the waveform and add your offset and pack it back into the waveform.

The rest can be found in online/offline LV courses.

André
Regards,
André (CLA, CLED)
0 Kudos
Message 2 of 6
(4,528 Views)
Thank you Andre,
 
Could you possibly explain to me how you would do the following, because I have tried and cannot seem to have it work when I run the array through DAQmx assistant:
 
"If an offset is not present extract the Y part of the waveform and add your offset and pack it back into the waveform."
 
Also, I only want to generate a single square pulse (not a full wave). Any suggestions/pointers to examples?
 
Thank you again for your help, I'm kind of new at this.
 
Justin Karimi
0 Kudos
Message 3 of 6
(4,516 Views)
The code in the picture below will generate a waveform with 1 puls.



André

Message Edited by andre.buurman@carya on 09-25-2007 03:33 PM

Regards,
André (CLA, CLED)
0 Kudos
Message 4 of 6
(4,507 Views)
Andre,

Thank you for your quick response. So basically if I take the output array and run it into a DAQ assistant block for the board, it should automatically convert the array to packets and output the single square pulse to the board, and then output the constant offset voltage afterwards?

Thank you again,

Justin Karimi
justink@vt.edu
0 Kudos
Message 5 of 6
(4,503 Views)
I'm not really familiar with the daq assistent myself. I only use it to do an initial test and create example code that is not in the examples.

Take example code "Gen Mult Volt Upadtes-Int Clk.vi" and play around with the "Daqmx write.vi" instances, one of them is "Single channel -> 1D Dbl" which can output the array created in the previous post.

André

Regards,
André (CLA, CLED)
0 Kudos
Message 6 of 6
(4,490 Views)