Zebra ZT410 ZPL User input - zebra-printers

I'm working with Zebra ZT410 and would like to create a template label in ZPL that would be stored on the printer to allow users to print directly from the printer through custom menu in WML.
I'm having no problems creating custom menu, sending it to the printer and calling for the said ZPL file, but the printer is not asking for keyboard input when it should.
Example ZPL code:
CT~~CD,~CC^~CT~
^XA
^PW437
^FT40,167^A0N,25,24^FH\^FN1"EXAMPLE2"^FS
^PQ1,0,1,Y^XZ
When printing from Print Station option on the printer, printer correctly asks for the value of EXAMPLE2, when calling ZPL from custom menu, it just defaults to nothing and prints as there was no input.
Does anyone ever worked with something similar?
Ideally I would need 3 inputs from the barcode scanner to generate a very simple label. Would like to do it with printer and scanner alone if possible.
Thanks in advance.

I have faced with a similar issue.
Zebra support suggested to read WML from printer and see/modify them to create my own Print Station.
PrintStation is in z:TOOLS.WML
You can read files (send to host) with this SGD command
{}{"file.type":"Z:TOOLS.WML"}

Related

ZPL Programming - reset settings on each print job

Zebra ZPL label printers carry over the print commands from print job to print job. So if you send a ^FWR command that rotates a label, all future jobs will be rotated, so you have to reset the orientation to ^FWN if you want to have the next label be printed in portrait mode.
Is there a way to automatically reset the 'standard' settings on a Zebra on each print job? So settings from the previous job don't carry over to the next job? I want every zpl file I send to the printer to be printed exactly the same, regardless of what was printed prior.
Or is there a default set of commands that I can send that reset the orientation, fonts, position, dpi, measurements, etc?
There's a command that does a power-on/factory reset, but I don't want to do that on every label print.
You can manually reset all unwanted settings.
This works for me
^PON^LH0,0^FWN
.
FWN resets field orientation
LH resets the offset
PO resets print orientation
Not sure if all of those are needed and/or others would be needed for you too. In my particular case, I did not need FWN.
My printing got messed up when pasting some sample ZPL to the printer. Next 30 labels had orientation and offset changed making them unusable. So I just have above command in beginning of my labels now.
You might specifically have to reset other settings too.
If you can send ZPL Before or After a label you want to print, add the commands you want, like ^PO outside of the begin ^XA/end ^XZ label. It should change it until another similar command is set.

Zebra ZT410 ZPL Clear buffer command

The "~JA" command, as stated in ZPL Programming Guide vol.2, cancels all commands in the buffer.
We were using the ~JA at the start of every PRN file and it worked as intended on ZM400 and ZE500 models. The goal is to have only one printout in case multiple prints are triggered. So if I press "Print" 3 times, only the third label prints out.
I have tried:
- introducing the ~JA command through Zebra Designer interface
- introducing the ~JA manually in the PRN at the start of the PRN file as ~JA~; ~~JA~; ~JA
No luck. On the ZT410 nothing prints out, the printer just hangs there with the data led blinking.
Any ideas?
This is the kind of question that wants a higher level control at a lower level. If you only want 1 label to be printed after a button or print dialog is initiated, it needs to be done at a higher level than ZPL II. Sending a ~JA command typically just flushes the command buffer on a printer less than it does eliminate the ZPL that is being sent before it. In your case, you should eliminate the user's ability to hit the print button 3 times. Effectively adding a de bounce function to your higher level program. It is good however to send a flush command before sending the ZPL you want to print, in case a cached command for a label is stuck in the buffer for the printer. There have been instances where an old label will print out because I have neglected to send this command at the header of my ZPL generator.

Web Interface to interact with Label Matrix

I am in the process of creating a system that can print labels. The designs have been created in Label Matrix, but I need the ZPL (Zebra Programming Language). Does anyone know if I can go from Label Matrix to ZPL?
Thank you very much
You can add a new ZebraDesigner ZPL driver to the system and use a file as the port. Then when you "Print" the document, it will write the ZPL code to the file.
Note that it might have some header information before the first ^XA which you might not need.
Also, how to add a local port for a driver:
Go to Printer Properties
Click on the Ports tab
Click Add Port
Select Local Port and click New port
Enter a filename e.g. C:\output.zpl
Make sure it is checked in the ports list
Now all printing output should go to C:\output.zpl
Alternatively, can just click Print, tick "Print to file" checkbox, output to a *.prn file, open that file with Notepad and the code is there.

