Results 1 to 4 of 4

Thread: Barcode Printing problems

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2017
    Posts
    1

    Barcode Printing problems

    I am currently working on a small barcoding project a previous employee had implemented to put barcode labels to items in the manufacturing process. The label produced has 10 fields that contain data such as:
    • Machine Number
    • Part Number
    • Traceability Info
    • Footage

    The purpose of the barcode was so that quality control could quickly scan the information into our product database for record keeping.

    My problem is that the associate who created code did not stay long enough to test the validity of it to the project spec. For example depending on the text in the machine number or traceability info, the barcode may or may not scan.

    Here is an example of the code being used.

    If lstMachine.Text = "XM1" Then
    txtMachineCode.Text = "*XM1=Primary*"
    txtMachineText.Text = "XM1"
    'lstColor.Text = "----"
    XM1Count = Integer.Parse(txtXM1Count.Text)
    txtXM1Count.Text = XM1Count + 1
    This code basically states that when the operator selects XM1 on their drop down menu the XM1 Primary will be printed on the barcode tag. (They have other machines they can choose as well)

    The Code below is the barcode format to use to send to the printer
    Me.txtMachineCode.Font = New System.Drawing.Font("IDAutomationHC39M Free Version", 8.249999!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(2, Byte))
    Me.txtMachineCode.Location = New System.Drawing.Point(705, 174)
    Me.txtMachineCode.Name = "txtMachineCode"
    Me.txtMachineCode.Size = New System.Drawing.Size(175, 48)
    Me.txtMachineCode.TabIndex = 15

    So here is where I am at.
    Not a printer issue as I can successfully scan the other barcodes such as part number and Footage
    I can change the "XM1 Primary" to other text such as "spec" or "spec12345" and it will scan
    I can change the "XM1 Primary" to other text such as "XM1" or "Primary" or "Prime" and it will not scan.

    I think the problem may reside in the CType portion of the barcode font block but most of my experience revolves around JavaScript and I am not familiar with the CType instruction or why it is coded with a Byte (unsigned integer).

    Thanks to anyone who can help.

  2. #2
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

    Re: Barcode Printing problems

    Normally, when you create a bar code that you want to later scan into a database, you just print the text you want the scanner to read in a bar code font, at the appropriate font size for your scanner hardware. You do not normally want to embed control codes into the text, and you want to make sure that the text is relatively short and simple. You are not going to want to scan the contents of "War and Peace" using your scanner.

    Post the make and model of the scanner(s) that you are using.

    Also, try entering the text you want to scan later into a Word document, one data item per line, then print it out on a laser printer using the bar code font you have been using. Try to scan the text back into Notepad to see what you get.
    Last edited by jdc2000; Dec 19th, 2017 at 05:58 PM.

  3. #3
    You don't want to know.
    Join Date
    Aug 2010
    Posts
    4,578

    Re: Barcode Printing problems

    Just from the examples you listed, it seems there's a pattern.

    You can't scan "XM1 Primary". But you can scan "spec" or "spec12345". The second sentence it's not clear if you can scan "XM1" or "Primary" or "Prime" alone.

    The things you say you can't scan have spaces and/or capital letters in them. The things you say you can scan don't.

    Also, thats' a very strange use of the Font() constructor. You are specifying, in order: the font family, the size, the font style, the units of the size, and the "GDI character set".

    I have no clue what the GDI character set is, but maybe it's needed for this font. You could use CByte(2) here instead of CType(2, Byte), but I bet just 2 would work. The 8.249999 size for the font is very, very specific. That's kind of odd to me. I dunno.
    This answer is wrong. You should be using TableAdapter and Dictionaries instead.

  4. #4
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,393

    Re: Barcode Printing problems

    The bar code scanners we use have no trouble with spaces or upper and lower case letters, which is why I asked what scanner(s) you are using. Some bar code scanners work well, others can be very finicky.

    The correct font size can be critical in getting reliable scans. An 8.249999 size could be trouble. You also need a printer that can print decent quality bar codes, with no unwanted gaps, missing or extra ink or toner, etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width