05-03-2011 10:23 PM
05-04-2011 09:15 AM
Yes, I have had expereince with these printers. Though I am more familiar with Zebra's desktop and tabletop printers. You should be able to define a label in either the CPCL or ZPL language fairly easily. If you could post an exampl eof what you want your label to look like I could provide some assistance.
As for writing to the printer using USB I believe you have a few options. One would be to add a print driver and specify the printer as a raw printer. Then you would print through that driver. The other option would be to use a custom VISA USB driver. You can use the driver wizard to create the driver. This would be the easiest option. The QL220 has a VID of 0x0A5F and a PID of 0x003B. Communicating through USB to this printer via VISA is pretty straightforward. You basically need the VISA Open, Read (if necessary), Write and Close.
05-05-2011 09:27 PM
Mark, Any guidance would be appreciated.- i assume you are talking about the instrument wizzard?
All I am trying to achieve is a simple label of the following layout Where the filed are grabbed out of the labview program (which all seams to work fine) as shown below
Title (bold)
Date DD:MM YYYY HH:MM - this is from the lavview application not the printer generated time date stamp
Operator : (initials)
Organization:(name)
Location:(name)
Reason:(field value)
Post Comment: (field Value)
S/N :(list of 4 serial numbers one beneath the other)
D/F: (calculated labview field)
blank line
SIgnature_________________
It is a calibration report that reads an instrument & get the parameters and prints the above label.
I have tried three alternative using the Labview , including the report vi , sending as a cluster of strings as an image, sending formatted serial text, and attempted the send using Active x.
It messes with the pagination and I wonder if it is because I am using the windows driver and spooler? ( this is a local USB printer) if I reduce the label size to to a value 45X58mm and print text to the label it prints the data to the single label but stops short and wont spool to the next gap (am using the gap sensing). Simply adding a line feed to the end of the formatted text results in a blank label being printed after the populated label.
Also if I set the number of copies to two this also fails with the labview report vi.
I have played with setting in the print driver and within the labview environment and simply getting a nice formatted label which spools correctly to the next label hasn't been achieved.
Any guidance would be gratefully appreciated.
Greg Nicholls
05-06-2011 11:36 AM
Try using the following label format in your application:
! 0 200 200 440 1
TEXT 4 0 20 10 <TITLE>
TEXT 0 3 10 70 <TIMESTAMP>
TEXT 0 3 10 100 Operator: <INITIALS>
TEXT 0 3 10 130 Organization: <ORGANIZATION>
TEXT 0 3 10 160 Location: <LOCATION>
TEXT 0 3 10 190 Reason: <REASON>
TEXT 0 3 10 220 Post Comment: <COMMENT>
TEXT 0 3 10 250 S/N: <SN>
TEXT 0 3 10 280 D/F: <DATEFIELD>
TEXT 0 3 10 340 Signature:
LINE 165 365 380 365 1
PRINT
Replace the fields <x> with the appropriate data using calls to Replace String. Configure your print driver to be a raw printer. This should print the desired label you want.
NOTE: The above is using CPCL commands to format and print the label. This is the native print language for the QL220.
05-13-2011 03:29 AM
Thanks for your input.
I havent been able to successfully accomplish a print with the CPCL protocol via the port. my other concern is that this is nolonger a generic selectable printer using the windows default. (if the operatotrs were to replace with another label printer).
I have attached a code snippett of what code i am running on my development machine. If i set it too a standard report i get the double label printing occuring where the last label is balnk as though the pagination or gap sense fails. if i set it too word it successfully prints only a single label?????
what is the difference between these two ?
Can i use the free microsoft word viewer as the interface to LabVIEW reports vi to print a label or does it have to be the complete word office package? i have installed this and i keep getting a "-41106 error code" saying NI_Word.LVclass.new.report subVi......etc. ??? as though some library is not found
Thanks for your assistance
Greg Nicholls
05-24-2011 09:56 AM
Greg,
I can't comment much on the LV report generation tools as I have not used them often. They don't work as seamlessly with label printers as the report generation tools do not provide access to all the features of the printer. I am not sure why you are seeing double prints.
What was the issue you were having with using the CPCL? I understand your concern about providing a generic solution but the CPLC should have worked for you. Were you having issues with the communication or the actual label output from the printer? When using the straight CPCL you should send the data to the printer directly and not send it via the report generation toolkit.
05-30-2011 10:46 PM
Mark
thaking you for your input i have been persisting with the CPCL approach but haven't been able to get the USB connectivity to the Zebra printer to work.
I have been following the labview examples and it indicates that i should configure the printer as a raw input device. (which i believe i have done through the windows printer setting). However the readings suggest that i need to set it up in MAX first - this is where i think i mabe misunderstanding the process as max dosent seem to be able to see the printer.
Would you be able to assist with an example code snippet of how to establosh connectivity or provide helpful links
Thanking you
Greg
05-31-2011 09:37 AM
You can use the driver wizrd in Max to create a driver for the printer. The VID is 0x0A5F and the PID for the QL220 is 0x003B. You can get teh device's serial number using the following command: [! U1 getvar "usb.device.serial_string" ]. The device wizard needs teh VID, PID and serial number of the device. It will create a Window's inf file and install this on your system. Once installed you can use the basic VISA commands (Open, Read, Write, Close) to communicate with the printer on the USB port. To build the VISA resource name you can use Format To String with the following format string: "USB::0x%04x::0x%04x::%s::RAW". The first parameter is the VID, the second is the PID and the third is the serial number.
The one issue with this approach is that other programs that would require a driver for the printer will not be able to communicate with it. Once a driver is installed that is the only one that can be used. There may be a way to send the raw data through the Windows printer driver but I have never investigated that approach.
I use the above approach for all of my USB communcations with Zebra printers.
02-28-2012 03:34 AM
hi all
i am C sharp programer
and i have zebra QL 220 plus
and roll type is 42X20mm
and i have the zebra sdk
and i create mobile application in C# smart device
and i tring to connect to printer from my application by bluetooth
in sdk i got this and use
using System; using ZSDK_API.Comm; using System.Text; using System.Threading; // This example prints "This is a ZPL test." near the top of the label. private void SendZplOverBluetooth(String theBtMacAddress) { try { // Instantiate a connection for given Bluetooth(R) MAC Address. ZebraPrinterConnection thePrinterConn = new BluetoothPrinterConnection(theBtMacAddress); // Open the connection - physical connection is established here. thePrinterConn.Open(); // Defines the ZPL data to be sent. String zplData = "^XA^FO20,20^A0N,25,25^FDThis is a ZPL test.^FS^XZ"; // Send the data to the printer as a byte array. thePrinterConn.Write(Encoding.Default.GetBytes(zplData)); // Make sure the data got to the printer before closing the connection Thread.Sleep(500); // Close the connection to release resources. thePrinterConn.Close(); } catch (Exception e) { // Handle communications error here. Console.Write(e.StackTrace); } } // This example prints "This is a CPCL test." near the top of the label. private void SendCpclOverBluetooth(String theBtMacAddress) { try { // Instantiate a connection for given Bluetooth(R) MAC Address. ZebraPrinterConnection thePrinterConn = new BluetoothPrinterConnection(theBtMacAddress); // Open the connection - physical connection is established here. thePrinterConn.Open(); // Defines the CPCL data to be sent. String cpclData = "! 0 200 200 210 1\r\n" + "TEXT 4 0 30 40 This is a CPCL test.\r\n" + "FORM\r\n" + "PRINT\r\n"; // Send the data to the printer as a byte array. thePrinterConn.Write(Encoding.Default.GetBytes(cpclData)); // Make sure the data got to the printer before closing the connection Thread.Sleep(500); // Close the connection to release resources. thePrinterConn.Close(); } catch (Exception e) { // Handle communications error here. Console.Write(e.StackTrace); } }
and once i use ZPL method it print 17 barcod always with 16 blank Patches (labels)
and when i use CPCL method it print 12 BarCode always with 11 blank Patches (labels)
and i dont know why ?
it must print 1 Patch (label)
what i can do and i dont think there is eny rong with my code
all waht i want is how i can give Length and width and how much label print coz it is always print 17 or 12 what i can do ?
02-29-2012 11:03 AM
Hey mohm4z,
Thanks for posting on our forums. I'm looking through your post and I'm trying to figure out if you're using any National Instruments(NI) hardware or software. The original post was related to interfacing the Zebra QL220 with a LabVIEW Report VI. In your case though I am not seeing where you're using any of our products. Your coding all seems to relate to functions and libraries for non-NI devices. With that being said it will be difficult for me to provide thorough advice because I'm not extremely familiar with this hardware. Hopefully someone else who is familiar with your application will be able to comment on your issue.