Encoding an EPC for the ZPL ZD500R Printer - ios

I am using the following page as a helper:
http://www.tharo.com/documents/tech582.htm
On that page the EPC is broken down into the bits that need to be passed to the printer in ZPL.
Based off that I have used the following ZPL and sent it to the printer:
^XA
^RB96,8,3,3,20,24,38^FS
^RFW,E^FD48,3,5,0614141,100041,1^FS
^XZ
Unfortunately I do not get the same EPC written to the tag as outlined in the document.
Update: I am using the Zebra iOS SDK to encode the tags. In their documentation the ZPL is all in one line.

I would look to the authoritative standards for this one. See the TDS Standard from GS1 (p92 and p132) for details on the format, and the ZPL programming manual for the printer.
To summarize, the data you are encoding is:
Header: SGTIN-968 bits, decimal 48
Filter: 33 bits, decimal 3
Partition: 24 bit company / 20 bit item3 bits, decimal 5
Company: 061414124 bits, decimal 0614141
Item: 10004120 bits, decimal 100041
Serial: 138 bits, decimal 1
So the ZPL should be:
^XA
^RB96,8,3,3,24,20,38
^RFW,E^FD48,3,5,0614141,100041,1^FS
^XZ
Note that there is no ^FS between ^RB and ^RF, and that partition 5 mandates 24,20. 20,24 would be partition 6. The ^RB is a comma separated list of the field widths, the ^FD is a comma separated list of the decimal field data. I will also note that filter 3 is "Reserved". I would imagine the filter you need to be 1.

Related

Setting charset on thermal printer via ESC/POS

