# Load a Program Through an SLMP PLC/MC

You can swap the currently loaded program with another program stored on the vision sensor when you enable Inputs. You can change programs with a PLC by specifying a program ID. The ID is an integer between 0x0-0x14 in hexadecimal, or 0-20 in decimal value. Once the PLC executes the load command, the vision sensor loads the program if it finds one whose name contains the specified ID number.

Note:

- Always enable Inputs on the vision sensor before changing the program through the PLC. Otherwise, the program change request generates an error flagged to the PLC with errorID 0x0401.
- If you specify a program that does not exist on the vision sensor, that is, it contains no program with the specified ID, then an error is flagged to the PLC with errorID 0x0402.

Perform the following steps to change the program running on the vision sensor through a Mitsubishi PLC/MC:

On the vision sensor UI:

1. Enable Inputs and SLMP on the Communications tab of the Settings menu

On the PLC:

1. Use the applicable Command ID in the input block to initiate the program change.

   The ID is an integer between 0x0-0x14 in hexadecimal, or 0-20 in decimal value.

2. Set the Execute Command bit in the control block by triggering Bit 4 of Byte 0.

Wait for the Command Completed or Command Failed bit to be set, that is, Bit 6 or 5 of Byte 1, respectively, in the Status Block.

1. Clear the Execute Command bit.

Note: For the description of input and output assemblies, see SLMP Control and Data Blocks.