Skip to content
Contact Get Started

External Program Selection

A part arrives at the machine with a label on it. Instead of scrolling the program list and reading a number off a traveller, the operator scans the label and the matching program is selected.

Fitting the reader is a configuration change on the machine. No software is written and no new build is deployed.

The machine’s peripheral configuration file, PeripheralConfig.xml, lists the devices this machine is fitted with. A machine with none ships it empty and no readers are started.

<PeripheralConfig>
<Device id="barcode1"
type="hid_keyboard"
vid="0x1EAB" pid="0x8102"
terminator="CR"
target="program_name"
channel="1"
enabled="true"/>
</PeripheralConfig>
AttributeWhat to enter
idany unique name; it is what logs and faults call this reader
typehid_keyboard or serial
vid pidhid_keyboard: the USB or Bluetooth ids, in hex, used to find the device
pathan explicit device node or serial port; used instead of vid/pid when given
baudserial only
terminatorCR, LF or CRLF, whichever ends one reading. serial only; a keyboard-emulating device sends ENTER
targetwhat a reading means. program_name selects the program of that name
channelwhich channel the program is selected on
enabledfalse parks the device without deleting the row

The file ships with one row already written and enabled="false". Fill in the real vid and pid once the scanner is on the machine, then set it to true.

State a channel on a machine with more than one. The control does not pick one for you, and a reading that does not name a channel is refused. A single-channel machine may leave it out.

  • hid_keyboard: the common handheld scanner, USB or Bluetooth, which presents itself as a keyboard and types what it reads.
  • serial: a fixed-mount reader or a scale on a serial port, with each reading ended by the terminator you set.

A keyboard-emulating scanner is claimed exclusively while it is open, so a scan cannot also be typed into whatever field has focus. Without that, a barcode lands in the MDI line or in the program editor.

The reading is the program’s own name, used as it is read. There is no lookup table to keep in step, and a program posted from CAM is selected by a scan exactly like one written on the panel, as long as the label carries the name the program is stored under.

A scan loads the program and stops there. Cycle start is still a separate action, and the PLC still decides whether that start is permitted. A label passing in front of a scanner cannot put the machine in motion.

Every scan reports one of these, so a reader that has stopped working never looks like a quiet machine:

OutcomeMeaning
Loadedmatched, and the program is now selected
No matchno program carries this identifier: an everyday event, not a fault
Unknown targetthe target on the device is not one this control handles
Ambiguous channelthe machine has several channels and the device named none
Load failedthe channel refused: busy, or no interpreter