LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can someone please tell me on how to modify this code so that I dont have to enter the file name at all?

Hello 🙂

can someone please tell me how to modify this code so that I dont have to enter the file path at all? When i give the same file path constants to both the read and write VIs I'm getting an error message.

0 Kudos
Message 1 of 4
(2,409 Views)

What's the error message? 

0 Kudos
Message 2 of 4
(2,393 Views)

Guessing until you post the error message: The Read VI opens the file, reads the data, and closes the file. A few microsconds later the Write VI tries to open the file. If the OS has not completed the process of closing the file, an error could occur.

 

Two options: 1.  Place a Wait (ms) before the Write VI. You will need to determine the value of the wait experimentally for your system. And it might change the next time you do an OS update or as the disk becomes more fragmented.

2. Use lower level file I/O VIs/functions so that you open the VI one time, read followed by write, and then close the file one time. This will require you to do your own data formatting but that is easy with Array to Spreadsheet String from the String palette.

 

Lynn

Message 3 of 4
(2,362 Views)

Yup use the low level File I/O opening the reference once, and closing it once.  

 

As for the path selection you have an unwired input which is the path to use.  Programatically set that and you won't be prompted to select a path.  Usually this is done with a path constant to a folder, then using the Build Path, to set the file name in that folder.

0 Kudos
Message 4 of 4
(2,331 Views)