I have a thermal printer "MPT-II" from an unknown Chinese brand, that has both USB and Bluetooth. I can successfully print text using:
Loyverse app on Android
JavaScript
Raw HEX or decimal
However, only using the Loyverse app am I able to input special characters, and by special characters I mean the Danish characters æøå/ÆØÅ.
If I open up any BLE tool on Windows (Bluetooth LE Lab for example), I can select the correct characteristic and send something like 104 101 108 108 111 13 10 which would print "hello" on the printer. I've read a bit about the ESC R and ESC t commands, but how exactly do I set those modes? I've tried prepending it to each command, such as 27 82 1 104 101 108 108 111 13 10 where the 27 82 1 corresponds to ESC R 4 and the 4 corresponds to Denmark I.
According to the printer's manual, it states the following:
GB18030 character set, ASCII characters, user defined characters, bar codes CODE39, EAN13, EAN8, CODABAR, CODE93, ITF, bitmaps.
According to that list, the Danish character set is not supported. I'm not sure how the Loyverse app is doing it correctly, but the text is the same using raw commands and Loyverse, so I don't think Loyverse is converting to a bitmap and sending that data.
So my real question is: How do I send the correct character set for my printer? Maybe the character set is already correct, but the ASCII character for æøå/ÆØÅ are wrong?
EDIT: I have confirmed that something works with the ESC XXXX commands. If I do 27 97 2 followed by my "hello" sequence, the text is printed to the right (right aligned). So that definitely works.. I have tried probably all character sets thus far using ESC R and ESC t but none of them work :(
EDIT 2: I have now tested every single combination of ESC R and ESC t. I went through the entire list printing some Chinese characters, and every single line of 150+ I tried all returned the same Chinese character. So ESC R or ESC t is definitely not the command I should be using to change the charset.

How can I convert a 4-byte string into an unicode emoji?

A webservice i use in my Delphi 10.3 returns a string to me consisting of these four bytes: F0 9F 99 82 . I expect a slightly smiling emoji. This site shows this byte sequence as the UTF-8 representation of that emoji. So I guess i have a UTF-8 representation in my string, but its an actual unicode string? How do i convert my string into the actual unicode representation, to show it, for example, in a TMemo?
The character 🙂 has the Unicode code point U+1F642. Displaying text is defined thru an encoding: how a set of bytes has to be interpreted:
in UTF-8 one character can consist of 8, 16, 24 or 32 bits (1 to 4 Bytes); this one is $F0 $9F $99 $82.
in UTF-16 one character can consist of 16 or 32 bits (2 or 4 bytes = 1 or 2 Words); this one is $D83D $DE42 (using surrogates).
in UTF-32 one character always consists of 32 bits (4 bytes = 1 Cardinal or DWord) and always equals to the code point, that is $1F642.
In Delphi, you can use:
TEncoding.UTF8.GetString() for UTF-8
(or TEncoding.Unicode.GetString() if you'd have UTF-16LE
and TEncoding.BigEndianUnicode.GetString() if you'd have UTF-16BE).
Keep in mind that 🙂 is just a character like each letter, symbol and whitespace of this text: it can be marked thru selection (i.e. Ctrl+A) and copied to the clipboard (i.e. Ctrl+C). No special care is needed.

Need Tips for RFID ZPL for Zebra ZD500R Printer

Working on printing and encoding RFID labels with the Zebra ZD500R Printer.
Here is my ZPL: The field data is F1001001, which i can encode and print on the label. However the EPC returned is F10010010000000000000000. How can i do one of 2 things. Either get the ZPL to 4 Bytes with no 0's or encode random hexadecimals at the front and my field data at the end?
My other question is how do make my field data increment and have both the RFID encoded tag and label match?
`^XA
^BCN,100,N,N
^FO30,50^FDF1001001^FS
^FO30,160^ADN,18,15^FDF1001001^FS
^FO30,220^ADN,10,20^^FD12/1/2024^FS
^FO30,260^ADN,10,20^^FDUYT 098^FS
^RFW,H^FDF1001001^FS
^RFR,H^FN11^FS
^FH^HV11,,EPC:[,]_0D_0A,L
^XZ`
I know I'm a bit late to the party but it might be useful if someone else stumbles over this post...
Try:
^RS8
^RFW,H,,,A^FD12345678^FS
When read with a RFID reader this will return the EPC code 12345678 without the trailing zeros (or encode random hexadecimals). For reference this was written to a tag using a Zebra ZQ511.
https://www.zebra.com/content/dam/zebra_new_ia/en-us/manuals/printers/common/programming/rfid3-pg-en.pdf
If you want to encode fixed EPC length, use the ^RF command with a length paramter :
Example 3: This example encodes 4 bytes of hexadecimal formatted data, starting in block 3
of Gen 2 EPC bank 1. (The ^RS command can be omitted for printers that use Gen 2 tag types
only.)
^XA
^RS8
^RFW,H,3,4,1^FD11112222^FS
^XZ
For incrementation, I suppose Zebra has a builtin variable management but I don't know how it works... But you are better calling the Zebra printer through an external program...

Where should my brackets be in relation to the text for Arabic languages?

Our application automatically modifies the layout of Arabic text when it is followed by a bracket and I was wondering whether this was the correct behaviour or not?
The application shows items in the following format:
[ID of structure](version)
So version 1.5 of the English structure "stackoverflow" would be displayed as:
stackoverflow(1.5)
Note: the brackets need to be displayed. There is no space between the ID and the first bracket. The brackets simply encompass the version. The brackets could have been any character but it's far too late to switch to a different character now!
This works fine for left to right languages, but for Arabic languages the structures appear in the form:
ستاكوفيرفلوو(1.0)
I am not an Arabic speaker and I need to know if this is actually correct. Is the Arabic format the equivalent of the English format or has something gone horribly wrong?
The text in Arabic should be shown like:
ستاكوفيرفلوو(1.0) ‏
I added the html entity of RLM / Right-to-left Mark ‏ in order to fix the text. You should do so if your application doesn't support Bidi native-ly. You can add the RLM by these ways:
HTML Entity (decimal) ‏
HTML Entity (hex) ‏
HTML Entity (named) ‏
How to type in Microsoft Windows Alt +200F
UTF-8 (hex) 0xE2 0x80 0x8F (e2808f)
UTF-8 (binary) 11100010:10000000:10001111
UTF-16 (hex) 0x200F (200f)
UTF-16 (decimal) 8,207
UTF-32 (hex) 0x0000200F (200f)
UTF-32 (decimal) 8,207
C/C++/Java source code "\u200F"
Python source code u"\u200F"
(note: StackOverflow right transliteration is ستاك-أوفرفلو)

COBOL accurate LENGTH OF (XML-TEXT) when ampersands escaped?

I'm using the intrinsic function XML-PARSE with XML that looks like this:
<MSGBODYTXT>
<LN>One & two</LN>
</MSGBODYTXT>
By my count, the following string is 13 bytes long.
"One & two"
But when I take $
LENGTH OF(XML-TEXT) $
I get only 9 bytes.
What can I do to get the correct, 13-byte length?
The problem is that XML PARSE translates & into the character it represents, an ampersand. If
you look at the CONTENT-CHARACTERS associated with the <LN> tag you will see: One & two which
is 9 characters long, just as the LENGTH OF operator on XML-TEXT says it is.
Note that if you were to use XML GENERATE on data item LN having the value One & two
it will generate as <LN>One & two</LN> which is a symetrical operation.

Resources