Issue / Question
How to use the ~DY command to store files on a printer
Issue Details
ZPL, store files, ~DY command, DOS, USB share, .nrd files, HTTPS_CERT, HTTPS_KEY.NRD, certificates, NRD files, COPY command
Applicable To
ZT400 Series, ZT500 Series, QLn Series, ZT200 Series, ZD Series, ZT600 Series, ZQ500 Series
Resolution / Answer
The ZPL ~DY command allows one to store files onto a printer. Certificates are one type of files that can be stored on a printer.
One method that illustrates the usage of the ~DY command with a .NRD file is illustrated below:
1. The ~DY command requires one to know the file size of the file that is to be downloaded and saved on the printer,
A method to determine the file size of the file is to use DOS DIRECTORY command (DIR) as illustrated below:
2. Create a txt file with the ~DY command and the following data.
~DYE:HTTPS_CERT,A,NRD,1489,,A
~DYE: - instructs the printer to store the file in E: memory
~DYE:HTTPS_CERT - the name of the file (without the extension) to be stored on the printer
~DYE:HTTPS_CERT,A - the A signifies that the file we be uncompressed (ZB64,ASCII)
~DYE:HTTPS_CERT,A,NRD - The "NRD" shows that the file extension on the printer will be ".NRD" in this example
~DYE:HTTPS_CERT,A,NRD,1489,, - 1489 is the size of the file to be stored as illustrated above.
~DYE:HTTPS_CERT,A,NRD,1489,,A, - the 'A' is used with ASCII, hexadecimal or ZB64
EXAMPLE TEXT FILE SHOWN BELOW: (Note in this example the file created was called "HEADER.TXT"
3. When this file is then placed into the same folder as the file to be stored, one can use a DOS copy command to send the data to the printer to be stored.
COPY HEADER.TXT + HTTPS_CERT.NRD COM1
Sending data to the serial port .
Below is the illustration if one wishes to utilize a USB port with the copy command using a 'share'
in this example the full computer name being used is 80W7-WIN7WIN8. The computer name is used when sending data to a USB share.
I can create a 'share' on the USB printer via the windows printer driver properties as shown below:
Using the same computer name illustrated above I can send the data to the printers USB port
as shown below:
COPY HEADER.TXT + HTTPS_CERT.NRD \\80W7-WIN7WIN8\MYQLN