I just have SA Series printer(SA408). We are having trouble in connecting printer via RS232 to arduino. Can you please help us? Can anyone share basic connection for this printer via RS232?
Please post a link to the datasheet of the printer.
Which means at least you have tried something, so it would help the forum to know what you tried already and what happened (or didn't).
RS-232 is pretty straightforward… operation manual HERE
The main problem you will have is not the actual RS232 connection, but communicating with your printer in order to get it to print anything.
A quick look on the SATO website and there are Linux / Windows drivers for their printers. There are programming manuals for some of their printers. I couldn't see one for an SA408. You may need to download several manuals to see if they use a common programming language and hope that they implemented the same on your printer.
here is programing manual for this printer, I don't know what i am doing wrong?
Assuming your printer is covered by that manual, then page 2-5 pretty much gives you the answer.
Post the code you've got so far.
Here is code i am trying
<ESC>A
<ESC>H0025<ESC>V0050<ESC>L0303<ESC>MSATO
<ESC>H0100<ESC>V0150<ESC>MSATO
<ESC>Q2
<ESC>Z
No, your complete sketch code ...
For sure- I spent many years in printing systems at Xerox and be it IBM mainframe channel connection or PC style serial or Centronics, getting the desired commands into the data was usually the problem.
Is that <ESC> character an actual hex 1B, or can you specify a surrogate? (Like at Xerox decades ago we usually used to specify the ~ as a surrogate, since a printable character is easier to send than those down the lower end of the Ascii table.)
How are you forming those strings of <ESC>s? You would presumably be using a serial print to transmit them?
edit- or is it that you send a string <ESC> as printable text?
But where's the Arduino in that pic?
I am not using any anduino code , just send the codes via serial port using MAX232 to TTL convertor
So where's the Arduino fit in?
In this pic it looks as if the printer's connected to the laptop?

Yet you did previuosly say:
Yep printer is directly connected to TTL usb adaptor, If this work in TTL adaptor,later i will use arduino to automate
Is your terminal program sending the STX character or is it sending the ASCII characters '<','S','T','X','>'.
It looks like it's sending the ASCII characters which is not what you want.
No it send Sending STX character, can share any example or reference. I have tried but no reponse from printer.
<STX>
<ESC>A
<ESC>H0025<ESC>V0050<ESC>L0303<ESC>MSATO
<ESC>H0100<ESC>V0150<ESC>MSATO
<ESC>Q2
<ESC>Z
<ETX>
No it isn't. The way you've typed it in your screenshot, the terminal program is sending out the 5 characters '<', 'S', 'T', 'X' & '>'
If you want to send STX you need to type in $02. Similarly for ETX, it is $03, and ESC is $1B.
To send the line:
<ESC>H0025<ESC>V0050<ESC>L0303<ESC>MSATO
you would type in:
$1BH0025$1BV0050$1BL0303$1BMSATO
Thanks for the help man
But i found a another way by using EPL language.
void setup() {
Serial.begin(9600);
delay(4000);
PrintPage();
}
void loop() {
}
void PrintPage(){
String PrintNumber = "test";
Serial.println("<xpml><page quantity='0' pitch='25.0 mm'></xpml>I8,A");
Serial.println("ZN");
Serial.println("q413");
Serial.println("S3");
Serial.println("O");
Serial.println("JF");
Serial.println("eKIZZQ0");
Serial.println("eKI9+0.0");
Serial.println("D10");
Serial.println("ZT");
Serial.println("Q200,B25");
Serial.println("eArgeelabel 250 31");
Serial.println("eeexit");
Serial.println("eKI80");
Serial.println("<xpml></page></xpml><xpml><page quantity='1' pitch='25.0 mm'></xpml>N");
Serial.println("b137,28,Q,m2,s7,eL,iA,\"12345678\"");//QR code
Serial.println("A268,28,2,3,1,1,N,\""+PrintNumber+"\"");// Dyanamic System
Serial.println("P1");
Serial.println("<xpml></page></xpml><xpml><end/></xpml>");
}

