EAN128Ex Barcode Issue - Code Set Auto A
9 posts • Page 1 of 1
EAN128Ex Barcode Issue - Code Set Auto A
Hi, I have question in accomplishing the following.
My data contains an odd number of characters. 999969480888944912671187988
Currently when using your EAN128Ex/Code128Ex function I pass ~1999969480888944912671187988.
I do get a working and readable barcode and the first 26 digits are encoded but Code Set C and the last digit with Code Set B.
Using GS1 Analyzer: C|99996948088894491267118798B8%S
I have a special requirement in which I need to have the first 26 digits to be encoded in Code Set C and the last digit with Code Set A.
Needs to be: C|99996948088894491267118798A84S
How can I accomplish it? I was looking at your "~" functions but can't seem to figure it out. Please help.
FYI, I have tried to ~1999969480888944912671187988~A, which produces start C end A but when I scan it with the warehouse scan gun, it deletes adds then deletes the text.
My data contains an odd number of characters. 999969480888944912671187988
Currently when using your EAN128Ex/Code128Ex function I pass ~1999969480888944912671187988.
I do get a working and readable barcode and the first 26 digits are encoded but Code Set C and the last digit with Code Set B.
Using GS1 Analyzer: C|99996948088894491267118798B8%S
I have a special requirement in which I need to have the first 26 digits to be encoded in Code Set C and the last digit with Code Set A.
Needs to be: C|99996948088894491267118798A84S
How can I accomplish it? I was looking at your "~" functions but can't seem to figure it out. Please help.
FYI, I have tried to ~1999969480888944912671187988~A, which produces start C end A but when I scan it with the warehouse scan gun, it deletes adds then deletes the text.
Last edited by uvalleza1 on Fri Mar 29, 2019 8:04 pm, edited 1 time in total.
- uvalleza1
- Posts: 5
- Joined: Wed Mar 20, 2019 2:29 pm
Re: EAN128Ex Barcode Issue
First of all, ~A won't work because it translates to ASCII 1, not for switching codeset.
The last single digit 8 can be encoded with either codeset A or codeset B. Our implement (EAN128Ex) chooses to use codeset B. The standard does not require A to be used. The resulted barcode produces the same result, with the same length. Therefore either result is standard compliant.
It will require us to modify EAN128Ex code to produce such a barcode (use A instead of B on digits).
If all barcodes that you are creating have the same pattern (27 digits), you can write your own code based on our implement of Code128C and Code128A. First convert first 26 digits into 13 codeC values. then add set-A and A values. Calculate the checksum and lookup the character presentations in the font.
The whole barcode string is
set-C + 13 values + set-A + A value for last digit + checksum + stop character+termination bar
The last single digit 8 can be encoded with either codeset A or codeset B. Our implement (EAN128Ex) chooses to use codeset B. The standard does not require A to be used. The resulted barcode produces the same result, with the same length. Therefore either result is standard compliant.
It will require us to modify EAN128Ex code to produce such a barcode (use A instead of B on digits).
If all barcodes that you are creating have the same pattern (27 digits), you can write your own code based on our implement of Code128C and Code128A. First convert first 26 digits into 13 codeC values. then add set-A and A values. Calculate the checksum and lookup the character presentations in the font.
The whole barcode string is
set-C + 13 values + set-A + A value for last digit + checksum + stop character+termination bar
The information above is provided "AS IS", with no warranties, and confers no rights.
-
glitch - Support Engineer
- Posts: 198
- Joined: Wed May 14, 2008 2:42 pm
Re: EAN128Ex Barcode Issue
Hey glitch, I am not sure if it'll always be 27 characters but my guess is that it will be but it will always be digits.
So to understand you don't support switching codeset? and the current function will choose B. Unfortunately our client uses bartender which has the option for Code Set Auto (produces what you have) and Code Set Auto A which uses code set A at the end and is the only one they will accept.
With that said, it'll be preferred if you can assist with either creating a new EAN128Ex function for that case but am sure it'll be a while.
So is it possible to give me an example of how the encoding will look?
ÊÇ(Code Set C + Func 1) + 13 CodeSet C characters + È(Code Set A) + 1 Code Set A Character + checksum (is this calculated the same even when switching code sets?) + stop character(Ë) + termination bar(Í)
and sorry I know you posted the below but I am not too familiar with this. I just started learning this about a week ago...
set-C + 13 values + set-A + A value for last digit + checksum + stop character+termination bar
So to understand you don't support switching codeset? and the current function will choose B. Unfortunately our client uses bartender which has the option for Code Set Auto (produces what you have) and Code Set Auto A which uses code set A at the end and is the only one they will accept.
With that said, it'll be preferred if you can assist with either creating a new EAN128Ex function for that case but am sure it'll be a while.
So is it possible to give me an example of how the encoding will look?
ÊÇ(Code Set C + Func 1) + 13 CodeSet C characters + È(Code Set A) + 1 Code Set A Character + checksum (is this calculated the same even when switching code sets?) + stop character(Ë) + termination bar(Í)
and sorry I know you posted the below but I am not too familiar with this. I just started learning this about a week ago...
set-C + 13 values + set-A + A value for last digit + checksum + stop character+termination bar
- uvalleza1
- Posts: 5
- Joined: Wed Mar 20, 2019 2:29 pm
Re: EAN128Ex Barcode Issue
Digits can be encoded with either set A or set B. so either barcode conforms to the Code128 standard.
Yes your understanding is correct. The checksum is calculated based on preceding code128 values including the switching code.
It is possible for us to modify EAN128Ex with a fee however it will take quite some time.
Yes your understanding is correct. The checksum is calculated based on preceding code128 values including the switching code.
- Code: Select all
ÊÇ(Code Set C + Func 1) + 13 CodeSet C characters + È(Code Set A) + 1 Code Set A Character + checksum (is this calculated the same even when switching code sets?) + stop character(Ë) + termination bar(Í)
It is possible for us to modify EAN128Ex with a fee however it will take quite some time.
The information above is provided "AS IS", with no warranties, and confers no rights.
-
glitch - Support Engineer
- Posts: 198
- Joined: Wed May 14, 2008 2:42 pm
Re: EAN128Ex Barcode Issue
Glitch,
Can you send me a PM with the fee and timeline? The idea would be to create a new function EAN128ExA() or something. But PM me with info/contact info.
Can you send me a PM with the fee and timeline? The idea would be to create a new function EAN128ExA() or something. But PM me with info/contact info.
- uvalleza1
- Posts: 5
- Joined: Wed Mar 20, 2019 2:29 pm
Re: EAN128Ex Barcode Issue
It seems that the PM feature does not work. You can send inquiry to support@morovia.com.
The information above is provided "AS IS", with no warranties, and confers no rights.
-
glitch - Support Engineer
- Posts: 198
- Joined: Wed May 14, 2008 2:42 pm
Re: EAN128Ex Barcode Issue
I sent an email yesterday with the first message of this thread. I will follow up to that one with the ask about adding this. Thanks a lot!
- uvalleza1
- Posts: 5
- Joined: Wed Mar 20, 2019 2:29 pm
Re: EAN128Ex Barcode Issue
Hello,
I hope this is ok to post but I just wanted to share the solution I figured out. I ended up modifying the code128Auto and added the func1 then changed BcharSet to equal AcharSet and changed the Chr to be Chr(202). I have verified this to be working and match what bartender is generating for Code Set "Auto A". I am now using the below with font MRV Code128M.
Public Function code128Auto(inpara As String) As String
Dim i As Integer
Dim charToEncode As String
Dim charPos As Integer
Dim checkSum As Integer
Dim checkDigit As String
Dim AcharSet As String
Dim BcharSet As String
Dim CcharSet As String
Dim mappingSet As String
Dim curCharSet As String
Dim strLen As Integer
Dim charVal As Integer
Dim weight As Integer
AcharSet = Code128aCharSet
BcharSet = Code128aCharSet
CcharSet = Code128cCharset
mappingSet = code128MappingSet
inpara = SpecialChar(inpara)
If inpara = "" Then
code128Auto = ""
Exit Function
End If
strLen = Len(inpara)
charVal = Asc(Mid(inpara, 1, 1))
If charVal <= 31 Then curCharSet = AcharSet
If charVal >= 32 And charVal <= 126 Then curCharSet = AcharSet
If ((strLen > 4) And IsNumeric(Mid(inpara, 1, 4))) Then curCharSet = CcharSet
Select Case curCharSet
Case AcharSet
code128Auto = code128Auto + Chr(200) + Chr(199)
Case BcharSet
code128Auto = code128Auto + Chr(202) + Chr(199)
Case CcharSet
code128Auto = code128Auto + Chr(202) + Chr(199)
End Select
For i = 1 To strLen
charToEncode = Mid(inpara, i, 1)
charVal = Asc(charToEncode)
If charVal = 199 Then
code128Auto = code128Auto + Chr(199)
ElseIf ((i < strLen - 2) And (IsNumeric(charToEncode)) And (IsNumeric(Mid(inpara, i + 1, 1))) And (IsNumeric(Mid(inpara, i, 4)))) Or _
((i < strLen) And (IsNumeric(charToEncode)) And (IsNumeric(Mid(inpara, i + 1, 1))) And (curCharSet = CcharSet)) Then
If curCharSet <> CcharSet Then
code128Auto = code128Auto + Chr(196)
curCharSet = CcharSet
End If
charToEncode = Mid(inpara, i, 2)
charVal = Val(charToEncode)
code128Auto = code128Auto + Mid(mappingSet, charVal + 1, 1)
i = i + 1
ElseIf (((i <= strLen) And (charVal < 31)) Or ((curCharSet = AcharSet) And (charVal > 32 And charVal < 96))) Then
If curCharSet <> AcharSet Then
code128Auto = code128Auto + Chr(198)
curCharSet = AcharSet
End If
charPos = InStr(1, curCharSet, charToEncode, 0)
code128Auto = code128Auto + Mid(mappingSet, charPos, 1)
ElseIf (i <= strLen) And (charVal > 31 And charVal < 127) Then
If curCharSet <> BcharSet Then
code128Auto = code128Auto + Chr(198)
curCharSet = BcharSet
End If
charPos = InStr(1, curCharSet, charToEncode, 0)
code128Auto = code128Auto + Mid(mappingSet, charPos, 1)
End If
Next i
strLen = Len(code128Auto)
For i = 1 To strLen
charVal = (Asc(Mid(code128Auto, i, 1)))
If charVal = 204 Then
charVal = 0
ElseIf charVal <= 126 Then
charVal = charVal - 32
ElseIf charVal >= 192 Then
charVal = charVal - 97
End If
If i > 1 Then
weight = i - 1
Else
weight = 1
End If
checkSum = checkSum + charVal * weight
Next i
checkSum = checkSum Mod 103
checkDigit = Mid(mappingSet, checkSum + 1, 1)
code128Auto = code128Auto + checkDigit + Chr(203) + Chr(205)
End Function
I hope this is ok to post but I just wanted to share the solution I figured out. I ended up modifying the code128Auto and added the func1 then changed BcharSet to equal AcharSet and changed the Chr to be Chr(202). I have verified this to be working and match what bartender is generating for Code Set "Auto A". I am now using the below with font MRV Code128M.
Public Function code128Auto(inpara As String) As String
Dim i As Integer
Dim charToEncode As String
Dim charPos As Integer
Dim checkSum As Integer
Dim checkDigit As String
Dim AcharSet As String
Dim BcharSet As String
Dim CcharSet As String
Dim mappingSet As String
Dim curCharSet As String
Dim strLen As Integer
Dim charVal As Integer
Dim weight As Integer
AcharSet = Code128aCharSet
BcharSet = Code128aCharSet
CcharSet = Code128cCharset
mappingSet = code128MappingSet
inpara = SpecialChar(inpara)
If inpara = "" Then
code128Auto = ""
Exit Function
End If
strLen = Len(inpara)
charVal = Asc(Mid(inpara, 1, 1))
If charVal <= 31 Then curCharSet = AcharSet
If charVal >= 32 And charVal <= 126 Then curCharSet = AcharSet
If ((strLen > 4) And IsNumeric(Mid(inpara, 1, 4))) Then curCharSet = CcharSet
Select Case curCharSet
Case AcharSet
code128Auto = code128Auto + Chr(200) + Chr(199)
Case BcharSet
code128Auto = code128Auto + Chr(202) + Chr(199)
Case CcharSet
code128Auto = code128Auto + Chr(202) + Chr(199)
End Select
For i = 1 To strLen
charToEncode = Mid(inpara, i, 1)
charVal = Asc(charToEncode)
If charVal = 199 Then
code128Auto = code128Auto + Chr(199)
ElseIf ((i < strLen - 2) And (IsNumeric(charToEncode)) And (IsNumeric(Mid(inpara, i + 1, 1))) And (IsNumeric(Mid(inpara, i, 4)))) Or _
((i < strLen) And (IsNumeric(charToEncode)) And (IsNumeric(Mid(inpara, i + 1, 1))) And (curCharSet = CcharSet)) Then
If curCharSet <> CcharSet Then
code128Auto = code128Auto + Chr(196)
curCharSet = CcharSet
End If
charToEncode = Mid(inpara, i, 2)
charVal = Val(charToEncode)
code128Auto = code128Auto + Mid(mappingSet, charVal + 1, 1)
i = i + 1
ElseIf (((i <= strLen) And (charVal < 31)) Or ((curCharSet = AcharSet) And (charVal > 32 And charVal < 96))) Then
If curCharSet <> AcharSet Then
code128Auto = code128Auto + Chr(198)
curCharSet = AcharSet
End If
charPos = InStr(1, curCharSet, charToEncode, 0)
code128Auto = code128Auto + Mid(mappingSet, charPos, 1)
ElseIf (i <= strLen) And (charVal > 31 And charVal < 127) Then
If curCharSet <> BcharSet Then
code128Auto = code128Auto + Chr(198)
curCharSet = BcharSet
End If
charPos = InStr(1, curCharSet, charToEncode, 0)
code128Auto = code128Auto + Mid(mappingSet, charPos, 1)
End If
Next i
strLen = Len(code128Auto)
For i = 1 To strLen
charVal = (Asc(Mid(code128Auto, i, 1)))
If charVal = 204 Then
charVal = 0
ElseIf charVal <= 126 Then
charVal = charVal - 32
ElseIf charVal >= 192 Then
charVal = charVal - 97
End If
If i > 1 Then
weight = i - 1
Else
weight = 1
End If
checkSum = checkSum + charVal * weight
Next i
checkSum = checkSum Mod 103
checkDigit = Mid(mappingSet, checkSum + 1, 1)
code128Auto = code128Auto + checkDigit + Chr(203) + Chr(205)
End Function
- uvalleza1
- Posts: 5
- Joined: Wed Mar 20, 2019 2:29 pm
Re: EAN128Ex Barcode Issue - Code Set Auto A
I am glad that this worked out for you.
The information above is provided "AS IS", with no warranties, and confers no rights.
-
glitch - Support Engineer
- Posts: 198
- Joined: Wed May 14, 2008 2:42 pm
9 posts • Page 1 of 1
Return to Microsoft Office (Word, Excel, Access etc) and VB6
Who is online
Users browsing this forum: No registered users and 0 guests