Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
2 rating:
 1 out of 5   

LabVIEW SignalExpresss Save to ASCII/LVM Express VI Always Appends to File in While Loop



Primary Software:
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

Problem:
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?

Solution:
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.



Related Links:
KnowledgeBase 4IBDB909: Importing and Exporting Data in LabVIEW SignalExpress

Attachments:


Save to ASCIILVM.JPG - Save to ASCIILVM.JPG
If file already exists.JPG - If file already exists.JPG



Report Date: 05/09/2007
Last Updated: 07/02/2008
Document ID: 49884D84

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit