Permission Denied when trying to write CSV file from Python

I’m trying to log some data as I run a routine on my xArm 6. I’d like to use Python to write my data out to a CSV file, but I’m getting a permission denied error. This error happens regardless of the path I specify to the file. My assumption is the Python environment running in Ufactory Studio doesn’t have sufficient permissions. Any advice as to how I can work around this?

Hi Sheimend,

For security reasons, we don’t allow customers to write data to our controller, it may damage our system and is highly risky.

What data do you need to record? You can use an external python IDE, for example PYcharm, so that you can save the log on your local PC.

Best regards,

I didn’t realize the Blockly interface was running code on the controller and not on my local PC.

I moved the code out to Visual Studio on my PC to execute in my local Python instance and it works just fine now. For reference, I’m taking measurements from a load cell as I move the arm around a path and need to log the load cell data, but the broader scenario is using the arm for any type of data logging.

It would be really handy to have a log file function available in the Blockly interface. For example, to record sensor data, or success or failure for a task. I’ll be using my robot for some product reliability testing where it will run a routine unattended until I detect a product failure. I’ll need to have a log of that data.

I can accomplish this via Python running locally, but it would be handy to have some file create & append functions available for logging via Blockly, either to a sandbox on the controller or maybe over Ethernet to a host controller.

For the Blockly log file, do you mean add a download button here to download the log of the Blockly?