# 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. This function is typically used to log data results that you view 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

Depending on the connected device and the function's Storage setting, the files are saved in different location.

Storage Setting | Connected Device | Saved 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.
Emulator In-Sight ViDi PC | PC
FTP Server | Any device | Specified FTP server