A
Andrew Martin
I'm working with a BT device sending simple ASCII to the BT printer.
I have the Zebra Label Vista tool to create my format code and am
attempting to send it over BT COM6. The first btnSend_Click fails,
but when I send a short string of text - it works fine. Am I missing
something?
private void btnSend_Click(object sender, System.EventArgs e)
{
Print(@"! 0 200 200 200 1");
Print(@"JOURNAL");
Print(@"CONTRAST 0");
Print(@"TONE 0");
Print(@"SPEED 5");
Print(@"PAGE-WIDTH 200");
Print(@"BAR-SENSE");
Print(@";// PAGE 0000000002000200");
Print(@"BOX 0 0 194 190 1");
Print(@"T 0 0 52 52 Test Printer");
Print(@"PRINT");
System.Windows.Forms.MessageBox.Show("Sent");
}
private void btnSend2_Click(object sender, System.EventArgs e)
{
Print(@"TEST");
System.Windows.Forms.MessageBox.Show("Sent 2");
}
private void Print(string text)
{
if (text.Length > 1024) throw new Exception("Too Long");
byte[] outputData = new byte[1024];
for(int i = 0 ; i < text.Length ; i++)
{
outputData = Convert.ToByte(text);
}
port.Output = outputData;
System.Threading.Thread.Sleep(1000);
}
I have my serial port setup:
portSettings = new HandshakeNone();
port = new Port("COM6:", portSettings);
port.RThreshold = 1024;
port.InputLen = Int32.MaxValue;
port.SThreshold = BYTES;
Is there something else that I might be doing wrong? I tried to test
with sending a short string, followed by a long, and that fails as
well.
Any ideas are appreciated.
-a
This is the reference I found regarding Ginny's experience printing
custom Zebra formats (from .lbl files):
http://groups.google.com/groups?q=p...off&selm=Oty0Ly21CHA.1764@TK2MSFTNGP10&rnum=3
I have the Zebra Label Vista tool to create my format code and am
attempting to send it over BT COM6. The first btnSend_Click fails,
but when I send a short string of text - it works fine. Am I missing
something?
private void btnSend_Click(object sender, System.EventArgs e)
{
Print(@"! 0 200 200 200 1");
Print(@"JOURNAL");
Print(@"CONTRAST 0");
Print(@"TONE 0");
Print(@"SPEED 5");
Print(@"PAGE-WIDTH 200");
Print(@"BAR-SENSE");
Print(@";// PAGE 0000000002000200");
Print(@"BOX 0 0 194 190 1");
Print(@"T 0 0 52 52 Test Printer");
Print(@"PRINT");
System.Windows.Forms.MessageBox.Show("Sent");
}
private void btnSend2_Click(object sender, System.EventArgs e)
{
Print(@"TEST");
System.Windows.Forms.MessageBox.Show("Sent 2");
}
private void Print(string text)
{
if (text.Length > 1024) throw new Exception("Too Long");
byte[] outputData = new byte[1024];
for(int i = 0 ; i < text.Length ; i++)
{
outputData = Convert.ToByte(text);
}
port.Output = outputData;
System.Threading.Thread.Sleep(1000);
}
I have my serial port setup:
portSettings = new HandshakeNone();
port = new Port("COM6:", portSettings);
port.RThreshold = 1024;
port.InputLen = Int32.MaxValue;
port.SThreshold = BYTES;
Is there something else that I might be doing wrong? I tried to test
with sending a short string, followed by a long, and that fails as
well.
Any ideas are appreciated.
-a
This is the reference I found regarding Ginny's experience printing
custom Zebra formats (from .lbl files):
http://groups.google.com/groups?q=p...off&selm=Oty0Ly21CHA.1764@TK2MSFTNGP10&rnum=3