Script to write to .txt file


Is it possible to write to an existing .txt or .csv file on the robot in order to create a log of sorts?

My idea is to record variable and time data for troubleshooting purposes. Things like:

  • Program Start Time
  • “Var_1” = xxx
  • “Var_2” = xxx
  • “Operation X completed”
  • Program end Time

I’ve seen the use of txtmsg() in other posts, but would like to avoid saving to log_history.txt if possible since it’s my understanding that it can be overwritten if file size exceeds a certain threshold. I would also like to avoid using a xmlrpc daemon as I don’t currently have hardware available or permissions to connect a PC.


I have used this nifty program template from Robotiq to export variables to a PC in CSV format.

Hope it helps,