Skip to main content

Select from table

Writing this item looks up the written value in a table, and selects a print job from the matching row.

PropertyValue
Data typesSTRING, or a numeric type for numeric keys
AccessW, reads 0

The mapping names the table and the key column, and the mapping list shows them, so the PLC programmer knows which keys are valid. Each write:

  1. Takes the written value as text, applies the mapping's pattern, and adds the prefix and suffix, as for Select label.
  2. Looks up the result in the key column of the table.
  3. Takes the label to print from the row's label column, or uses the fixed label name in the mapping.
  4. Takes the number of copies from the row's copies column, if the mapping has one.
  5. Selects the job, or adds it to the printer's queue.

If the mapping has a printed column, the row's count of printed labels is increased as labels are printed. See Print job for the details.

As with Select label, every write selects a job, and reading returns 0.

A key that is not found returns exception 04, and the error is logged on the printer. So does a missing table, label or printer.

With several printers, the job is selected on each of them, as for Select label v6.1.

Example​

The item at 36–43 (STRING, 8 registers) in the example mapping list looks up keys in the column Article of this table:

ArticleLabelCopies
A100Carton1
A200Pallet2
RequestResult
Write 36–37 = 0x4132 0x3030 (A200)Queues 2 copies of the label Pallet.
Write 36–37 = 0x5839 0x3939 (X999)Exception 04, no such key.

See also Selecting a product from a table.