Way to have mesh scanning create numbered files?
-
Is there a way to have the G29 output an additional file in a separate folder, for logging purposes?
I would like to have a folder called "heatmaps" and store each scan with a timestamp as filename, so I can go back and see how it have changed over time.
Is that or something similar already available or do I need to write my own macro for it?
-
@Reine there's no built-in facility to do that, but you can write your own mesh.g file to do it. Simplest would be to use G29 S0 to do the probing, then G29 S3 P{"heightmap-"^state.time^".csv} to save it to a unique name. [I have not tested this.] This assumes that you have connected DWC to the Duet before probing, so that the Duet knows the date and time.
-
@dc42 ahh oki, so G29 keeps the current mech in memory, so I could in theory to multiple G29 S3 Pxxxx to save the current mesh in several files without doing file-copy operations?
Where can I read more about what files are called, like the mesh.g, I didn't know the system looked for that file first and if not found falled back to something internal?
-
@dc42 just tried to save with a timestamp as you suggest and that works, but accessing the file fails.
Guess the ":" are the issue, can't even rename or delete it. Where in the SBC filesystem can I find the directory for those files?
-
@Reine see https://docs.duet3d.com/en/User_manual/Machine_configuration/DSF. Yes, the ":" characters will be a problem.
-
@dc42 perfect, thank you. I did some Googling about string functions and found it had been discussed before but never implemented? Which I can understand.
I also had a quick look in the object model and found the state.time property.
Have I just missed it or is there no build in functions to either format the date or manipulate the string?
-
@Reine there are no string handling functions yet.
-
You can always use the "Seconds since time started" as your timestamp in your filename. Putting a "+" in front of state.time gives you this number.
G29 S3 P{"heightmap-"^+state.time^".csv"}
This will keep your files in order.
Then you can append the human readable timestring into the heightmap file so you'll have it. -