LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate analog waveform based on data file

Solved!
Go to solution

I want to create an analog voltage output that follows a data file that I have(excel, csv, text(what ever is easiest)).  The data file creates a waveform with equal time interval between steps (dT = .0034 sec).  After the output steps through all the data points I want it to repeat continuously.

 

What is the best way to create the waveform from a data file?

0 Kudos
Message 1 of 10
(7,663 Views)
Solution
Accepted by topic author Need4Speed

To create a waveform data type, calculate the dt by subtracting two values in column 1 and get the Y array from column 2. If you save the file as a comma separated or tab separated text file, then you can use the Read From Spreadsheet File. After getting a 2D array, you would use the index array and array subset functions.

 

Assuming you are going to use an NI DAQ card to output the signal, you can pass a waveform data type to a DAQmx Write and set it for confinuous generation.

Message 2 of 10
(7,656 Views)

Dennis - This is what I setup as a small test file.  I am reading voltage data on 5 channels and outputting a wave on one channel.  I was using a sine form generator to prove my program and oscilloscope was working.  I started to load read the spreadsheet and turn the array into an input for my waveform generator when I got lost.  I do not understand the arrays in labview.  I can only seem to get the first value of my CSV spreadsheet to appear.  I simplified it to make my time interval a constant and just need to load the Y data and get it to repeat continuously.

 

Can you help me out?

 

 

 

 

test.png

Download All
0 Kudos
Message 3 of 10
(7,636 Views)

You seem to have  a lot of things going on in that VI at once.  I have simplified down an example to show how to output a wave continuously from a spreadsheet. Basically all the example does is remove a lot of code from the loop, so that you are not re-reading the data every time, rather, you read the data, then use what is loaded into memory each time.

 

Ryan

Applications Engineer
National Instruments
0 Kudos
Message 4 of 10
(7,620 Views)

Could you post the VI compatible with version 2010?

Thanks.

0 Kudos
Message 5 of 10
(7,589 Views)

I actually ended up doing something slightly different.  I dont have my laptop so i cant convert it but you can find a convsation request post and get someone too.

Download All
0 Kudos
Message 6 of 10
(7,585 Views)

Can you post screen shots of your VI? - Thanks.

0 Kudos
Message 7 of 10
(7,580 Views)

I dont have my laptop so i can't even open it right now.   This board should be able to help you. 

 

Downconver​t VI Requests

0 Kudos
Message 8 of 10
(7,572 Views)

Need 4 Speed, here are the two VIs.  I did have a broken arrow in the example, but the gist is there.  The other VI would not save in a previous version, so I attatched a screenshot.  All its doing is creating a task, so you should be able to reproduce this without too much trouble.

 

Let us know if you need more help!

Applications Engineer
National Instruments
Download All
0 Kudos
Message 9 of 10
(7,567 Views)

Hi could you please explain more what does  this program do? When I run it in Lab-view, there is no graph or indicator in control panel .

0 Kudos
Message 10 of 10
(5,988 Views)