09-15-2015 11:58 PM
I need a vi code to change the path for every new file creation.The file in the path will be a new file.Kindly please reply me.i don have any idea.
The Pseudo code for this is
IF(NEW FILE IS AVAILABLE IN THE FOLDER)
{
PERFORM CALCULATION IN THE OLD FILE;
CHANGE THE OLD FILE INTO NEW FILE;
}
ELSE
{
CHECK FOR NEW FILE;
}
Please kindly do the reply.
Solved! Go to Solution.
09-16-2015 03:52 AM
Have you looked at the File I/O functions? There are functions there to modify paths, copy files, check if a file/folder exists etc.
If you post your attempt at the code and maybe if you tell us which part specifically you are having a problem with then maybe we can help.
09-16-2015 10:34 PM
Thank you for the reply sir.Yes i have tried with File I/O functions.The data log will be done everyday (i.e) The readings will be written in the data log file for every 6 minutes and at the end of the day a new file will be created.So that everytime when it creates that has to be used like the above alogorithm as i mentioned already.Kindly help me to code it as i am a learner now.
09-17-2015 03:09 AM
Show me what you have coded so far and we can try to help you make it work properly. I'm not going to write your code for you and I have pointed you at the relevant palette where you can find the functions you need (e.g. list directory, open/close file etc.
I suggest if you are a beginner that you take some LabVIEW tutorials - there is a list of free training materials available here - scroll down to 'looking for free training'.
09-17-2015 02:00 PM - edited 09-17-2015 02:04 PM
Along with the tutorials in the Rules link Sam mentioned, note where it says not to contact users directly.
You're going to want these, I think:
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe." - Abraham Lincoln
Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-17-2015 11:11 PM
Thank you so much for your replies...
Here i have tried the code to read the file.But the file name is different when it compared with the date.Can i read the date of the file (i.e when it has been stored?).
09-17-2015 11:14 PM
Thank you so much for your replies...
Here i have tried the code to read the file.But the file name is different when it compared with the date.Can i read the date of the file (i.e when it has been stored?).
09-17-2015 11:16 PM
What do you mean by the file name is different when compared to the date?
In your screenshot (hard to read), it looks like the name of the file matches the date is was last modified.
So where is the problem?
09-17-2015 11:21 PM
Thank you for the reply..
The file name is like 18_9_2015 the date is like 18-09-2015 so i couldn't select the new file by using the date.So am asking do i have any way to search for the new file by using the date modified?
09-17-2015 11:31 PM
Dear Perarasi
Your Algorithm is not clear to answer... Still
1)If ur part of program creates the file, which holds the date of the day as its filename, u can search for the file which matches the current day date and can do ur calculation in the same file as like how u did in the above code.
2) If current date changes then ur part of program will create a new file of changed date, and it continues.
Other way u can create a file each day when u search for file with current date. If file exist do the operation there if not create the file of new date.
If u want the file name should not hold the date, then use date modified function to do the same.