01-18-2019 04:33 AM
Hi all,
I need to read a *.mat file converted in *.txt and use it as data source (palyback file).
I've done a trivial VI so to understand how works FILE I/O and is not clear how detect the EOF.
Basically my trivial example is made of following steps :
1) Open the source and destination files
2) in case of none error on both operation opend a while loop and reads from source and copy in destination
3) If the error code from read operation on source file is 4 (= EOF detected) than close the while loop and close all files
Now, I'm not anble to close the while loop and inside the destination file I found concatenate data from source file. Seems that after the end of source file, I restart from the top.
Example :
source file contains 12 34 56 78 90 => destination file : 12 34 56 78 90 12 34 56 78 90
In attach the VI for 2016 version.
Thanks for any suggestion
Solved! Go to Solution.
01-18-2019 04:51 AM
Hi zundap,
- always use shift registers for references!
- why do you need a loop when you read the whole input file at once?
- why do you close the output file in the loop and again after the loop?
- why don't you stop the loop with each error, not just error 4?
01-18-2019 05:33 AM