Issue Details. I am using the Open/Create/Replace File function to open a file. When I write to the file multiple times, the data stored in the file is being overwritten with new data on each write. The image below shows an example of appending a string value to a text file. LabVIEW appends the text you enter in this text box to the header of the file. Click the OK button to save the current configuration and close the Configure Write To Measurement File dialog box. © National Instruments Corporation. You want to append the old values after the new ones, or you want to append the new values after the old? Appending the old values after the new requires opening the file with 'a+' access, seeking to the beginning of the file with fseek(fid,0,0), reading and recording the old values, seeking back to the beginning of the file, writing the new values, then writing the recorded old values. There is no built-in mechanism to 'insert' text 'moving over' the existing text automatically. Appending the new values after the old values requires opening the file with 'a' or 'a+' access, and writing the new values. This is easier and more robust. As has been said on LAVA before, people here are happy to guide and help but you need to make some sort of effort yourself as a starting point. So which part of the task are you stuck on? I would start by breaking the problem down, can you a ) read the data from your text file? If not look in the LabVIEW examples b) can you plot simple data on a graph? If not look in the LabVIEW examples. In fact there is an example provide by LabVIEW in the NI example finder that does basically what you need, plus several VI's on the NI LabVIEW forums which show you how to do this as well. Come back if you have a more specific question having looked at some of these. ![]() Several thing jump out looking at your VI. 1) File I/O is time expensive and the file is opened before read, read and then closed, reading the same file twice is a waste of time a lot quicker to open read once and the manipulate your data in the types you want. You can simple open read all data then, use spreadsheet string to array. 2) User event structures are not used in the way you have used it here, look at some event structure examples and read 3) finally what data are you actually trying to plot, just trying to understand your data a little.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2019
Categories |