09-28-2018 02:14 PM
So, I might be looking at this too simply, but what I have hear is just a Create Folder function that has a folder path, with variable characters in it, attached to that function.
It actually seems to work a little because folders are made, one successfully inside the other inside the other, etc. But the folders' names aren't what I want. I want parent folder as the Year, first child folder the Month, and the second the day. And I tried to do this with those characters %Y, %d, and %m, as such. But I'm not sufficiently learned with that syntax.
Finally, when I run the code I get Error 10: Duplicate Path, but I have yet to solve that one. Attached here is an example file.
Solved! Go to Solution.
09-28-2018 02:46 PM
Thanks for including code -- I can clearly see what you want to do, but (as you already found out) you can't do it that way!
Do you know about the file functions Build Path and Strip Path? Build combines a Path and a String into a Path, and Strip splits out the last part (which is usually the File Name) as a String.
So what you need to do is get Year, Month, and Day as numbers or as strings. Let's say you have them as numbers, and want to build a folder structure that looks like \<Year>\<Month>\<Day>. Here's another wonderful function -- Format into String, and here it is in action:
You see the Year, Month, and Day pass into Format Into String. It has a "Format String" that would default to "%d %d %d" (three numbers separated by spaces), but I replaced the spaces by a backslash (which needs to be put in the Format String as two backslashes -- read the Help for an explanation). I then do a Build Path to create the Folder (note I don't need a backslash separating Path from "file", though this isn't a file, it's more of the path) and then add the Filename on with another Build.
You can learn more about these functions by simply trying them out. Drop them on a Block Diagram, right-click them and ask for Help, read the Help description, then write a little code to see if you can make it work for you.
Bob Schor
09-28-2018 02:46 PM
I think you should take some free LabVIEW training. The software is doing exactly what you asked, create a directory named %Y many thousands of times a second with no way to stop it. What you likely want is to create the folder that needs to be made by using the timing functions. Using this along with format into string and build path you should be able to make a folder with the format you want. But again I'd start with the training:
Here are some free training links if you are interested:
-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
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-28-2018 05:56 PM
This did great! I went a different route and had the date displayed as a string time stamp. Then I concatonated '\' onto the ends of each part of the date. And then fed that into the Format string, and then the build path. And from there attached that to the Create Folder. And Vuelah! It worked! Thanks again.
09-29-2018 09:09 AM
@ShogunOrta wrote:
And Vuelah! It worked!
Is that supposed to be Voilà? [If it is not supposed to be French, I'm curious what language it is ...].
Bob Schor
09-29-2018 10:07 AM
@Bob_Schor wrote:
@ShogunOrta wrote:
And Vuelah! It worked!
Is that supposed to be Voilà? [If it is not supposed to be French, I'm curious what language it is ...].
Bob Schor
Bob, I think your inner ear is calling you. 😉
10-01-2018 05:40 AM - edited 10-01-2018 05:41 AM
If starting from a time stamp, I recommend this:

10-01-2018 03:32 PM
Yep, I ended up doing something to that effect. It works fine! Thanks, guys.