Showing results for 
Search instead for 
Did you mean: 

Can a vi find out it's own file name?

Go to solution

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 I want to append that to the log file. If I then create a new version of the program and call it I want it to write that to the logfile.


Any suggestions?

0 Kudos
Message 1 of 6
0 Kudos
Message 2 of 6
Accepted by topic author another_novice

It call "Current VI's Path" in the File Contant palette

0 Kudos
Message 3 of 6
Accepted by RavensFan


Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6

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.)

0 Kudos
Message 5 of 6

Thank you everyone. I was sure it would be simple, for someone who knows their way around the pallets.

0 Kudos
Message 6 of 6