Barcode printing on Datamax

K

kategor

Hi everyone,

I'm trying to print barcodes on Datamax printers (thermal barcode
printers), and I send an outputStream of byte[], but the printers does
nothing.

The printer is a Datamax Allegro 2, and the code I send is (for example):
<code>
byte[] linea_01 = {0x02,'A'};
outputStream.write(linea_01);
</code>

That is supposed to be an Immediate Command (the hex 0x02 is the
attention getter) and 'A' code is 'Send ASCII status string'.

I've a printer in com1, another in com2, and another in lpt1.(I've
trying in linux (/dev/ttyS0, S1 and /dev/lp0) and WinXP and it doesn't
works at all). I'm sure all ports work fine because I can read a
barcode-reader.

Well, if anyones knows anything about this, i could explain a bit more.

Thanks a lot.
 
M

Mladen Adamovic

How do you open outputStream for writing on com2, com1, lpt1? Using
/dev/ttyS1.
I'm not sure of its properties.

You might try to use javax.comm api, available at java.sun.com (I'm not sure
about unix platform, it is system dependent API).

If you can do it in C++ then you might try to use its library in Java see
JNI help.

And I must admit that you post your problem very nice, I like it <code>
</code> sentences.
 
K

kategor

Thanks, but now it works fine.

It was the wire, a standar serial wire does not work, it has to be a
crossed-serial wire (don't know why).

All I was doing in my code was alright.

See you.

Mladen said:
How do you open outputStream for writing on com2, com1, lpt1? Using
/dev/ttyS1.
I'm not sure of its properties.

You might try to use javax.comm api, available at java.sun.com (I'm not sure
about unix platform, it is system dependent API).

If you can do it in C++ then you might try to use its library in Java see
JNI help.

And I must admit that you post your problem very nice, I like it <code>
</code> sentences.

kategor said:
The printer is a Datamax Allegro 2, and the code I send is (for example):
<code>
byte[] linea_01 = {0x02,'A'};
outputStream.write(linea_01);
</code>

That is supposed to be an Immediate Command (the hex 0x02 is the
attention getter) and 'A' code is 'Send ASCII status string'.

I've a printer in com1, another in com2, and another in lpt1.(I've
trying in linux (/dev/ttyS0, S1 and /dev/lp0) and WinXP and it doesn't
works at all). I'm sure all ports work fine because I can read a
barcode-reader.

Well, if anyones knows anything about this, i could explain a bit more.

Thanks a lot.
 
P

Pete Thane

I think you are sending the wrong DPL (Datamax Programming Language)
command. The <STX>A command is used to set the time and date of the
printer when sent with other parameters.

The <SOH>A is the "Send Ascii String Status" command.

If you are having problems checking communication with the printer,
check all the DIP switch settings are set to off on the back (so it is
then using the default baud rate settings etc of 96-n-8-1). Then if
your host systems parameters match this, try sending an <STX>F which
should cause the printer to form feed. It maybe better to turn the
printer off and on again first before you try this or if you have had
to change any of the dip switch settings.
 
Joined
Mar 5, 2010
Messages
1
Reaction score
0
Hi.

I am new to DPL.
How do you load and send commands to the printer?
Do you write scripts? What do you use to write the commands?
Do you use VS/Java, or does it have its own programming platform?

Thanks
Tshepiso
 
Joined
Apr 21, 2014
Messages
1
Reaction score
0
I have similar problem,
Trying to print some text to thermal printer, just the green light blinks nothing prints
code :
Socket socket = new Socket("10.1.1.17", 9100);
DataOutputStream outToServer = new DataOutputStream(socket.getOutputStream());
String STX = new Character((char)2).toString();
String CR = new Character((char)0x0d).toString();

outToServer.writeBytes(STX + "KI test" + CR);

socket.close();

Please help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top