What is FNC1 when creating a GS1-128 barcode?

1,081 views
Skip to first unread message

Yujin

unread,
Feb 19, 2018, 8:32:28 PM2/19/18
to zxing
I am using Zxing in C# to make barcodes with GS1-128.
I know that there are two cases when FNC1 appears.
1. FNC1 appears before the first AI.
ex) {(char) 0x00F1} 0118806411123456
2. After AI, a fixed length data field or a variable length data field can be followed.
If a variable-length data field appears after AI and another AI appears, you must add FNC1 before another AI appears.
ex) {(char) 0x00F1} 0118806411123456{(char)0x00F1}210001

So I coded the following.


var writer = new BarcodeWriter
{
Format = BarcodeFormat.CODE_128,
Options = new ZXing.Common.EncodingOptions
{
PureBarcode = true,
Height = rh,
Width = 1,
Margin = 1
}
};
var barcode = writer.Write($"{(char)0x00F1}01188064111234561719010110A11{(char)0x00F1}210001");
Bitmap bitmap = new Bitmap(barcode);
e.Graphics.DrawImage(bitmap, rx, ry, rw, rh);


Information on FNC1 can be found at the URL below.
https://github.com/micjahn/ZXing.Net/wiki/Generating-GS1-DataMatrix-and-GS1-Code128-barcodes

Is everything all I said?

The problem is that the shape of the bar code is not the same when compared to other accurate GS1-128 bar codes.
I think it is because I have not used FNC1 correctly.
I want to get an accurate answer to FNC1.

zxingnet

unread,
Feb 23, 2018, 11:29:42 AM2/23/18
to zxing
I think there is nothing wrong. Code-128 can use three different encodation modes (128A, 128B and 128C). The character sequence '01' can be encoded as '10011101100 10011100110' (128A and 128B) or as '11001101100' (128C). It depends what the encoder supports and select.
The main question is, do you get the same result if you decode the generated barcode?
Message has been deleted

Yujin

unread,
Feb 26, 2018, 9:10:22 PM2/26/18
to zxing
Yes. The result of the decoding is the same.
the GS1-128 barcode created by Zxing was different from the other accurate GS1-128 barcode. Is it because of the different types of encodings?
So when you use zxing, do you have to decide which encoding to use codeA, codeB, or codeC?

zxingnet

unread,
Feb 27, 2018, 1:08:48 AM2/27/18
to zxing

Yes, I think so. The other barcode generator probably used a different encoding then zxing. But it doesn't matter. You don't have to decide for a specific encoding. zxing selects a proper one for you. It's only important that the decoded result is the same as the original content.

Yujin

unread,
Mar 6, 2018, 12:00:03 AM3/6/18
to zxing
Thanks to zxingnet for your reply.
Your answer helped me. I think I was confused. I created the GS1-128 barcode using the Zxing library.
Reply all
Reply to author
Forward
0 new messages