LabVIEW SignalExpresss Save to ASCII/LVM Express VI Always Appends to File in While Loop
Primary Software Version: 2.0
Primary Software Fixed Version: N/A
Secondary Software: Lookout, LabVIEW Development Systems>>LabVIEW Full Development System, LabVIEW Development Systems>>LabVIEW Professional Development System
I am using a Save to ASCII/LVM Express VI from the LabVIEW SignalExpress palette in a While loop in my LabVIEW VI. I have wired a boolean control to the close(T) input of the Save to ASCII/LVM Express VI and the loop condition terminal of the While loop, but no matter what settings I select in the If file already exists menu, data is always appended to the end of my file. Why is this happening?
This behavior occurs when you place the Save to ASCII/LVM Express VI in a while loop, as shown in the image below.
This is expected behavior of the Save to ASCII/LVM Express VI. By wiring the Stop control to the close(T) input of the Save to ASCII/LVM Express VI, you can control when the file is closed. This prevents LabVIEW from overwriting the data in each iteration of the While loop. In this case, the behavior selected in the If file already exists menu (shown below) occurs for every execution of the While loop and not every iteration. That means that if If file already exists is set to Overwrite then data will be appended to the file for every iteration of the While loop until the stop control is true. However, if the program is run again, the new data will overwrite the old data in the file until the stop control is true again.
KnowledgeBase 4IBDB909: Importing and Exporting Data in LabVIEW SignalExpress
- Save to ASCIILVM.JPG
- If file already exists.JPG
Report Date: 05/09/2007
Last Updated: 07/02/2008
Document ID: 49884D84