Question

I'm getting involved with ZPL (a little bit) since a few days, so I'm sorry if the questions will look stupid. I've got to build a bar code 128 and I finally realized: I got to make it as shorter as possible. My main question is: is it possible to switch to subset C and then back to B for just 2 digits? I read the documentation and subset C will ready digits from 00 to 99, so in theory it should work, practically, will it be worth it? Basically when I translate a bar code with Zebra designer, and print it to a file, it doesn't bother to switch to subset C for just a couple of digits. This is the text I need to see in the bar code: AB1C234D567890123456

By the documentation I read, I would build something like this:

FD>:AB1C>523>64D>5567890123456

Instead Zebra Designer does:

FD>:AB1C234D>5567890123456

So the other question is, will the bar code be the same length? Actually, will mine be shorter? [I don't have a printer with me at the moment] Last question: Let's say I don't want to spend much time scripting this up, will the following work ok, or will it make the bar code larger?

AB1C>523>64D>556>578>590>512>534>556

So I can just build a very simple script which checks two chars per time, if they're both numbers, then add >5 to the string.

Thank you :)

No correct solution

OTHER TIPS

Ah, some nice loose terminology. Do you mean couple="exactly 2" or couple="a few"?

Changing from one subset to another takes one code element, so for exactly 2 digits, you'd need one element to change and one to represent the 2 digits in subset C. On the other hand, staying with your original subset would take 2 elements - so no, it's not worth the change.

Further, if you were to change to C for 2 digits and then back to your original, the change would actually be costly - C(12)B = 3 elements whereas 12 would only be 2.

If you repeat the exercise for 4 digits, then switching to C would generate C(12)(34) = 3 elements against 4 to stay with what you have; or C(12)(34)B = 4 elements if you switch and change back, or 4 elements if you stick - so no gain.

With 6 or more successive numerics, then you gain regardless of whether or not you switch back.

So overall,
2-digit terminal : No difference
2-digit other : code is longer
4-digit terminal : code is shorter
4-digit other : no difference
more than 4 digits : code is shorter.

And an ODD number of digits would need to be output in code A or B for the first digit and then the above table applies to the remainder.

This may not be the answer you're looking for, but specifying A (Automatic Mode) as the final parameter to the ^BC command will make the printer do this for you.

Example:

^XA
^FO100,100
^BY3
^BCN,100,N,N,A
^FD0123456789^FS
^XZ
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top