LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load a custom waveform for use with DAQ voltage generation

I would appreciate some advice on how to take a custom waveform (just a modified triangle wave with pauses at the tops and bottoms) and use that to control the voltage output from a DAQ. 

 

Some background:  My intent is to use the waveform to control mirror scanning for a LADAR imaging application .  Because our DAQ (NI-6251) only has one clock, it cannot update the X and Y channel voltages independently. I'm using a triangle wave to control both axes, which works fine for the X direction.  However, to prevent the Y axis from incrementally steping up after every X pixel, I'd like to construct a waveform, similar to a step pyramid, so that the Y axis remains constant over the X sweep and only updates to the next row after all X pixels are collected.

 

I assume I can make the desired plot in excel, and then read it in somehow - but this is where I start to get fuzzy.  Can any one point me to an example or tutorial on this?

 

Some other questions:

1. Do I needto worry about scaling? will my custom plot need to contain a specific number of points (perhaps the exact number of pixels in the image)?

2. If I change the image dimensions, will I need to revise the control waveform in the Y axis?

 

Thanks in advance,

jimmy

0 Kudos
Message 1 of 4
(3,694 Views)

Hi Jimmy,

Thank you for posting to the NI Forums!! You can certainly create data in Excel, save it to a text file, and then use the Read From Spreadsheet.vi to read the data into LabVIEW. As far as your two concers, I'd like to address those once I understand your application a little more. Would it be possible to attach a paint drawing or something showing what you would like the waveforms to appear as in LabVIEW? This will help me make sure I've followed you correctly. Thanks!

Regards,
Margaret Barrett
National Instruments
Applications Engineer
Digital Multimeters and LCR Meters
0 Kudos
Message 2 of 4
(3,675 Views)

This thread didn't appear to go anywhere.  I am trying to do something similar and was looking for help.  I want to create a repeating output voltage wave based off the excel file attached(with times).  Is there a way to have my program match the output voltage and time with the table attached on a repeat and send that signal to the output?

 

Thanks,

T

0 Kudos
Message 3 of 4
(3,452 Views)

Hi Need4Speed,

 

One way you could do this is to build a waveform using the data. Please see the example "Cont Gen Voltage Wfm-Int Ckt.vi" from Help -> Find Examples -> Hardware Input and Output -> DAQmx -> Analog Generation -> Voltage. The idea is to get your data out of the excel file and into an array and build it into a waveform using the Build Waveform function. Instead of using a sine wave (like in the example) you want to feed the DAQmx write the waveform you created. In your case, d0 would be "0", dt would be "0.0034" and Y would be each Y value.

 

Jason L

Product Support Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,430 Views)