# Load a job or recipe Through an SLMP PLC

Perform the following steps to change the job or recipe running on the vision system through a Mitsubishi iQ-Q or FX Series PLC.

1. If you are loading a new job, then first place the vision system to a Paused state by setting the Set Paused bit high in the Control block.

   Note: You can skip this step when changing recipes.

   Block | Byte | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0
   --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
   Vision Control | 0 | Set Paused | Reserved | Execute Command | Inspection Results Ack | Buffer Results Enable | Trigger | Trigger Enable
   1 | Reserved
   2 | Reserved | Clear Exposure Complete | Clear Error | Initiate String Command | Set User Data
   3 | External Event 7 | External Event 6 | External Event 5 | External Event 4 | External Event 3 | External Event 2 | External Event 1 | External Event 0

2. Indicate the current status of the vision system:

   Block | Byte | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0
   Vision Status | 0 | Online | Paused | Reserved | Acq Error | Reserved | Trigger Ack | Trigger Ready
   1 | Error | Command Failed | Command Completed | Command Executing | Results Valid | Results Buffer Overrun | Inspection Completed | System Ready
   2 | Reserved | Reserved | Exposure Complete | Reserved | String Command Ack | Set User Data Acq
   3 | External Event Ack 7 | External Event Ack 6 | External Event Ack 5 | External Event Ack 4 | External Event Ack 3 | External Event Ack 2 | External Event Ack 1 | External Event Ack 0

3. Write the Command ID of the selected action into bytes 0..1.

   Block | Bytes | Signal
   Output | 0 .. 1 | Command ID
   2 .. 3 | Reserved
   4 .. 1920 | User Data

4. Read the state of the Command Result Code in bytes 0..1.

   Block | Bytes | Signal
   Input | 0 .. 1 | Command Result Code
   2 .. 3 | Reserved
   4 .. 5 | Error ID
   6 .. 7 | Acquisition ID
   8 .. 9 | Inspection ID
   10 .. 11 | Inspection Result Code
   12 .. 1920 | Inspection Results

5. Set the Execute Command control bit to keep it set until the Command Completed bit gets set and to check if the Command Failed bit command failed.