Salesforce

ZPL Coding for Real Time Clock Printing

« Go Back

Information

 
Issue / QuestionHow do I set up and use the Real-Time Clock option for printing?
Applicable ToZebra ZPL compatible printers with the RTC Standard or Real-Time Clock option.
Resolution / Answer

The real-time clock allows a user to automatically print the time and date on labels. There are 2 ways to set dates and times for a real-time clock.

NOTE Ensure you download the latest firmware of the printer before setting the real-time clock.
 
  • Using ZPL Commands

You may use the ^ST (Set Time) ZPL command. Refer to ZPL Commands: ^ST Set Time and Date for more information. 

^STMonth,Day,Year,Hour,Minute,Second,Format

Month = value from 01 to 12 as Month.
Day = value from 01 to 31 as Day.
Year = value from 1998 to 2097 as Year.
Hour = value from 00 to 23 as Hour in 24-hour format.
Minute = value from 00 to 59 as Minute.
Second = value from 00 to 59 as Second.
Format = A = am or P = pm or M = 24-hour military format.
 

For example, if you want to set 28th of August 2016 01:15 pm, then the command you send should be:

^XA
^ST08,28,2016,01,15,0,P^FS
^XZ

You may use the Zebra Setup Utilities under Open Communication with Printer and put the following command.

 User-added image

Print the configuration label and you will notice the time has been set.

 

  • Using SGD Commands

Another alternative is to use the SGD (SetGetDo) command. Keep in mind that the SGD command on real-time clock time is only in 24-hour format and thus you have to convert, (i.e. 13:00:00 would be 1 pm.).

! U1 setvar "rtc.date" "08-28-2016"

! U1 setvar "rtc.time" "13:15:00"

You can do the following command to see if the value of the printer was set:

! U1 getvar "rtc.date"

! U1 getvar "rtc.time"

User-added image
 

 

Helpful Information

URL NameZPL-coding-for-Real-Time-Clock-Printing
TitleZPL Coding for Real Time Clock Printing

Powered by