zpl printer tear off issue

I am using zpl II script to print 3 x 2 labels. Its a ethernet printer.I am facing problem that after the print label not properly tear off. So the next print not properly printing.Is that any way in zpl script label is tear off properly adjest.
What is exactly your problem?
I can give you example of my zpl code:
^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^LRN^CI0^MMT^PW295^LL0236^LS0^FT29,177^A0N,17,19^FH\^FD_text_^FS^XZ
If I want to tear off: I set MMT. If I want to cut, I'm changing this parameter to MMC.

Barcode scanner reads input into text file, then selects all text and deletes it

I am trying to set up a (USB) Motorola Symbol DS6708 barcode scanner to scan QR code encoded with some contact information onto a text file.
When scanning in a barcode, the expected text is displayed on in the text file. When it is finished reading it in all the text is selected and deleted.
If it hit ctr+z, the text is undeleted and displayed in the file.
The desired result is in this format:
Name
Title
Company
Phone
ect
I'm not really sure where to start with debugging this. I am assuming that there is some characters being read in at the end that doing the equivalent of ctrl+a and delete.
EDIT
I tried scanning using the 123Scan2 from Motorolo, and this was the result:
<STX> <STX> <STX>318315647 <ETX> <LF>NAME<ETX> <ETX>LNAME<ETX> <LF>TITLE <ETX>
<LF>COMPANY <ETX>
<LF>ADDRESS <ETX> <LF>ADDRESS <ETX> <LF>CITY<ETX>, <ETX>ST<ETX> <ETX>12345<ETX> <LF>USA <ETX>
<LF>PHONE <ETX> <LF>PHONE <ETX>
<LF>EMAIL <ETX> <LF> <LF> <LF> <LF> <LF> <SUB> <CR>
EDIT
I attempted to set console application with C# and read in the input with Console.Read() or Console.ReadLine(), but the input actually caused the application to stop running, and then the input text was written into the text of the Program.cs file on Visual Studio.
The simple console app:
class Program
{
static void Main(string[] args)
{
System.Diagnostics.Debug.WriteLine("start");
int result;
while ((result = Console.Read()) != 0)
{
Console.WriteLine("{0} = {1}", result, (char)result);
}
}
}
I'm not really sure where to start with debugging this. I am assuming
that there is some characters being read in at the end that doing the
equivalent of ctrl+a and delete.
I attempted to set console application with C# and read in the input
with Console.Read() or Console.ReadLine(), but the input actually
caused the application to stop running, and then the input text was
written into the text of the class on Visual Studio.
I would bet that the data contain an EOF char (Ctrl+Z). All text devices (like console I/O) use this as an end signal, and it is still supported in modern OSes, although little known these days. And of course it is documented.
When it is finished reading it in all the text is selected and
deleted. If it hit ctr+z, the text is undeleted and displayed in the
file.
You probably want to say, that the text is shown in the editor, and selected/deleted from the editor. A file can't hardly display anything on it's own, it just contains something. By the way, the fact that EOF is Ctrl+Z and your editor's undo is also Ctrl+Z is pure coincidence.
As you don't show any code, it's hard to say anything about it. I'd probably do a Read() loop and store everything useful I get in a suitable place, for example in a file :-) This data are then to be processed in a second step.
PS: This related question may also be helpful.
I haven't played with barcode scanners for a while but this sounds to me that either the barcode you are scanning contains the control codes to do Ctrl-A and Del or that the scanner is programmed in that way.
To the host PC a barcode scanner basically appears like a keyboard. If you can type it, the barcode scanner can deliver it, including all Ctrl / Shift / Alt shortcuts.
If you have the scanner from new you should have a sheet of barcodes that allow you to program it up and affect its behavior. Have a look for a full reset barcode and see if that improves things.
You might want to try their sdk downloaded here. tell me if it still deletes the file in the textbox of the form.
If it isn't deleted, it might be better to add an export to a text file button.

Resources