Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

zebra 105

Status
Not open for further replies.

garths2

Programmer
Jan 15, 2002
57
US
I am having problems handshaking with an old Zebra 105 printer. The computer that the printer was hooked to was upgraded to a pentium 4 with Windows XP. I do not have the manual to the printer, so I do not know what the handshaking or serial port settings are supposed to be.

The problem is if I copy a zpl file to the com1 port through the command prompt (COPY TEMP.ZPL COM1)everything works fine but if I use a batch file with this same command or I use Visual Basic and the COM control the printer hangs up after printing about 17 labels. I played around by puting in a delay and it will print about 50 labels without stalling but some of the information on the labels are intermittently omitted.

Can anyone help me with this? I would greatly appreciate it.

Thanks in advance,
Garth
 
Try a 2 second delay in VB. There should be a Help file to pause or delay or wait for x number of seconds
Also add a DoEvents

Do
write ZPL
DoEvents
'add delay here
DoEvents
Loop

DougP, MCP
 
DougP,

Yeah, that is pretty much what I have, except the "doevent" around the delay (see my code below). I guess what I don't understand is what is the difference between copying the zpl file to COM1 at the command prompt and using a batch file or VB.

Private Sub PrintLblCmd_Click()
Dim cntr as Integer

For cntr = 0 To val(numLbls.Text) - 1
PrintLabel(label)
Next
End Sub

Public Sub PrintLabel(ByVal zplCommand As string)
comPort.handShaking = comXOnXoff
comPort.Output = zplCommand
Delay 2 ' delay is in seconds
End Sub


-Garth
 
Here is waht I do
Create another batch file
Called Printme.bat or something
this will have just one line
COPY TEMP.ZPL COM1

Then have VB create the file TEMP.ZPL

Open c:\TEMP.ZPL for Output as #1
For cntr = 0 To val(numLbls.Text) - 1
Print #1, label
Next
Close
' shell to Command Prompt to run Batch file
x= Shell("c:\Printme.bat",1)



DougP, MCP
 
I have already done that as well, as I mentioned in my first thread, but it doesn't work. It only prints out a few labels, about 17, and then locks up. The only thing that works consistantly, so far, is manualy copying the zpl file to the COM1 port by typing "COPY TEMP.ZPL COM1"

Thanks anyway.

-Garth

 
Does the ZPL file have as many labels as you need in it, or is it just one label?
Can you paste it in here?

Or just the first few lines?

DougP, MCP
 
DougP,

I am on vacation right now so I will provide you with an example when I get back.

Thanks,

Garth
 
DougP,

Here is a label from my zpl file:


^XA
^LH 10, 20
^FO215, 20^A0,15,15^FD11/05/2003^FS
^FO215, 40^A0,15,15^FD10:54:31 AM^FS
^FO 10, 60^A0,25,25^FDP/N: 91118-001^FS
^FO 10, 100^A0,25,25^FDPO/NUM: 100803^FS
^FO 10, 140^A0,25,25^FDMfg Lot: 12323^FS
^FO 10, 180^A0,25,25^FDLot No: 3-R167^FS
^FO 10, 220^A0,25,25^FDQty: 10 ^FS
^FO200,230^AD^FDQA^FS
^FO180,225^GB160,55,1
^XZ
 
Hi Garth,
I'm experiencing exactly the same problem, only mine manages 9 labels before stopping.

My VB6 application generates either a collection of ZPL files (one per label - approx 3Kb each), or one single ZPL file utilising the Serial No. field. The single ZPL file can manage to print any number of labels, however I need to manage both situations and the multiple ZPL is just not co-operating.

I have tried everything mentioned above with no success. I have also spoken to tech support at Zebra and they suggested I put the printer in DUMP mode to ensure that the printer was receiving exactly what I was sending. DUMP mode prints each line of ZPL (wastes alot of labels) and interestingly only printed ZPL for my first 9 labels and nothing for the rest. Zebra assure me the printer is configured correctly and that the problem lies with the method of sending the files to the printer. I am using a serial connection at a speed of 9600.

Sorry I have nothing to offer only solidarity.

If you discover a solution could you please let me know...
johnw@lshs.fsnet.co.uk

Thanks in advance,
John
 
you need to pause for a second so it won't skip them
example:

for a = 1 to numoflabels
open file for output as xxxx

call Pause(1)
next

here is a sub for the pause:
Sub Pause (duration)

Dim starttime

starttime = Timer

Do While Timer - starttime < duration
DoEvents
Loop

End Sub

Crazy maybe but it does print 200 labels without a problem.


DougP, MCP, A+
 
DougP,

I don't think you are reading the posts. Delays have allready been tried, since the first post.

Thanks,

Garth
 
On a different tack,

(1) Please try and lower the baud rate to what the old machine might have had. (Do you still have access to it? If so, thats the best).

(2) Any XP settings to send the raw data? (dont know much about XP).

(3) Any RAM/EMM settings in the XP to fiddle

In all, I take it that the VB (application) programme hasn't been changed.

End



 
Garth,
Can you tell me what size your ZPL files are please?

I'm not sure it will help but as my application prints 9x3Kb (27Kb) I'm curious if your 17 files amount to approximately the same amount of space...

Thanks,
John
 
Garth,
I built in a pause as suggested by DougP above (Thanks Doug) and am now getting up to 30 labels no bother, albeit relatively slowly.

Therefore I believe (but haven't proved) that it is the baud rate which is restricting the transfer of data to the printer. I know the Zebra S600 default rate is 9600 which is what I am running at, however it is configurable up to 57600 (according to Zebra tech support).

Hope this helps,
John
 
John,

20 labels = 7K. Right now I do not store my labels to a zpl file. I am streaming them directly to the COM control, since that has worked best for me. I also print about 30 labels error free, but unfortunately it is not good enough because my customer needs to print around 200. After 30 labels, certain fields start disappearing off of the labels intermittently. I have tried playing with the baud rate also but it usually ends up in locking up the printer.

The strangest thing is, if I manualy copy a zpl file at the command prompt it works perfect.

Garth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top