Java 打印机Argox PPLA

Java 打印机Argox PPLA,java,Java,我吃Argox标签打印机有问题,只是仍然不能给她发送任何东西。 型号为Argox OS214 tt,ANPP,接受PPLB 使用一个通用类连接到串行设备,我使用她为几个财政打印机和秤,是附加的。所有这些都使用rxtx库。 该类还可以从设备读取响应,因为该设备已经在磅秤上使用,并且从未出现过问题,就像在财政打印机上一样 我看了PPLA手册,或多或少看到了它是如何工作的,但还不能测试任何东西。 我对此无能为力,也看不出你的反应 这是我的测试: import javax.swing.JOptionPa

我吃Argox标签打印机有问题,只是仍然不能给她发送任何东西。 型号为Argox OS214 tt,ANPP,接受PPLB

使用一个通用类连接到串行设备,我使用她为几个财政打印机和秤,是附加的。所有这些都使用rxtx库。 该类还可以从设备读取响应,因为该设备已经在磅秤上使用,并且从未出现过问题,就像在财政打印机上一样

我看了PPLA手册,或多或少看到了它是如何工作的,但还不能测试任何东西。 我对此无能为力,也看不出你的反应

这是我的测试:

import javax.swing.JOptionPane;  
public class TestePPLA {  
public static void main(String[] args){  
    String porta="COM1";  
    int velocidade=9600;  
    int databits=8;  
    int stopbits=1;  
    int paridade=0;  
    int timeout=10;  
    try  
    {             
        String comando = "<STX>L<CR>121100001000050THIS LABEL IS MADE BY JIMMY<CR>E<CR>";  
        ComunicacaoSerial comunica = ComunicacaoSerial.getReference ();  
        comunica.conexao (porta,velocidade,databits,stopbits,paridade);  
        comunica.escritaPortaSerial (comando.getBytes());  

        Thread.sleep(timeout);  
        String resposta = new String (comunica.getDados());  

        comunica.fechaConexao();                  

        System.out.println(resposta);  
    }  
    catch(Exception ex)  
    {  
        ex.printStackTrace();  
        JOptionPane.showMessageDialog(null, "Erro de comunica\u00e7\u00e3o com a impressora", "Testador", JOptionPane.ERROR_MESSAGE);  
    }  

}  
}  
import javax.swing.JOptionPane;
公共类TestePPLA{
公共静态void main(字符串[]args){
字符串porta=“COM1”;
int-velocidade=9600;
int-databits=8;
int停止位=1;
int-paridade=0;
int超时=10;
尝试
{             
字符串comando=“L1211000010000050此标签由JIMMYE制作”;
ComunicacaoSerial-comunica=ComunicacaoSerial.getReference();
comunica.conexao(porta、velocidade、databits、stopbits、paridade);
comunica.escritaPortaSerial(comando.getBytes());
睡眠(超时);
String resposta=新字符串(comunica.getDados());
comunica.fechaConexao();
系统输出打印项次(resposta);
}  
捕获(例外情况除外)
{  
例如printStackTrace();
JOptionPane.showMessageDialog(null,“通信错误\u00e7\u00e3o-com-a-impressora”,“测试程序”,JOptionPane.ERROR\u消息);
}  
}  
}  

对于您所说的,问题是您正在向PPLB打印机发送PPLA代码,当您执行此操作时,打印机将不执行任何操作。这是PPLB代码的一个示例:

N↵
A50,30,0,1,1,1,N,"This is font 1." ↵
A50,70,0,2,1,1,N,"This is font 2." ↵
A50,110,0,3,1,1,N,"This is font 3." ↵
A50,150,0,4,1,1,N,"This is font 4." ↵
A50,200,0,5,1,1,R,"FONT 5"↵
P1↵