How to Delete Files Deployed on Real-Time Controller

Updated Dec 22, 2023

Environment

Software

  • Measurement & Automation Explorer (MAX)

Operating System

  • NI Linux Real-Time
  • PharLap
  • VxWorks
  • Windows

I’m having difficulty deploying my project to the target or I’m encountering errors when attempting to run my code. Is there a way that I can directly delete the deployed data on the target without reformatting or reinstalling the software?

You can delete the deployed data, reboot the target, and attempt to redeploy.

Please use the steps below access and deleted deployed data: 
  1. Access FTP or SSH into the target by right clicking the target and clicking File Transfer in MAX.
  2. Navigate to the deployed data folder.
The path is dependent on your cRIO’s operating system. Please check the first link in the references section if you’re not sure what OS your cRIO is running.   

    VXworks and Phar Lap ETS: ni-rt/config 
    NI Linux RT: /var/local/natinst/deployfwk/config  
  1. ​Delete all contents of the folder.
  2. Reboot controller.

One of the ways how to delete files from an RT Linux target is via command shell.
Below you will find the steps on how to delete files/folders using Windows PowerShell. 
 

1. Right-click on the Start button and select Windows PowerShell or just use search and type Windows PowerShell.
2. After, please type the following to establish SSH connection:

ssh your username@ The target IP address for example: ssh admin@10.10.1.1.
If it will text dialogue and ask if you want to establish a connection, please type yes 
Note.  Usually, this dialogue appears only during the first connection.
If there's a password on a target it will also ask to type the password (In case of no password is set, it will skip this step).
  • After finishing the login process please type this command to remove files located in the specified folder:
rm (remove)  folder direction  
  • If you wish to delete only one file in the folder, please specify the directory for that file:
rm (remove)  folder direction/file name
  • In case we want to delete the folder with all the files we simply need to use this command:
rm (remove) -r (recursive) folder direction 

Here you can find examples for each tree scenario of deleting the files/folders using Windows PowerShell :
  •  This command will remove all the files located in the logfiles folder, but not the folder itself 
  Example: rm /c/logfiles/* 
  •   Command below will remove one file from specific folder 
  Example: rm c/logfiles/test.tdms
  •  The following example will show you how to delete folder with all files
  Example:   rm -r /c/logfiles                                                          
Note: You'll need to press "spacebar" between rm, -r, and the path.