Select from table
Writing this item looks up the written value in a table, and selects a print job from the matching row.
| Property | Value |
|---|---|
| Data types | STRING, or a numeric type for numeric keys |
| Access | W, 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:
- Takes the written value as text, applies the mapping's pattern, and adds the prefix and suffix, as for Select label.
- Looks up the result in the key column of the table.
- Takes the label to print from the row's label column, or uses the fixed label name in the mapping.
- Takes the number of copies from the row's copies column, if the mapping has one.
- 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:
| Article | Label | Copies |
|---|---|---|
| A100 | Carton | 1 |
| A200 | Pallet | 2 |
| Request | Result |
|---|---|
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.