You have the label data right and the barcode component still reports invalid data. On GS1-128 logistics and SSCC labels the cause is rarely the digits themselves: it is where a variable-length field sits. The FNC1 separator that must follow a field such as (37) in mid-symbol is exactly the character most report generators refuse to accept. This page gives the fixed and variable length of every application identifier a distribution label carries, a worked 29-character example with the arithmetic shown, and an ordering rule that removes the separator entirely, then checks the printed symbol with a code reader.
Why the encoder rejects the string
GS1-128 is Code 128 carrying a leading FNC1 plus GS1 application identifier (AI) syntax. Every AI belongs to one of two classes. A fixed-length AI declares its length, so the decoder counts characters and needs no separator after it: (01) always takes 14. A variable-length AI such as (37) has no declared end, so when more data follows in the same symbol an FNC1 must terminate it. When the variable-length AI is the last field, the end of the symbol does that job and nothing is encoded.
Encoders differ in how they accept a mid-string FNC1. Label packages built to GS1 take an escape sequence or a flag; some report components use a placeholder character such as ñ (byte 0xF1) and swap it for FNC1 at encode time. Many components accept such a placeholder after the first field but reject it further along the string, which is the invalid data message you are fighting. The standard allows the separator; the component input parser is what refuses it.
The corollary is the decision for every label you draw: order the fields so that no mid-string FNC1 is needed at all. Then any encoder that can print GS1-128 can print your label.
The same separator logic governs GS1 QR codes and DataMatrix codes; GS1 QR code FNC1 separators: encode and verify data covers that side of the family.
The AI lengths a logistics label uses
Fix the length class of every AI before you type anything. The counts below are data characters, excluding the two AI digits and including check digits where the field carries one.
| AI | Field | Class | Data characters |
|---|---|---|---|
| 00 | SSCC, serial shipping container code | fixed | 18 |
| 01 | GTIN | fixed | 14 |
| 02 | GTIN of contained trade items | fixed | 14 |
| 10 | Batch or lot number | variable | 1-20 |
| 11 | Production date | fixed | 6 (YYMMDD) |
| 15 | Best-before date | fixed | 6 (YYMMDD) |
| 17 | Expiration date | fixed | 6 (YYMMDD) |
| 21 | Serial number | variable | 1-20 |
| 3102 | Net weight, kg, 2 decimals | fixed | 6 |
| 37 | Count of trade items | variable | 1-8 |
Parentheses are a printing convention for the text under the symbol and never part of the data: (02) 12345677654321 encodes as the digits 02 followed by 14 characters.
Worked example: count, then reorder
Take a mixed-item label carrying GTIN of contained items (02) 12345677654321, count of items (37) 105 and best-before date (15) 250101.
Order A, the sequence as drawn on the old artwork, (02) then (37) then (15):
- (02): 2 + 14 = 16 characters
- (37): 2 + 3 = 5 characters
- (15): 2 + 6 = 8 characters
- total 16 + 5 + 8 = 29, plus one FNC1 after the count because (37) is mid-string: 30 symbol characters and one escape the encoder must swallow
Order B, reordered so the variable field is last, (02) then (15) then (37):
- 16 + 8 + 5 = 29 characters
- (37) is last, so the separator count is zero
- encode exactly this: 02123456776543211525010137105
Decision: print Order B. Same digits, same 29 characters, zero separators, so nothing is left for the component to reject. A pure SSCC label is simpler still: (00) plus 18 characters is 20 in total, fixed length, no separator anywhere, and (00) always goes first when the label carries it.
Decoders read AIs in whatever order they appear. (02) must travel with (37) in the same symbol, and a fixed-length date between the pair decodes without ambiguity because its length is declared. If a trading partner specification insists that (37) sit directly after (02), keep the pair adjacent and place the single FNC1 escape after the count, exactly as the component accepts it.
Encode it: six steps
- List and classify. Write down every AI on the label and mark it fixed or variable from the table above.
- Order the fields. (00) first when the label carries an SSCC, then the fixed-length fields, variable-length fields last, with (02) and (37) kept in the same symbol.
- Write bare data. Digits only, no parentheses, no spaces: 02123456776543211525010137105.
- Separators. With the variable fields last, add none. If a variable field must sit mid-string, insert exactly one escape at each such field end, in whatever form the encoder exposes: a flag, an escape sequence or a placeholder such as ñ.
- Size the symbol. Set the module width to the customer print-quality spec and place the scanner at the matching distance; the arithmetic lives in Code 128 barcode module size, reading angle and reader distance.
- Verify before release. Print one label, scan it, and check the transmitted string against the AI table before the format reaches production.
Verify the printed symbol
Scan a printed label and read the raw payload. With the fields ordered by the rule, the reader returns exactly the 29 characters you encoded and no separator byte.
A mid-string FNC1 is conformant decoder output: decoders transmit it as Group Separator, ASCII 29 (hex 0x1D), and some readers report the leading FNC1 as the symbology identifier ]C1 or drop it quietly. Filter control bytes below ASCII 32 in your parser and split on 0x1D when a label does carry separators; Split barcode string data into fields: parse lot and part numbers shows the splitting logic, and ASCII barcode data framing in the PLC receive buffer: nulls and races covers what control bytes do to a receive buffer.
Alphanumeric fields such as (21) also move Code 128 out of its numeric codeset, and a long serial can exhaust the symbol capacity before it exhausts the label; Code 128 codeset B length limits: why long labels fail to read gives that arithmetic.
For an in-line check at every cycle, a fixed code reader watches the print or applicator station; the fixed code readers page filters them by resolution, interface and series. The MV-ID3013PM-12M-WBN pairs a 12 mm focal length with a 1.3 MP sensor over Fast Ethernet, a compact fit above an applicator.
- Interface
- Fast Ethernet
- Resolution
- Up to 3 MP
- Shutter
- Global
- Lens mount
- M12
Where labels arrive one after another and every cycle must be checked, the LS-CRD-0028 decodes 60 codes/s at 30 fps.
- Interface
- Fast Ethernet
- Resolution
- 5 MP
- Sensor format
- 1/1.7"
- Shutter
- Global
When you cannot reorder
Some strings cannot be reordered: the customer label specification fixes the sequence, or two variable fields such as (37) and (21) both sit mid-string. Encode one FNC1 escape at the end of each variable-length field that is followed by more data, and none after the final field. The symbol is fully standard-conformant and passes any compliant verifier; the limitation was the component parser, not your data.
Expect one Group Separator (ASCII 29, hex 0x1D) per separator in the transmitted string and strip it as described above. Never add an FNC1 after the last field: the symbol stop pattern already ends the data, and encoders reject a trailing separator as invalid data, the same message that started this.
Decision: even under a mandated sequence, end the symbol on a variable-length field so the final escape disappears, and keep the remaining escapes only where the sequence truly requires them.
Choose the reader for the check
A print bench checks labels by hand. The handheld code readers page lists wired and wireless units, and the LS-HCR-0001 pairs a 1.0 MP sensor with USB 2.0 for bench scanning.
- Resolution
- Up to 3 MP
- Shutter
- Global
- Interface
- USB
- Connection
- Wired
To match a reader to the label, the code reader finder filters by resolution, interface and series, and the code-reading topic page collects the decoding fixes that pair with this one.
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Questions
Do I ever need to encode FNC1 on an SSCC label?
Not on a pure SSCC label. AI (00) is one fixed-length field of 18 characters, so the symbol needs no separator anywhere: encode the two AI digits plus the 18 characters and stop. FNC1 matters only when a variable-length field such as (37), (21) or (10) is followed by more data in the same symbol, which is the case the fixed-first, variable-last ordering removes.
Why does my scanner send a strange character between GS1 fields?
A mid-string FNC1 transmits as Group Separator, ASCII 29 (hex 0x1D), a non-printing control byte. It is conformant decoder output, not a read error. Strip it in your parser, or configure the reader post-processing to drop control bytes before the string reaches the PLC; reordering the fields removes it at the source.
Can I type the parentheses into the barcode data?
No. Parentheses are a printing convention for the human-readable text under the symbol; encoders reject them or count them as data characters. Counting them also breaks the fixed-length arithmetic: a 14-character GTIN becomes 16 and field validation fails. Encode 02123456776543211525010137105 and print (02) 12345677654321 in the text line only.
Which AIs on a logistics label are variable length?
The common ones are (10) batch or lot and (21) serial number, each 1 to 20 characters, and (37) count of trade items, 1 to 8 digits. Everything else on a distribution label is fixed: (00) at 18, (01) and (02) at 14, the dates (11), (15) and (17) at 6, and the measurement family such as (3102) at 6. Fixed fields never need a separator.
Does AI order matter to the barcode reader?
No. A GS1-128 reader decodes application identifiers in whatever order they appear and reports one payload string; the AI table, not the sequence, tells it where each field ends. Order matters at encode time, because it decides where FNC1 is required, and contractually, because some trading partners prescribe the field sequence in their label specifications.


