ESC W command

Hey guys , i am still stuck i tried everything and still cannot find a solution to my problem , but step by step , my question is how to use this commnd :

ASCII GS k m n d1 ... dn
Hex 1D 6B m n d1 ... dn
Decimal 29 107 m n d1 ... dn

I am not clear how to use the d1 and dn in this line .

this is the link of the manual page 440 "GS K"
http://support.epostraders.co.uk/support-files/documents/36/w3m-ESCPOS_Guide.pdf

please someone help
THank you

I have not read the manual, but to me the "d1 .. dn" is a substitute for "data first .. data count", meaning the payload of the command.

EDIT: The manual says:

d indicates the character code of the bar code data to be printed.

Which would suggest that you need to convert some bar code data into a character code. the "1 .. n" still means that an array of characters representing the entire bar code is expected.

So i dont need to use it ? because when i try to print with the function and making everything there is no barcode printed just empy space , you know its like line feed

As I - as a non-expert in printers - understand the command, the "n" (after "m") in the command, defined how many bars are to be printet in the bar code. The "d1 .. dn" are the characters representing the bar code. Eg. if a bar code has 10 bars it would be something like:

GS k m 10 ABCDEFGHIJ

Where "ABCDEFGHIJ" are the characters defining the bar code. Wheter or not you need this feature is up to you, I would definitely try to get it working just for the fun of it :slight_smile:

I will try it too , yes please if you want try , and let me know as soon as you have something :smiley:

I'm not gonna try, do not have such printer either.. I just said that if it was me, then I would :slight_smile:

on page 448 of the same manual is a good example

basically an M between 0 -6 is the same m between 65 and 71. The document provides 2 methods to send a bar code

PRINT #1, CHR$(&H1D);"k";CHR$(2); ← Print bar code
PRINT #1, "496595707379";CHR$(0);

m = 2 (indicating UPC-E barcode)and as defined on page 441 : that means method 1: 12 characters followed by NULL termination

OR......

PRINT #1, CHR$(&H1D);"k";CHR$(67);CHR$(12);
PRINT #1, "496595707379"; ← Print bar code

m = 67 (indicating UPC-E barcode) and as defined on page 442 : that means method 2: n = 12 (indicating 12 characters) followed by the 12 characters.

I am sending it this way , mySerial.write("\x1d\x6b\x02\x13");
i think something is missing because its only feed line when i enter this command

because you are missing the 12 barcode characters + NULL, something like :

mySerial.write("\x1d\x6b\x02");
mySerial.write("123456789012");
mySerial.write("\x0");

Well still nothing :confused:

try this:
mySerial.write(0x1d);
mySerial.write(0x6b);
mySerial.write(2); // or maybe 0x2

mySerial.write("123456789012"); // BARCODE
mySerial.write(0x0);

Still nothing , it just prints the numbers , and there is no empty space . But one interesting thing is when i set the barcode height the empy space moves.

have you tried 0x2 as well ? and just to make sure the warning on page 449 : TM-H5000 :A bar code can be printed only when the paper roll is selected as the print sheet.

I tried 0x2 also , and selected paper roll too still nothing

what happens if you first set the height ?

mySerial.write(0x1d);
mySerial.write(0x68);
mySerial.write(80);

mySerial.write(0x1d);
mySerial.write(0x6b);
mySerial.write(2); // or maybe 0x2

mySerial.write("123456789012"); // BARCODE
mySerial.write(0x0);

mySerial.write(0x0a); // add newline ?

What model printer do you have? Some models don't have the built-in barcode generator. The document you pointed to seems to cover multiple models.

OMG paulvha THANK YOUUUU A LOT MAN THANKKK YOUU