So, I'm new to labview and am having trouble writing one program in particular. I have a waveform graph that runs for 120 seconds generating a sine curve. I am, however, having a difficult time getting the program to write the x and y coordinates into a text file. I have attached what I have so far.
The first task I was assigned was to write a program that creates a snusoidal curve on the front pannel adding one data point each half second for 120 seconds. The plot should only start when the user presses a start button.
The next part involves giving the user an option to write the generated data to a spreadsheet file called "sine.txt". The file name and location should be hardcoded. The file should contain the x and y coordinates of each data point in columns separated by tabs, also known as delimited.
I have spent several hours tweaking the attached program and I just can't seem to get it to work right. Any suggestions would help at this point.
A frustrated chemistry student whose research mentor is out of town 😞
Solved! Go to Solution.
You are missing the "Sinusoidal Wave.vi" which is what is creating the signal.
I don't understand why you have a 240 iteration For Loop in both cases.
I don't understand why you have nearly identical code in both cases with the only real difference as whether the signal goes to a graph or to a file.
I set the iteration to 240 because the data is supposed to update for 120 seconds at 1/2 second intervals. The only difference between the code within the true/false cases should be the either writing to an excel text file or not. That is the issue I'm having problems with. I wanted the excel files to have tab delimited columns for the x and y coordinated from the graph. How can I do this?
First, you are not creating Excel files. You are creating text files. And it seems that your Write to file is already creating X (time) vs. Y (data curve) that is tab delimited.
Everything else you are doing is just too complicated or a Rube Goldberg.
All you need is the attached.