{"id":308,"date":"2021-08-09T16:53:35","date_gmt":"2021-08-09T15:53:35","guid":{"rendered":"https:\/\/blog.inplico.uk\/?p=308"},"modified":"2022-01-07T13:04:25","modified_gmt":"2022-01-07T13:04:25","slug":"designing-new-lables","status":"publish","type":"post","link":"https:\/\/blog.inplico.uk\/?p=308","title":{"rendered":"Designing new lables"},"content":{"rendered":"<p>Ok, this post is far from definitive, but for the labels we use it is good enough.<\/p>\n<p>We use the Zebra ZLn320 to print our barcode labels and it really is an excellent little device, but getting it to do exactly what you want can be a little tedious.<\/p>\n<p>Firstly use zebradesign 2.5 if you can because version 3 does not seem to want to upload templates.\u00a0 I didn&#8217;t go ott with trying because for our purposes there is no advantage of 3 over 2.5 and there are enough hassles with this without inventing new ones for shits and giggles.<\/p>\n<p>I have designed the label in designer with a logo using a png image, a fixed field and a label one variable field for a serial number and left a blank space for the QR code. It looks a bit like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-310\" src=\"https:\/\/blog.inplico.uk\/wp-content\/uploads\/2021\/08\/zebra-label-300x145.png\" alt=\"\" width=\"300\" height=\"145\" srcset=\"https:\/\/blog.inplico.uk\/wp-content\/uploads\/2021\/08\/zebra-label-300x145.png 300w, https:\/\/blog.inplico.uk\/wp-content\/uploads\/2021\/08\/zebra-label-1024x495.png 1024w, https:\/\/blog.inplico.uk\/wp-content\/uploads\/2021\/08\/zebra-label-768x371.png 768w, https:\/\/blog.inplico.uk\/wp-content\/uploads\/2021\/08\/zebra-label-1536x743.png 1536w, https:\/\/blog.inplico.uk\/wp-content\/uploads\/2021\/08\/zebra-label-2048x990.png 2048w, https:\/\/blog.inplico.uk\/wp-content\/uploads\/2021\/08\/zebra-label-150x73.png 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>I am not going to go into the details of designing it because they are pretty self explanatory albeit for some reason it does not seem to print in the position you would expect no matter how you set it up.\u00a0 There is a test print functionality built in to designer so you can move it around until you are happy with it.<\/p>\n<p>NOTE: You will need to have the driver for the printer set up in order to do this, again this is not difficult.<\/p>\n<p>Zebra uses a language called ZPL which I assume means Zebra Programming Language (or possibly printer language; I neither know nor care) that is akin to assembly.<\/p>\n<p>Once you are happy with your label then you can save it and upload it to the printer as a template; Save it with a short easy name (8 characters no spaces) as this saves it being truncated when you upload it. Once saved, for the ZLn320, from designer select:<\/p>\n<p style=\"padding-left: 40px;\">[File]] &#8212;&gt; [export to printer] &#8212;&gt; [Internal Flash]<\/p>\n<p>This will upload it to the printer without any fanfare, in fact there is no interaction at all, you will have to check to see if it has made it.<\/p>\n<p>Once you are done then you need to open the Zebra Setup Utilities and select &#8220;Open Communication with Printer&#8221;; this will bring up a dialogue where you can send commands directly to the printer.\u00a0 Here the first thing you want to do is list the files in order to ensure that your file has uploaded.\u00a0 To do so issue the command<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">! U1 do \"file.dir\" \"E:\"<\/pre>\n<p>and hit [send to printer],\u00a0\u00a0 you should be presented with something like&#8221;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\"\r\n- DIR E:*.* \r\n* E:ICLAB.ZPL      1175          \r\n* E:JTEKZPL.ZPL      1410          \r\n* E:TT0003M_.TTF    169188          \r\n\r\n-  66936320 bytes free E: ONBOARD FLASH \r\n\"<\/pre>\n<p>In my case I can see that my file which I named <strong>ICLAB<\/strong> is stored in the memory of the printer.\u00a0 The next thing we want to do is get the <strong>field number<\/strong> of the variable field.\u00a0 Much of the documentation online is vague on this and several suggest printing to a file and then editing and uploading that file manually however this is not strictly necessary as we can determine the field number by querying the uploaded file which will now have field numbers automatically assigned to any variable fields.<\/p>\n<p>To do this issue the command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">^XA^HFE:ICLAB.ZPL^XZ\r\n<\/pre>\n<p>Change &#8220;ICLAB&#8221; for the name of the file; This will thing bring up something like:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">^LRN^CI0^MMP^PW591^LL0278^LS0^FO256,0^GF&lt;NUL&gt;A,05632,05632,00044,:Z64:eJzt10tu5CAQAFAQI7HkApG4SXOxyHg3yxxhrkJWOUaIcgGWLBjXVAHGTn\/S1YtRNi61HLf05JShoAshjjjiiCOO+MFwkNgWYOFSDQAz01oQOjKtK0LyEtYJ8KGFZT0AXk8s2wbBMm3Gq5l5lt5LB56NeFVRmOhmG\/wibKCPj8JFgV91faFu6ZE4aGgDWgjVKkyNLISdNfVO5mFTtQaKcAlt2lnZaqHaSDZXa1ebd1a1aXgmmzbr0Pp83U7dTro0G5+q1Vlv869z\/XMii4+cVLN+\/iXw9bzaW9Nu3Wpls\/R\/KQ25s7KvCUu2kF2GLWfWrHZG+7xZHB15bm23huw0cnglm5ea71hhw4Zu1bCKrL5l3Riz10J2avM2Vq5vVnfrYbPJo40725+rI1r7Z60Hsjo5tPMNa8jGNV+0c62z6\/Z9rUmyVNCUw8VcVKvfR62TxS3Gm3TLQpjE3oYvtaP2Vm0WulW3rNws1pnFpehlubTq3IanC6uvWMDycaU4LBGyY10Mm9CKzeJ6c7NOXi73relWnFsF3fphNRRfKwI2W2vdw9SsGxbnE23G6vn9xUoA\/8bYrckqtHVXY1gDmW0t1iHPQnQQDddiApJjadKhWry7FcOmurWzbKHhxQ2cY+fHreNZRdYyrPlfNjxuHWeOVxv41t+nD1ndLafr0vFhKznNkXrcqsyxdXuImmNlt5zGD5sXankMq0ls1kaOLdW6j5ln8TfNvQWGnagHD\/6Fk8SJ9ogIrIQd7VMfC6fWaSFr+Fx8YNi2OP+yunvqZnfr79vAgsCBAFbDTkcA05rr+0GdDXC2alEnw3APObaeRnhhgmSfs7DUa8vOCsc\/ko224Igjfj7+ATE2ey4=:01E1^FT295,223^A0N,23,24^FB262,1,0^FH\\^FDScan the barcode to report^FS\r\n^FT295,251^A0N,23,24^FB262,1,0^FH\\^FDa fault with this equipment^FS\r\n^FT315,158^A0N,25,24^FB220,1,0^FH\\^FN11\"Serial\"^FS\r\n^XZ<\/pre>\n<p>You will note towards the bottom a field with the name &#8220;Serial&#8221; which is the name I gave it with designer.\u00a0 Prepending &#8220;Serial&#8221; we have &#8220;^FN11&#8221; which is the field number assigned to the &#8220;Serial&#8221; field.\u00a0 Now we have that we can make use of the template when printing our labels.<\/p>\n<p>Moving on to our use of the template we can test it by sending something like<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">^XA\r\n^XFE:ICLAB.ZPL\r\n^FO20,20\r\n^BQ,2,7\r\n^FD,,https:\/\/inplicare.inplico.uk\/index.cgi?serial=A5VM021000200&amp;mid=5^FS\r\n^FN11^FDA5VM021000200^FS\r\n^XZ<\/pre>\n<p>So the first command ^XA is start, Second ^XF commend tells the printer to use a stored template, the &#8220;E&#8221; tells it that this template is stored on drive &#8220;E:&#8221; the rest is the name of the template.<\/p>\n<p>Next we deal with our QR code:<\/p>\n<p>^FO sets the origin (x, y)<\/p>\n<p>^BQ tells us the printer we want a QR Code the comma afterwards is because we leave the first argument unset.\u00a0 The 2 is the second parameter that tells us that we want to use an enhanced barcode (this is the default and therefore does not really need to be set either.\u00a0 The third argument is the magnification factor which we have chosen 7 but can be any value between 1 and 10.\u00a0 There are several other options not mentioned here as this is a very quick overview.<\/p>\n<p>^FD stands for field data and ^FS stands for field separator.\u00a0 In our example you will note 2 commas after the ^FD command, this is because when using barcodes we could set additional formatting so if we wanted to print a high quality alphanumeric barcode then we could say:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">^FDQA,https:\/\/inplicare.inplico.uk\/index.cgi?serial=A5VM021000200&amp;mid=5^FS<\/pre>\n<p>The next bit &#8220;^FN11&#8221; tells the printer to move to field number 11 on the printer then ^FD is for the data to print in the field followed by ^FS (Field separator)<\/p>\n<p>Finally we finish with ^XZ which tells the printer we are done and it can print the label.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>FEEDING ON POWER UP<\/strong><\/span><\/p>\n<p>For some reason my printer ended up feeding a label on startup.\u00a0 To prevent this you need to use the ^MF command.\u00a0 Sending commands is very similar to sending print data you start with ^XA and finish with ^XZ<\/p>\n<p>The ^MF command has two options; feed at power up and feed after closing printhead (see the programming manual for the options). I want mine to feed after closing the print head but not on power up so I choose N and C.<\/p>\n<p>Once we have set the value we need to save it, and that is done with the ^JU command to update the configuration and S to save.<\/p>\n<p>So the whole thing is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">^XA^MFN,C^JUS^XZ<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ok, this post is far from definitive, but for the labels we use it is good enough. We use the Zebra ZLn320 to print our barcode labels and it really is an excellent little device, but getting it to do exactly what you want can be a little tedious. Firstly use zebradesign 2.5 if you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-zebra"],"_links":{"self":[{"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=308"}],"version-history":[{"count":5,"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=\/wp\/v2\/posts\/308\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.inplico.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}