# Write File

Sends a job to the flash memory on the In-Sight vision system.

Note: The In-Sight vision system must be Offline.

## Write File Inputs

Syntax: WF<Filename><Size><Data><Checksum>

The command is sent on a separate line, followed by the lines of job data, which needs to be an exact copy of the data received from a Read File command. The lines of job data are:

Parameter | Description
--- | ---
Filename | The name of the job. The command executes with or without the .JOBX extension.
Size | The second line contains an integer value for the size (in bytes) of the job.
Data | The actual job data is encoded as ASCII hexadecimal values formatted to 80 characters per line. Each line ends with a sequence of a carriage return and a line feed character.
CheckSum | The last line contains four ASCII hexadecimal bytes that are a checksum of the job data. The vision system calculates the checksum from the transmitted ASCII values of the hexadecimal encoded data, and not from the byte values of the file contents. For more information, see Native Mode Checksum.

## Write File Outputs

Status Codes | Description
--- | ---
1 | The command was executed successfully.
0 | Unrecognized command.
-2 | The job could not be written, or the job data is invalid.
-3 | The checksum failed. The checksum does not match the job data.
-4 | The In-Sight vision system is out of memory.
-6 | User does not have Full Access to execute the command.

## Write File Example

To write job data to the job "text.jobx", issue the following command: WF. After issuing the Write File command, the first input is the job name (text.jobx), followed by the size (22) in bytes. Next, each ASCII hexadecimal byte of the job file is input. Finally, the four ASCII hexadecimal checksum bytes are input on the last line (4206).

The In-Sight vision system responds with 1, indicating that the job was successfully sent to the flash memory of the vision system.

Note:

- If the job file already exists on the vision system, the existing job data is overwritten.
- If the job file does not already exist on the vision system, a new job file is created with the specified name.