LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate signals based on data file

Solved!
Go to solution

Hi everyone,


I want to generate an analog signal based on a text file. So far I have successfully used the blocks 'Simulate Signal' and 'DAQ Assistant'. My idea is to replace the block 'Simulate Signal' by the block 'Read From Spreadsheet File'. How can I do that?

Download All
0 Kudos
Message 1 of 6
(4,483 Views)

 Use Read Spreadsheet File to read the file and then Index Array to get the second column.You will probably want to read the first two times and subtract to get your dt.  You can then use build waveform, wire up your Y and dt, and wire the output to your DAQ Assistant.


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 6
(4,436 Views)

Thank you so much. When I applied the changes I get an error: 200294 (Figure 1). Posible reason: not enough samples were written to satisfy the initial data transfer request condition. I tried to increase and decrease the number of samples to write, but it does not work. What can I do?.

0 Kudos
Message 3 of 6
(4,405 Views)
Solution
Accepted by topic author mgh94

Did you check the file read OK?

 

I tried like this and had some success, but for me I needed to set the delimiter to 5 spaces rather than tab... Perhaps your tab characters are converted to spaces by a text editing program?

 

v4_BD.png

 

You can change the 0.001 constant to a calculated value based on the text file as Crossrulz suggested. Here I used DAQmx functions because the DAQ Assistant was too frustrating, but if you prefer it I'm sure you can make that work too.


GCentral
0 Kudos
Message 4 of 6
(4,392 Views)

Thank you so much !!!

0 Kudos
Message 5 of 6
(4,383 Views)

Are you planning to continuously repeat this waveform? If so, you will have a phase discontinuity using your *.csv file data as is. Notice that your first point and last point in the file are both zero. When you repeat the sequence it will have two zeros at the beginning/end of each cycle and will introduce distortion products in the output. You need to download only N-1 points.

 

Capture.JPG

 

Message 6 of 6
(4,368 Views)