# Write Job

Sends a job A job is a user-configured program in Spreadsheet consisting of functions and designed for specific applications. You can create and edit jobs using the Spreadsheet interface, and load them on a vision system for deployment in a live environment. to the specified In-Sight job slot in flash memory on the In-Sight vision system.

Note:

- The In-Sight vision system must be Offline.
- This command only works on a job saved on the flash memory on the In-Sight vision system. If the job is stored on the configured Job Server or the SD Card installed to the In-Sight vision system, this command does not work.

## Write Job Inputs

Syntax: WJ<ID><Filename><Size><Data><Checksum>

The command and ID are sent on a separate line, followed by the lines of job data, which must be an exact copy of the data received from a Read Job command.

Parameter | Description
--- | ---
ID | The job ID number (0 to 999).

The lines of job data are:

Parameter | Description
--- | ---
Filename | The first line contains the job name.
Size | The second line contains an integer value in bytes for the size 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 terminating character.
Checksum | The last line contains four ASCII hexadecimal bytes that are a checksum of the job data.

## Write Job Outputs

Returns a status code, followed by a line terminator. The status codes are:

Status Codes | Description
--- | ---
1 | The command was executed successfully.
0 | Unrecognized command.
-1 | The job ID number is outside the allowed range (0 to 999).
-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 Job Example

To write job data to the job named 86Test.jobx, issue the following command: WJ86

After issuing the command, input the job name (Test.jobx), followed by the size (826) in bytes. Next, input each ASCII hexadecimal byte of the job file. Finally, input the four ASCII hexadecimal checksum bytes on the last line (D56E).

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.
- The size will be twice the number of bytes of the actual .JOBX file size stored on the In-Sight vision system, due to the ASCII hexadecimal encoding of the data.