Appearance
Vision: programs and product changeover
Last updated
License feature: Machine VisionA line that makes more than one product needs more than one inspection — different part counts, different limits, a different label to read. Each is a program: a named set of tools. A device holds as many programs as you like and runs one at a time. Cameras, scale, trigger, lighting sequence and archive settings are shared by all programs.
A device set up before programs existed reads as one program with key default, named Default.
The Programs card
| Control | What it does |
|---|---|
| Program buttons | Choose which program you are editing. The one the device is running has a green dot |
| Add | A new program programN with one Circles tool |
| Duplicate | A deep copy of the program you are editing, key <key>_N, name "… copy". A new product usually starts as a copy of a similar one |
| Program name | Label, up to 60 characters. Can be written to the program tag instead of the key |
| Program key | What a recipe or PLC writes. Cleaned when you leave the field (lower case, a–z 0–9 _). "Write "bottle_500" to the program tag to run this one. Changing the key breaks recipes that use the old one." |
| Run this program | Makes the program you are editing the running one — when you press Save. The label changes to "Runs on the device when you save" |
| Bin icon | Removes the program you are editing. Disabled on the last one ("A device needs at least one program."). Removing the running program makes the first program run on save |
Editing a program is not the same as running it. Tuning the next product while the line makes this one is the normal way to prepare a changeover — Grab one uses the program you are editing. Save never changes which program runs unless you pressed Run this program, so a changeover made by a PLC while the page is open is not undone.
Changing over from outside
Write to the vision device's tags:
| Write | To | Matches |
|---|---|---|
The program's key, e.g. bottle_500 | program | Key first, then name (not case-sensitive) |
The program's position from 1, e.g. 2 | program_number | Position (a whole number) |
The switch takes effect on the next inspection and is saved, so it survives a restart. An unknown program is refused: "No program "bottle_750" on this device. Programs: default, bottle_500."
With the recipe engine: add a recipe parameter that writes the program's key to the vision device's program tag. Applying the recipe changes over the inspection with everything else the product needs, and recipe history records it. Put the program parameter before any vision limits in the recipe: a setting written to a vision device applies to the program that is running. See Recipes.
Rules that keep a changeover safe
- Tags never move. The device publishes the tags of every program's tools all the time, so a screen or alarm bound to one keeps working. A tool the running program does not use reads uncertain with its last value.
- A changeover invalidates the verdict. Until the new program has inspected something,
pass,judgedand every tool result read uncertain. - A changeover resets the counts. It is a batch boundary; the historian keeps the last product's figures.
- A tool key keeps one type across programs.
dotscan be a circle counter in two programs with different targets, but not a counter in one and a barcode reader in another. Saving that is refused: "Tool "dots" is a circles tool in "Small tray" and a barcodes tool in "Large tray". A tool key keeps one type across programs, because its tags depend on it — give one of them a different key." - Two programs cannot share a key ("Two programs share the key "…"."); on save a duplicate key is renumbered.
- Settings follow the running program. Writing
cap/minValuewhile a program without acaptool is running is refused, rather than quietly changing a product that is not being made. - Where the same tool key appears in several programs, its setting tags show the values of the running program.
Worked example: two bottle sizes
- Build program 500 ml (key
bottle_500) with toolscap(Presence) andfill(Caliper, liquid level), and tune it. - Duplicate it, rename to 750 ml, key
bottle_750. Redraw thefillregion for the taller bottle and set new limits. Grab one with a 750 ml bottle to check. Save (the 500 ml program is still running). - In the 750 ml recipe, parameter 1 writes
bottle_750toBottle Camera→program; later parameters writefill/minValueandfill/maxValueif they vary by batch. - Apply the recipe.
program_namereads 750 ml;passreads uncertain until the next bottle is inspected.