LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Barcode label printing in LV7.1

Hi,

I'm currently implementing a barcode label printing function to a final test program of our products. I want high control of image placement etc. on the labels. Therefore I've made a .vi interface where the barcodes are printed with true type fonts. The front panel is then printed on our label printer. However, the output is no good since the string indicators changes the appearance of the fonts compared to the output from other programs. The spacings are a bit larger and the font looks a bit bolder -- the result is that the scanners have problems reading the barcodes.

I want to save my self some time by asking if anybody has any suggestions on how to print barcode labels?

I'm currently considering using the report tool since this prints the font correctly (I'm making test versions as I'm writing). However, gaining full control of the final layout seems a bit more troublesome. Another method could be generating images from LV and then print and dispose after creation -- this solution is however clumsy since it e.g. requires a set of images corresponding to the character table.

I'm using LV7.1 Dev suite and Code128B barcodes.


- Martin
Message 1 of 10
(5,269 Views)
What printer are you using? I print barcode labels(with text and barcodes) using a Brother PTouch. Brother has an SDK that is free, and I was able to use that to interface to Labview. Other printer manufacturers may have similar software tools.
Message 2 of 10
(5,253 Views)
I also have Brother Ptouch printers. I'd be very pleased if you'd post a link - and if you'd include a vi that uses the SDK!

Right now I'm rewriting the table functions in LV to allow pictures in some rows. However, I'd like to have a look at your solution.


- Martin
0 Kudos
Message 3 of 10
(5,247 Views)
I use Eltron and Zebra printers. I downloaded the Programming manual from their websites. I simply send formatting and data strings to LPT1 using VISA write. Works fine , protocols are pretty simple too
Message 4 of 10
(5,240 Views)
Here is everything that you should need, including an example of how I am doing it. It's been a while since I set this up, but I think that you just have to install the .msi program, and make sure that the cocreate.dll is in the same folder as your VI. You will probably have to re-create the COM object connection to the BRss object. This uses a label template, and each object in the template can be modified through Labview. Look it over for a while, then let me know if you have any questions.
Message 5 of 10
(5,231 Views)
Thank! I've just tried it but...

From where did you get cocreate.dll? It causes LV to crash -- an error occurs in compatexport.cpp.

Also which printers are you using?

- Martin
0 Kudos
Message 6 of 10
(5,209 Views)
Hi again -- I've tried getting info out of Brother. Not easy. Brother DK did not even know that an SDK existed, and Brother UK wasn't of much help either. However, they could confirm that the SDK 1.4.3 (at http://www.p-touchsolutions.com/europe/uk/bpacsdk_download.cfm) do support the QL-550 even though the web site does not say so (they'll update their www).

I'm not familiar with ActiveX, but I guess that the cocreate.dll is one of your own files? And I reckon it's possible to print via the ActiveX object without it?

- Martin
0 Kudos
Message 7 of 10
(5,199 Views)
I got cocreate.dll from NI. Don't ask me how, but somebody in Tech Support found it. The Brother SDK doesn't support ActiveX, but it is some kind of COM object. That is why cocreate.dll is needed. I have used it with Labview 6.0 and 7.0, but I havent' tried it with 7.1. Have you tried to mass complile the folder it is in?

I am using the 9200DX, but am about to use it on the 9500PC. I am told that it will work. Brother tech support had always been horrible until I got the PTouch Product Manager's number. He put me in touch with someone in Japan, and I talked to them about the SDK. There was a communications gap, so I didn't get a whole lot out of it.
Message 8 of 10
(5,192 Views)
COM, DCOM, ActiveX potAto, pOtato... 🙂 I've been studying a bit this afternoon. COM came in '93 and was succeeded by DCOM. ActiveX is a kind COM (actually a modified Visual Basic VBX).... Today the names are used more or less interchangely...

I've tried everything. I think the only solution is a new version of cocreate.dll.

However, I've made it work in another way... I run a VB script by issuing e.g.:

wscript \"pathtovbscript\vbscript.vbs" Text Serial0123

with the command execution vi (wscipt should be in all newer version of windows). And vbscript.vbs looking like:

set Args = Wscript.Arguments

textField = Args(0)
barcodeField = Args(1)

' Print using the template
DoPrint("C:\path\template.lbl")


Sub DoPrint(strFilePath)
Set ObjDoc = CreateObject("BrssCom.Document")
bRet = ObjDoc.Open(strFilePath)
If (bRet <> False) Then
ObjDoc.SetText 0, textField
ObjDoc.SetBarcodeData 0, barcodeField
ObjDoc.DoPrint 0, "0"
End If
Set ObjDoc = Nothing
End Sub


Not very elegant but it's quite fast and it's working 🙂

- Martin
0 Kudos
Message 9 of 10
(5,180 Views)
I've tried starting a more general discussion in "How to execute COM objects in LabVIEW 7.1?" (http://forums.ni.com/ni/board/message?board.id=170&message.id=103058)

- Martin
0 Kudos
Message 10 of 10
(5,164 Views)