A PLC may need to change vision recipes when a production line switches between container sizes, labels, or inspection tasks. The difficulty is often identifying the correct recipe through a documented serial interface, rather than transmitting the message itself. This explainer shows how to evaluate command-to-recipe mappings, preserve their configuration, and verify a controlled changeover. It does not assume that every vision application supports remote selection or provides a dedicated select command.
Decide whether the interface can address a recipe
RS232 provides a serial connection; it does not define recipe names, commands, acknowledgments, or application behavior. Those belong to the vision application's documented remote protocol.
Start by finding the documented operation that loads or opens a recipe. Some interfaces accept a recipe identifier as an argument. Others allow configured command values to be associated with particular recipes. An interface might therefore support recipe selection through an open operation without providing a separate select operation.
That mapping must exist in the application and be supported by its documentation. Sending a different number cannot create functionality that the interface does not provide.
Before programming the PLC, establish these points:
- Can the remote interface address recipes that are not currently open?
- Is selection based on a name, identifier, configured command value, or another documented field?
- Which configuration determines the mapping when the application starts?
- Can the application report the identity of the loaded recipe?
- Does the installed software edition include the required remote-control feature?
For comparison, local recipe switching from operator buttons addresses the operator-control path. Serial selection adds message addressing, response handling, and communication recovery to that problem.
Assign unique command mappings within the documented scope
If the application supports configurable command-to-recipe mappings, maintain an explicit registry. Record the command value, operation, target recipe, and expected response together.
Uniqueness must match the protocol's lookup scope. A value might need to be unique across all configured recipes, or only within an operation or connection. Do not assume that separate recipe files create separate command namespaces.
The following table illustrates a registry design. These numbers are example configuration identifiers, not a usable wire protocol or instructions for any particular application.
| Recipe identity | Example open value | Expected active identity | Revision record |
|---|---|---|---|
| Container-small | 101 | Container-small | Approved recipe revision |
| Container-large | 201 | Container-large | Approved recipe revision |
| Label-check | 301 | Label-check | Approved recipe revision |
Only use values within the interface's documented range. If other operations also use configured values, check their collision rules before assigning them.
Avoid deriving recipe identity from a numeric pattern alone. An offset of 100 may make a register list readable, but it does not prove which recipe the application will load. Keep a controlled lookup table rather than calculating undocumented command values in the PLC.
Also distinguish recipe identity from recipe revision. Loading the correct name with outdated inspection settings can be as damaging as selecting the wrong name.
Preserve the mapping separately from the inspection logic
Do not assume that saving a recipe also saves its serial command mapping. Depending on the application, communication settings may belong to the recipe, application configuration, service configuration, or another documented storage location.
Identify that location through the software documentation and supported export functions. Then include it in the machine's backup and restoration procedure.
A useful changeover record contains:
- Recipe identifier and approved revision.
- Associated remote operation and configured value.
- Serial port settings and message-framing rules.
- Expected success, busy, and error responses.
- Startup behavior and the documented recovery procedure.
- Configuration export location and validation date.
Test persistence by closing and restarting the application under controlled conditions. Repeat the identity query and selection test after restoring the configuration to the intended installation. A mapping that works only until the next restart is not ready for production.
Treat edits to this registry like software changes. Review the PLC lookup table and the vision-side configuration together. The machine-vision software upgrade validation checklist provides a related framework for checking behavior after application changes.
Use a controlled changeover state machine
Keep recipe selection separate from the normal inspection trigger path. A PLC state machine makes the transition visible and prevents new work from entering while the vision application is changing state.
- Latch the requested identity. Validate it against an approved list, and prevent operator edits from changing the target halfway through the transaction.
- Suspend new inspection requests. Use the application's documented stop, pause, or inhibit behavior. Account for inspections already accepted.
- Resolve outstanding work. Finish or cancel pending inspections through supported procedures. Track any results that can still arrive.
- Close the previous recipe if required. Some interfaces require this; others handle replacement directly. Follow the documented transition sequence.
- Send the mapped selection operation. Transmit the complete message with the required framing, terminator, and integrity field, where specified.
- Wait for the documented response. Distinguish acceptance, completion, rejection, and busy states rather than treating every reply as success.
- Verify the active identity. Compare the reported recipe with the latched request. Check revision information if the application exposes it.
- Resume inspection deliberately. Release the normal trigger path only after the required ready state and identity checks pass.
If any stage fails, hold the changeover in a defined fault state. Do not continue by assuming that the most recently requested recipe became active.
For conveyor applications, previously generated results may remain valid only for the previous recipe and workpiece stream. See conveyor vision scene timing and stale pick data before deciding how to drain or invalidate that work.
Separate acknowledgment from active-recipe verification
An acknowledgment answers a specific protocol question. It might mean that the message was received, its syntax was accepted, or the requested operation finished. Those meanings are not interchangeable.
Build the PLC logic around the documented response semantics:
| Received condition | What it establishes | Appropriate next action |
|---|---|---|
| Message accepted | The request passed the documented acceptance checks | Wait for completion or query state |
| Busy response | The operation cannot proceed immediately | Apply the documented wait or retry policy |
| Completion response | The requested operation reports completion | Verify identity and readiness |
| Error response | The requested operation failed | Record the error and hold changeover |
| No valid response | The outcome is unknown | Recover communication before proceeding |
If the protocol provides transaction identifiers, use them to match requests and replies. Otherwise, serialize requests and follow the documented synchronization procedure after a timeout. A late reply must not satisfy a later, unrelated request.
Prefer a direct active-recipe query. If that is unavailable, evaluate whether a documented application output can expose a recipe identity or approved signature. A generic ready bit alone does not identify the loaded inspection.
Recipe ownership can introduce another failure path when several control sources are present. The guide to vision picking project changeover and ownership faults covers that distinction without treating communication success as proof of control ownership.
Estimate serial timing without confusing it with loading time
Serial transmission time is usually only one part of a changeover. Recipe loading, resource release, status polling, and readiness checks can take longer than the message transfer.
For asynchronous serial communication using 8 data bits, no parity, and 1 stop bit, each byte occupies 10 transmitted bits, including the start bit. The wire-time estimate is:
Assume an illustrative exchange contains a 40-byte request and a 40-byte response at 9600 baud:
Suppose the measured application operation takes 250 milliseconds, the verification exchange takes 100 milliseconds, and PLC sequencing adds 50 milliseconds:
This is an example estimate, not a timeout recommendation. Additional exchanges, operating-system scheduling, retries, and application state can extend it. Different serial framing also changes the transmitted bits per byte.
Measure changeover duration across repeated transitions, including the largest recipes and realistic processing loads. Set timeouts from documented limits and validated measurements, with an appropriate margin for the machine.
Do not retry a timed-out open operation blindly. It may already have completed. Query the documented state first, or use the application's specified recovery sequence when the outcome remains ambiguous.
Choose hardware only after confirming protocol support
A connector, processor, or network interface does not establish support for remote recipe selection. Confirm the serial electrical interface, software protocol, licensing requirements, and permitted control operations separately.
Start with the vision controllers category when the application requires a separate processing controller. The MV-VC2101-128G40-NN is a vision-controller option for evaluation. Its catalog listing does not establish support for the remote interface described here.
- LAN ports
- 3-4 LAN ports
- USB 3 ports
- 2 USB 3 ports
- Memory
- 16 GB
- Processor
- Intel N-series
For device-side inspection, compare the smart cameras category through the camera finder. Confirm that the particular camera and installed application provide the required recipe management and identity reporting.
The MV-SC6050M-12M-XBN is a smart-camera option to evaluate. This article does not establish that it accepts the example command mappings or provides an RS232 connection.
- Interface
- GigE
- Resolution
- 5 MP
- Sensor format
- 1/1.45"
- Shutter
- Global
Select camera power and I/O cables from the accessories finder only after checking the equipment's connector documentation. Connector shape does not establish signal type, voltage levels, or pin assignment.
The MV-SCA-P-M12A17pF-open-ST-10m is a catalog power-cable example. Its listing is not evidence of an RS232 pinout or compatibility with a PLC serial port.
- Type
- Smart Camera Power and I/O Cables
Check whether each endpoint actually uses RS232 rather than another serial electrical standard. Follow the documented transmit, receive, reference, shielding, and isolation arrangements. Make wiring changes only under the machine's approved electrical work procedure.
Validate normal operation and failure recovery
Commission with production motion inhibited through the machine's approved procedure. Use application logs and PLC state records to capture the requested identity, transmitted operation, response, verified identity, and elapsed time.
Run this acceptance checklist:
- Select every approved recipe. Confirm the reported identity rather than relying on the displayed image.
- Select the already active recipe. Verify the documented response and whether existing results remain valid.
- Request an invalid identity. Confirm rejection without starting inspection under an unintended recipe.
- Repeat a valid request. Check documented duplicate-command behavior before enabling automatic retries.
- Interrupt communication during a transition. Confirm that the PLC treats the result as unknown until recovery establishes state.
- Restart each endpoint. Verify mapping persistence, startup identity, and readiness sequencing.
- Test a slow transition. Confirm that the timeout path blocks production without creating a retry loop.
- Restore the approved backup. Repeat selection and identity checks after restoration.
Restart behavior deserves its own test because communication recovery and application readiness may occur at different times. The guide to conveyor vision startup synchronization explains the related startup sequencing problem.
Record pass criteria before testing. A successful demonstration is repeatable identity confirmation and controlled recovery, not merely one successful serial exchange.
Know when command mapping is the wrong approach
Unique command values are useful only when the application documents that addressing mechanism. They cannot compensate for an interface that controls only the currently loaded recipe, lacks remote loading, or cannot provide sufficient confirmation.
If selection is unsupported, use another manufacturer-documented interface or a supported local workflow. Obtain any required software options through legitimate licensing channels. Do not modify configuration internals to imitate an unavailable command.
For larger recipe sets, a documented identifier-based interface may be easier to maintain than a growing command registry. Choose the mechanism that gives you traceable identity, predictable recovery, and manageable configuration changes.
Before ordering, collect the application's remote-interface documentation, required recipe identities, electrical interface details, and verification requirements. Send those requirements through application support to check suitable hardware and cabling without assuming that a catalog part supplies the missing protocol.
Questions
Does remote recipe selection require a dedicated select command?
Not necessarily. A documented open or load operation may accept a recipe identifier or use a configured command value associated with a recipe. Check the application's remote-interface documentation before implementing this approach. An interface that controls only the active recipe may not support remote selection at all.
Do command values need to be unique across every recipe?
Follow the protocol's documented addressing scope. Some applications require values to be unique across all registered recipes, while others distinguish operations or endpoints. Maintain a reviewed registry and check for collisions whenever recipes are added, removed, or restored from backup.
Does a successful acknowledgment prove the correct recipe is active?
It proves only what the protocol assigns to that acknowledgment. Reception, acceptance, and completed loading can have different responses. Before resuming inspection, verify the active recipe identity and the required ready state. Include revision information when the application exposes it.
What should the PLC do after a recipe-selection timeout?
First treat the operation's outcome as unknown. The application may have completed the request even though its response was lost. Follow the documented state-query or recovery procedure before retrying, and keep new inspection requests inhibited until identity and readiness are established.
Will copying a recipe file also copy its serial command mapping?
Do not assume so. Communication mappings may be stored outside the inspection recipe, depending on the application. Identify the supported configuration export procedure, back up every required configuration component, and validate the mapping after both an application restart and a controlled restoration.


