12-02-2016 12:20 PM
I have an inspection program that write results to a text format logfile on every cycle. In that logfile I want to add the name of the inspection program. I realize I could do this with text on the block diagram, but every time I update the program and save it with a different name I will have to remember to change the text.
So, if my vi is called Resultfile1-0.vi I want to append that to the log file. If I then create a new version of the program and call it Resultfile2-0.vi I want it to write that to the logfile.
Any suggestions?
Solved! Go to Solution.
12-02-2016 12:25 PM - edited 12-02-2016 12:25 PM
Sure.
12-02-2016 12:26 PM
It call "Current VI's Path" in the File Contant palette
12-02-2016 12:29 PM
12-02-2016 12:30 PM - edited 12-02-2016 12:32 PM
Give credit to Omar. That is an even simpler iimplementation.
Either his or mine will give the full path if that is what you want. If you want just the file name, then use Ben's, or you would need to use Omar's or mine and use a Strip Path function after it to get just the filename. (and perhaps a path to string to convert it to a string.)
12-02-2016 01:12 PM
Thank you everyone. I was sure it would be simple, for someone who knows their way around the pallets.