# Change Job Through the PLC

You can swap the currently loaded job with another job stored on the vision system while the device is . Compared to swapping recipes, changing jobs allows you to modify every aspect of the application on the fly (such as the HMI or the input/output settings as well), at the cost of the following drawbacks:

- Slow swapping time (a minimum of 3-5 seconds, with the actual duration depending on the contents of the job, such as the number of LatchImage cells in the spreadsheet,.
- The vision system must be or when initiating the job change.
- The WebHMI must be reloaded.
- The I/O system is de-energized for a longer period.
- The In-Sight adapter may lose changes, if it is open.
- The WebHMI and the I/O settings must be duplicated between jobs, even if they remain the same.

You can change jobs with a PLC by two means:

- By name: You can change jobs by specifying their name (without the *.jobx extension). In this case, the PLC supplies the ASCII character string in the userdata segment corresponding to the name of the job you want to switch to.

  For example, if you supply the string "myjob" in the userdata segment, then the vision system will load the myjob.jobx job once the PLC executes the load command (0x4000 in hexadecimal, or 16384 in decimal value).

- By ID: You can also change jobs by specifying their ID (an integer between 0x0-0x3E7 in hexadecimal, or 0-999 in decimal value). Once the PLC executes the load command, the vision system loads the job if it finds one whose name contains the specified ID number.

  For example, if you have a job named 111_myjob stored on the vision system, then specifying command 111 will load that job.

See the below table for a summary of the available job change commands and command IDs:

Action | CommandID (Hex) | CommandID (Dec)
Load Job by Name | 0x4000 | 16384
Load Job by ID | 0x0-0x3E7 | 0-999

Note:

- Always set the vision system to a or state before changing the job through the PLC. Otherwise, the job change request generates an error flagged to the PLC with errorID 0x0401.
- If you specify a job that does not exist on the vision system (that is, it contains no job with specified name or ID, then an error is flagged to the PLC with errorID 0x0402.

See the applicable protocol-specific topic for more information on how to perform a job change:

- For Ethernet/IP, see:
- For PROFINET, see: Load a Job Through a PROFINET PLC