# How to Configure the WriteData Function

The WriteData function allows you to write data to a file or append a data string to a file on a local device or an FTP server. You can use this function to log data results and view them in a file.

Note: You can save the file to the selected Storage location while Online or Offline.

The following describes how to configure the WriteData function when connected to an In-Sight vision system.

1. Connect to the In-Sight vision system.

2. Insert the WriteData function into the spreadsheet, which will open the WriteData property sheet. Configure the following parameters, using the default settings for the rest of the parameters.

   - Data: Enter a text string or a reference to a cell containing a text string you want to write or append to a file. In this example, the Data parameter references cell C0, which is configured as: Stringf("Test string.\r\n")
   - File Name: Enter a File Name for your data file.

3. After configuring the parameters, click OK to close the property sheet. The WriteData data structure is inserted to the spreadsheet.

4. Trigger the vision system.

5. A data file (InSight.txt) is stored on the In-Sight device, and within the file, "Text string." is written.

6. If you trigger the vision system again, within the text file, another "Test string." is appended to the file.

7. Use FTP software to view the files. For more information, see How to View Files Stored on In-Sight Device.

Note:

- For more information on each parameter setting, see WriteData.
- If you would like to send the files to the SD card installed to the In-Sight device, enter sdcard in the File Path field.
- If you would like to send the files to an FTP server, set Storage to FTP Server and enter the server address (Server), User Name and Password in the corresponding field.

## Storage Locations

The save location depends on the connected device and the Storage setting of the function.

Storage Setting | Connected Device | Save Location
--- | --- | ---
Local Device | In-Sight Device | In-Sight device SD card installed to the In-Sight device Note: You must use FTP software, such as FileZilla Client, to view files. For more information, see How to View Files Stored on In-Sight Device. If you use SD card storage, make sure that you plug in the SD card before running the job. If you configure SD card storage without plugging in an SD card, the job saves the files to the /sdcard directory of the internal flash drive.
PC | PC Note: Saving to a PC is only supported using an FTP server.
FTP Server | Any device | Specified FTP server