06-27-2017 12:16 PM
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?
Solved! Go to Solution.
06-27-2017 05:22 PM
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.
06-28-2017 01:07 PM
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?.
06-28-2017 11:25 PM
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?
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.
06-29-2017 10:15 AM
Thank you so much !!!
06-29-2017 12:20 PM
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.