0

I use a barcode scanner to read medecine GS1 datamatrix codes. I need the entire data sequence, including Group Separators to parse the code in order to seek for Application identifiers (AI) and get the data accordingly. The target is a winforms C# application, it will call the NMVS services to check medecines status. Actually i put a TextBox as the target control but its content does not contain the GS anymore.

Thank you for your help

If I manually fill the textbox with 0x1D (ASCII 29) chars as separators, it works like a charm. The GS1 parser finds the AI and I can extract data. If I open Notepad++ with focus on it and scan a code, the special characters are present. I setup my scanner, NETUM C750 model, to map the function keys, so that the separators are included into the buffer.

3
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 19, 2023 at 8:20
  • Very often the scanner chooses how to present the data from GS1 (FNC1) structured codes. And it may be an option in the scanner. You should post a sample of a barcode and perhaps the exact type of scanner you use (brand and model ID). This will make it simpler to help you. Commented Oct 19, 2023 at 10:33
  • I tried with random codes found on the Internet, simply entering "gs1 datamatrix" as criterion. The scanner is a USB one, no driver needed. Commented Oct 19, 2023 at 15:37

2 Answers 2

0

I use barcode scanners to read GS1 data for incoming components. Ironically my better scanner (Netum NT-2128BL) drops the field separators while my worse one(Teradata 8100) passes them along. You might try another scanner. My separator is Unicode Character 'LEFT RIGHT ARROW' (U+2194). The separator is called a GS1 FNC1 character. GS1_datamatrix_sample

Sign up to request clarification or add additional context in comments.

Comments

-1

As Barcode scanner is considered a keyboard, I found out to catch the keypress event, so that I fill a char list.

List<char> charList = new List<char>();

private void textEditCode_KeyPress(object sender, KeyPressEventArgs e)
{
  charList.Add(e.KeyChar);
}
string datamatrix = new string(charList.ToArray()); //charList is filled      by pressing the keys, or when receiving data from the scanner
Aii = gS1.Parse(datamatrix); // Aii = new Dictionary<string, string>(); 

After that, I parse the char list as the GS1 content, and I can call the NMVS service :

string Batch = gS1.GetValue(EGS1AI.Batch);
string ProductCode = gS1.GetValue(EGS1AI.GTIN);
System.DateTime ExpDate = gS1.GetValue(EGS1AI.ExpirationDate);
string SerialNumber = gS1.GetValue(EGS1AI.SerialNumber);
string dat = ExpDate.ToString("yyMMdd");

Log log = new Log(App.LogFolder(), App.AppName);

G110Response response = G110.G110Verify(ProductCode, Batch, dat, 
SerialNumber, log);

then process response

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.