Discussions:
Explain in detail how the GW command functions
Facts:
EPL Command used to download graphics
Details
Here is a very simple test file to illustrate the use of the GW command. It draws a 16x16 dot box at coordinates 100,100.
hex
hex
ascii
address
byte
values
equivalent
=======
===========
==========
0 1 2 3 4 5 6
7 8 9 A B C D E
F 0123456789ABCDEF
00000000:
4E0D 0A47 5731 3030 2C31 3030 2C32 2C31
N..GW100,100,2,1
00000010:
362C 0000 7FFE 7FFE 7FFE 7FFE 7FFE 7FFE
6,..............
00000020:
7FFE 7FFE 7FFE 7FFE 7FFE 7FFE 7FFE 7FFE
................
00000030:
0000 500D 0A0D
0A
..P....
The GW command basically allows you to send a bitmapped graphic directly to the image buffer.
The EPL2 Programmer's Guide does have an error -- it should show either a comma or carriage return/line feed between p4 and DATA.
The correct syntax is
GWp1,p2,p3,p4,DATA
-or-
GWp1,p2,p3,p4[cr...]<lf>DATA
There is no need for a carriage return/line feed after the DATA, but it doesn't hurt either.
The p3 parameter is the width of the graphic in dots (which must be a multiple of 8) divided by 8 to convert it to bytes.
The graphic data consists of p3 * p4 binary bytes. Each byte has 8 bits, of course, and each bit represents one graphic dot. In the binary data, a 1 = white dot and 0 = black dot.
Each group of p3 bytes represents one "raster line" in the bitmap graphic, starting at the top and working down. The most significant bit in each byte represents the left most dot in that group of 8 dots.
Here is a conversion between the hexadecimal digits shown in the dump and their binary equivalents:
Hex Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
To represent the 16x16 square box, the data (shown in boldface in the dump above) is as follows.
bytes bits
00 00 0000000000000000
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
7F FE 0111111111111110
00 00 0000000000000000
Notice: Zebra
Technologies Corporation makes no representations about the suitability of this
documentation for any purpose. It is provided "as is", for your information only, without
warranty of any kind, either expressed or implied, including, but not limited
to, implied warranties of merchantability, fitness for a particular purpose and
non-infringement.
|