Macro for writing to a CSV

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Macro for writing to a CSV

Postby Gilias » Tue Sep 24, 2024 6:37 am

Hello,

Can I write tool data to a CSV file using a macro?

I would like to monitor my tools and their lifespan using a CSV file. By writing to and reading from the CSV file, the lifespan should be tracked. Once the lifespan is reached, a message should appear on the screen.
Gilias
 
Posts: 2
Joined: Tue Sep 24, 2024 6:36 am

Re: Macro for writing to a CSV

Postby eabrust » Thu Sep 26, 2024 12:26 am

Hi Gilias,

Here's a few threads that will give some info on how to write to text file from a macro:

http://www.forum.cncdrive.com/viewtopic.php?f=11&t=3437&p=25052&hilit=write+text#p25052

and

http://www.forum.cncdrive.com/viewtopic.php?f=11&t=4586&p=31347&hilit=write+text#p31347

You'll have to workout the gathering of the tool info from variables, then just make sure you save a comma between all your items and save the file w/ a '.csv' extension.

regards
Eric
CraftyCNC: Plugins for UCCNC (and other neat stuff): http://www.craftycnc.com/plugins-for-uccnc/
eabrust
 
Posts: 357
Joined: Fri Sep 16, 2016 2:32 am
Location: Near Shirland IL, USA

Re: Macro for writing to a CSV

Postby Gilias » Thu Sep 26, 2024 7:32 am

Thank you for the information; that already helps a lot!

This is more about writing to text files, but is it also possible to read from these files?
Gilias
 
Posts: 2
Joined: Tue Sep 24, 2024 6:36 am


Return to Macros

Who is online

Users browsing this forum: No registered users and 7 guests