03-26-2014 05:59 PM
Hi,
I have a line of numbers in a text file (from a real time simulation that is updating at approx 1 Hz. I need to in a while loop open the file make sure the the numbers are diiferent(I'm not reading the same file twice) and if the text file is new (different from the previous text file proceed with the rest of the code I wrote. Can I use a feedback node? Thanks
03-27-2014 02:48 AM
Hi,
Do you have a code which you are working on?
If you are saying that you want to read different files every time the code runs, you can use Get File Extension VI to extract the name of the file without the extension. On the first iteration, you can extract the file name and store it in to a look up table. On the next iteration, you can use the value you extracted from the Get File Extrension VI and search in in the look up table using Search 1D Array VI. If it is not in the list, it should give a value of -1 which then you can proceed reading it.
You can use Shift Registers if you want to compare past values with the current.
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/get_file_extension/
If you are saying that you want to create different files to write on so that you can write on different files, you can use the functionality of Open/Create/Replace File to create the file if the file path you specify does not exist.
http://zone.ni.com/reference/en-XX/help/371361H-01/glang/open_create_replace_file/
Warmest regards,
Lennard.C