Last 3 characters in EDIFACT encoding are ASCII encoded

Questions, comments and suggestions concerning VintaSoft Barcode .NET SDK.

Moderator: Alex

Post Reply
Document Partner
Posts: 13
Joined: Wed Sep 07, 2011 11:16 am

Last 3 characters in EDIFACT encoding are ASCII encoded

Post by Document Partner » Mon Feb 20, 2012 2:03 pm

Hi,

When trying to encode data into DataMatrix we came across the following issue:
When using the EDIFACT encoding the last 3 characters
(tested with the advanced barcode reader) are encoded as ASCII.

This can be reproduced using the following code snippet to generate a barcode

Code: Select all

      var barcodeWriter = new Vintasoft.Barcode.BarcodeWriter ();
      barcodeWriter.Settings.Barcode = Vintasoft.Barcode.BarcodeType.DataMatrix;
      barcodeWriter.Settings.ProcessSpecialSymbols = false;
      barcodeWriter.Settings.BarsWidthAdjustment = 1.0;
      barcodeWriter.Settings.BarsRatio = 1.0;
      barcodeWriter.Settings.ValueVisible = false;
      barcodeWriter.Settings.Padding = 1;
      barcodeWriter.Settings.PrintableValue = null;
      barcodeWriter.Settings.ValueGap = 0;
      barcodeWriter.Settings.DataMatrixEncodingMode = DataMatrixEncodingMode.EDIFACT;
      barcodeWriter.Settings.MinWidth = 2;
      barcodeWriter.Settings.Resolution = 60.0;

      barcodeWriter.Settings.Value = dataInput;
      var outputImage = barcodeWriter.GetBarcodeAsBitmap ();

whereas dataInput was tested with one of the following data inputs
  • 110;P;73300000000022'
    110;P;PM;LIFE;YAPP;YNEW;73300000000022'
    110;P;PM;LIFE;YAPP;YNEW;73300000000022;2300000123'
When saving the resulting image to disc and loading in the advanced barcode reader software you can see 3 decoded value items.

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	EDIFACT	110;P;PM;LIFE;YAPP;YNEW;73300000000022;2300000	31 31 30 3B 50 3B 50 4D 3B 4C 49 46 45 3B 59 41 50 50 3B 59 4E 45 57 3B 37 33 33 30 30 30 30 30 30 30 30 30 32 32 3B 32 33 30 30 30 30 30 
2	ASCII	123	31 32 33 
The last value item is in my opinion an unexpected output, since I defined EDIFACT encoding in the code snippet above.
Is there a specific reason for the last 3 characters to be encoded in ASCII, or is this an issue in either the writing or the reading component of the SDK?

Is there a possibility to show the control characters or the codewords of the barcode using the advanced barcode reader?
We would expect the option "Show Non-data Flags" in the "Reader results" tab of the advanced barcode reader to do this,
but this option does not seem to have any effect.
This would be quite usefull, since we are now evaluating which encoding scheme to use for the input data we are expecting of our customers.

kind regards,
Roman

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Last 3 characters in EDIFACT encoding are ASCII encoded

Post by Alex » Mon Feb 20, 2012 3:43 pm

Hello Roman,

EDIFACT encoding packs 4 symbols into 3 codewords.

Length of your data must be multiple 4 if you want to have one value item coded with EDIFACT.

Best regards, Alexander

Document Partner
Posts: 13
Joined: Wed Sep 07, 2011 11:16 am

Re: Last 3 characters in EDIFACT encoding are ASCII encoded

Post by Document Partner » Mon Feb 20, 2012 6:19 pm

Hello Alexander,

I also tested this with the following inputs:
"1" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	ASCII	1	31 
"12" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	ASCII	12	31 32 
"123" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	ASCII	123	31 32 33 
"1234" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	EDIFACT	1	31 
2	ASCII	234	32 33 34 
"12345" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	EDIFACT	12	31 32 
2	ASCII	345	33 34 35 
"123456" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	EDIFACT	123	31 32 33 
2	ASCII	456	34 35 36 
"1234567" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	EDIFACT	1234	31 32 33 34 
2	ASCII	567	35 36 37 
"12345678" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	EDIFACT	12345	31 32 33 34 35 
2	ASCII	678	36 37 38 
"123456789" =>

Code: Select all

№	Type	Value	HEX
0	C40	*DEMO*	2A 44 45 4D 4F 2A 
1	EDIFACT	123456	31 32 33 34 35 36 
2	ASCII	789	37 38 39 
So as you can see, there are always 3 ascii characters as the last 3 characters (if the input is longer than 3 characters)
So either there is something wrong in the packing of the EDIFACT symbols or I'm overlooking something here.

Also is there a possibility to show the control characters or the codewords of the barcode using the advanced barcode reader as I asked in my original post?

kind regards,
Roman

Document Partner
Posts: 13
Joined: Wed Sep 07, 2011 11:16 am

Re: Last 3 characters in EDIFACT encoding are ASCII encoded

Post by Document Partner » Thu Feb 23, 2012 12:02 pm

hi,

can you please post, if you can reproduce the behaviour?
we need to know, if this is an issue or expected behaviour of the SDK,
since we have to decide for an encoding in our application.

kind regards,
Roman

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Last 3 characters in EDIFACT encoding are ASCII encoded

Post by Alex » Mon Feb 27, 2012 10:59 am

Hello Roman,

In version 6.1.0.3 we have optimized encoding algorithm of DataMatrix barcodes in Edifact mode and know you will have the following results:
  • "1" => ASCII("1")
  • "12" => ASCII("12")
  • "123" => EDIFACT("123")
  • "1234" => EDIFACT("1234")
  • "12345" => EDIFACT("1234") + ASCII("5")
  • "123456" => EDIFACT("1234") + ASCII("56")
  • "1234567" => EDIFACT("1234567")
  • "12345678" => EDIFACT("12345678")
  • "123456789" => EDIFACT("12345678") + ASCII("9")
  • "1234567890" => EDIFACT("12345678") + ASCII("90")
Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest