Jump to content

Datamatrix 2D Barcode


dmsawyer

Recommended Posts

I am new to Fusion Pro and have not successfully created a Data Matrix Barcode using Fusion Pro. I don't know JS.

Last week some of the codes did not read correctly, most did, during our mailing process. I need more information on how to create a rule for generating this code. I found in Building Blocks, Functions, MakedataMatrixBarcode, "MakeDataMatrixBarcode(DataToEncode, ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font));" but I am unsure what information needs to be inserted in the code.

I have watched the "Creating a 2D Barcode" section of the Advanced Features video tutorial but in that tutorial they do not create a Datamatrix 2D Barcode, they create a PDF417 barcode and I can not get the method to work for the Datamatrix code.

Any help with this issue would be greatly appreciated.

I am using FP Desktop 6.0.6.0

Windows XP

Acrobat 8.0 Professional

Link to comment
Share on other sites

All of the parameters to the MakeDataMatrixBarcode function (except, of course, the barcode data in the first parameter) are optional. So, in the simplest case, you can just write the rule like so (with the name of the data field you're using):

return MakeDataMatrixBarcode(Field("YourDataFieldName"));

You only need to specify the other parameters if you want to override the defaults. In that case, I would use the DataMatrixBarcode object instead so that you can explicitly set whatever property you want. So the simple case becomes:

var barcodeObj = new DataMatrixBarcode;
return barcodeObj.Make(Field("YourDataFieldName"));

And you can override whatever defaults to need to, like so:

var barcodeObj = new DataMatrixBarcode;
barcodeObj.pointSize = 4;
barcodeObj.encodingMode = "BASE256";
barcodeObj.preferredFormat = 7;
// etc.
return barcodeObj.Make(Field("YourDataFieldName"));

To see what all the options are, and their default values, look in the Building Blocks dialog, JS Language tab, Objects, DataMatrixBarcode.

 

You might want to take a look at this thread for some more examples.

 

As for how to get your barcode scanner to read the barcodes properly, not all scanners handle every variation of the Data Matrix barcode, so you may need to adjust either the scanner's settings or the properties of the DataMatrixBarcode object (or parameters of the MakeDataMatrixBarcode function). Please refer to this site for more information on the Data Matrix barcode specification and variations thereof:

http://www.idautomation.com/datamatrixfaq.html

Link to comment
Share on other sites

Thanks for the quick response Dan. I have used the code you sent and ran 100 samples for our mailing department and they matched 100%.

The mailing manager needs to know why the code did not read correctly for our last run so I am attaching the code used, spreadsheet and PDF of the letter. Please let me know if you can tell what went wrong because we need to pin point the error, if it is the code or the scanner.

We have the mailing equipment support team looking at the issue as we, they have taken two of the letters from this run and scanned them in at a different location, here is what they found "Verified the reading of the 2 documents with a handheld scanner this morning. The document 000428 reads correctly. The document that should be 000429 is printed as 0004 4. We will need to figure out why this document is being printed incorrectly. In the meantime we will need to be very careful running read/printegrity jobs as this compromises the integrity of the inserting machine." This is for record sequential number 428 and 429.

The copiers we use are Xerox Nuvera, 100EA Production System Ver. 73.93.43.8.

The mailing equipment is Bowe Bell & Howell using Printegrity and Progressive B & W camera STC - 1100.

Here is the code I used for the 2D data matrix.

// Check treat strings as tagged text

//Replace "data matrix" with name of Field with ""

//Apply Rule as a text field and apply IDAUTOMATIONDMATRIX Font in 4pt

return MakeDataMatrixBarcode (Field("Sequential"), true, "TEXT", "UIC", "4", "NoFontTag", "IDAutomationDMatrix");

Thanks,

Diane

157078E.pdf

Link to comment
Share on other sites

Thanks for the quick response Dan. I have used the code you sent and ran 100 samples for our mailing department and they matched 100%.

 

The mailing manager needs to know why the code did not read correctly for our last run so I am attaching the code used, spreadsheet and PDF of the letter. Please let me know if you can tell what went wrong because we need to pin point the error, if it is the code or the scanner.

 

We have the mailing equipment support team looking at the issue as we, they have taken two of the letters from this run and scanned them in at a different location, here is what they found "Verified the reading of the 2 documents with a handheld scanner this morning. The document 000428 reads correctly. The document that should be 000429 is printed as 0004 4. We will need to figure out why this document is being printed incorrectly. In the meantime we will need to be very careful running read/printegrity jobs as this compromises the integrity of the inserting machine." This is for record sequential number 428 and 429.

 

The copiers we use are Xerox Nuvera, 100EA Production System Ver. 73.93.43.8.

The mailing equipment is Bowe Bell & Howell using Printegrity and Progressive B & W camera STC - 1100.

I appreciate the information. However, it's not really within the scope of this forum for anyone to sort through a 2500-page output and investigate why a few of the barcodes aren't being handled correctly by your scanner. You may want to contact Support. Also, if you could isolate the problem by just pulling out the couple of pages with the problematic barcodes, that will make it easier to diagnose. In addition, you will need to supply the exact data being passed to the MakeDataMatrixBarcode function corresponding to each of the output barcodes.

 

That said, without sorting through the whole file, I can tell you a couple of things. First of all, the barcodes are really, really tiny, even at 100 percent magnification. I can easily imagine the scanner having trouble with those; I would suggest trying a point size larger size than four.

 

Also, the parameters to the MakeDataMatrixBarcode function in your code are not all correct:

Here is the code I used for the 2D data matrix.

// Check treat strings as tagged text

//Replace "data matrix" with name of Field with ""

//Apply Rule as a text field and apply IDAUTOMATIONDMATRIX Font in 4pt

 

return MakeDataMatrixBarcode (Field("Sequential"), true, "TEXT", "UIC", "4", "NoFontTag", "IDAutomationDMatrix");

Here is what the placeholders for the function parameters look like when inserted from the Building Blocks:

MakeDataMatrixBarcode(DataToEncode, ProcessTilde, EncodingMode, PreferredFormat, PointSize, NoFontTag, Font)

Again, all of the valid values and defaults for these parameters are listed in the Building Blocks dialog, under the JS Language tab, Objects node, DataMatrixBarcode. Let's go over them one at a time:

 

parameter: your value

------------------------

DataToEncode: Field("Sequential")

This seems to be fine, although you don't specify what the field data is.

ProcessTilde: true

This is okay, as long as the scanner is set to process tildes as well.

EncodingMode: "TEXT"

This is fine, again, as long as the scanner is set to expect this encoding.

PreferredFormat: "UIC"

This is wrong. The parameter should be an integer from 0 to 29, which specifies a format in this table:

http://www.idautomation.com/datamatrixfaq.html#DataMatrix_Formats

I don't know what "UIC" is supposed to mean here. You probably just want to leave this at 0 (zero, the default value) for "automatic."

PointSize: "4"

This is valid, although technically it should be a number (without quotes), not a string. And as I said, you might want something bigger than 4-point. The default is 10 (points); I would just try that.

NoFontTag: "NoFontTag"

This is wrong. It should be a Boolean value, either true or false (without any quotes). I would just omit this parameter and let it default to false so that the correct font tag is generated. The other advantage of this is that you don't need to put the variable for the rule in a non-readable font in the Text Editor.

Font: "IDAutomationDMatrix"

This is fine. It's the default value, so again, I would just omit this.

 

So, I would change the rule to this:

return MakeDataMatrixBarcode(Field("Sequential"), true, "TEXT");
// this is the same as:
//return MakeDataMatrixBarcode(Field("Sequential"), true, "TEXT", 0, 10, false, "IDAutomationDMatrix");

Or even just this:

return MakeDataMatrixBarcode(Field("Sequential"));
// this is the same as:
//return MakeDataMatrixBarcode(Field("Sequential"), false, "ASCII", 0, 10,  false, "IDAutomationDMatrix");

And I'll bet that your scanner is likely to handle the barcode with all the default options.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...