From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing to spread sheet

I want to record the data acquired by the analog module to a spread sheet.

I proceeded with the simple file writing programs in which i was able to record the voltage magnitude of the wave from simulate signal.vi. There was absolutely no problem.

But i want to measure the real world voltage signal which is acquired by the compact field point module cFP-AI-100. When i tried to write the values obtained from the field point to the file, the program was running but the spread sheet observed some error codes( not same as the usual error codes; but too many letters and characters spread randomly).

What was the problem?  Is it needed to place the field point read section inside the file write vi loop?


0 Kudos
Message 1 of 14
(3,520 Views)
Most likely, you are writing in binary format. We need more information on how exactly you are writing the file. Can you attach some code?
0 Kudos
Message 2 of 14
(3,515 Views)
I here attach the vi together with the spread sheet.

This is running, recording the  rms values,  but there  are some  absurd codes and characters.
How to rectify this?
0 Kudos
Message 3 of 14
(3,499 Views)
It seems you have an existing microsoft excel file. This is in a proprietary binary format!
 
Now you open that excel file and start writing an ASCII formatted table at the beginning. Next time you open the excel file, it is no longer recognized as being one.
 
One nice thing is the fact that you can give virtually any random text file a *.xls extension and excel does its best to interpret what's in it and open it accordingly. In this case it sees a plain ASCII table with columns separated by spaces and rows seperated by newlines so it start reading it as such. Unfortunately later it runs into the original binary xls headers and falls on its nose.
 
Open your xls file with e.g. wordpad to see what's happening. Do it also on an xls file that has not been mutiliated by your LabVIEW code yet. 🙂
0 Kudos
Message 4 of 14
(3,483 Views)
I want to modify the program i attached above.

I want to measure the rms value of the signal continously, but the values at discrete time intervels (say 5 min) has to be recoded in the file. How to modify the program.

Can i get the modified program attached?
0 Kudos
Message 5 of 14
(3,468 Views)
Sir

I tried to open the file in wordpad, notepad, word etc. But the same result. How to rectify my problem? How can avoid these absurd codes?
0 Kudos
Message 6 of 14
(3,440 Views)

Please read my answer again. I fully explain the reason.

Your LabVIEW program does not write these strange characters, they already exist in the file!

Solutions (pick one):

  • Open your file again in notepad, delete everything, save the empty file, run your LabVIEW program again. All better?
  • Change your open node to "create" instead of "open".
  • Set the EOF to zero after opening and before the loop.
  • ....
0 Kudos
Message 7 of 14
(3,428 Views)
I tried it with notepad and got the desired output. I herewith attach the vi i tried. I want to modify it. Now the field point is reading the values and after finding out the rms value, it is continuously written on to the file. But i want the field point to monitor the channel and display the rms values continously and the rms values at some intervel (say 5 minutes) is to be written on to the file. I tried it by placing the measuring part outside the loop and file part inside the loop. But it is not working well. the measuring part is also placed in another loop. But only one value gets written to the file. How can i solve my problem? Can i get the modified code?
Download All
0 Kudos
Message 8 of 14
(3,384 Views)

Hello Sumi,

I took a quick look at your code and noticed that you are closing your file inside the while loop.  This is preventing you from writing multiple points into one file.  I believe that if you move the close file VI outside of the while loop that you will be able to write multiple points into this same file.

An easy way to record only some values into a file is by using the iteration counter terminal included in the while loop.  You can choose to record every fifth iteration by checking if the iteration terminal is divisible by 5 and then only writing to file when the remainder is zero.

Good luck!

Janell R | Applications Engineer

0 Kudos
Message 9 of 14
(3,358 Views)
Sir,
    i am able to write all the entries from all the points, but these values are recorded conitinously. But i want to modify it by recording all points at a suitable time intervel.
How can i solve it
0 Kudos
Message 10 of 14
(3,339 Views)